gc_i18n 1.5.7 → 1.5.8
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 +1076 -1032
- package/lib/gc_i18n.umd.js +18 -18
- package/package.json +1 -1
- package/packages/index.js +132 -16
package/lib/gc_i18n.es.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import './gc_i18n.css';
|
|
2
|
-
import
|
|
3
|
-
import { h as
|
|
4
|
-
import
|
|
2
|
+
import ft from "keyboardjs";
|
|
3
|
+
import { h as ve, ref as oe, computed as De, onMounted as In, nextTick as pt, Vue as R } from "vue-demi";
|
|
4
|
+
import Xe from "axios";
|
|
5
5
|
import k from "store2";
|
|
6
|
-
import
|
|
7
|
-
import { jws as
|
|
8
|
-
const
|
|
6
|
+
import T from "lodash-es";
|
|
7
|
+
import { jws as Pn } from "jsrsasign";
|
|
8
|
+
const Mn = [
|
|
9
9
|
"ar-SA",
|
|
10
10
|
// 阿拉伯语(沙特阿拉伯)
|
|
11
11
|
"ar-EG",
|
|
12
12
|
// 阿拉伯语-埃及
|
|
13
13
|
"fa-IR"
|
|
14
14
|
// 波斯语(伊朗)
|
|
15
|
-
],
|
|
15
|
+
], Ce = (t) => {
|
|
16
16
|
if (!t || typeof t != "string") return !1;
|
|
17
|
-
if (
|
|
17
|
+
if (Mn.includes(t)) return !0;
|
|
18
18
|
const e = t.split("-")[0].toLowerCase();
|
|
19
19
|
return ["ar", "fa"].includes(e);
|
|
20
|
-
},
|
|
20
|
+
}, Nn = (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
|
+
}, On = (t, e, n) => (e.forEach((o) => {
|
|
26
26
|
const s = o.key.split(".");
|
|
27
|
-
s[0] === "common" &&
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
}), t),
|
|
27
|
+
s[0] === "common" && T.find(t, { key: `${n}.${s[1]}` }) && T.remove(t, { key: `${n}.${s[1]}` });
|
|
28
|
+
const r = T.find(t, { key: o.key });
|
|
29
|
+
r ? T.merge(r, o) : t.push(o);
|
|
30
|
+
}), t), we = Xe.create({
|
|
31
31
|
timeout: 8e3
|
|
32
|
-
}),
|
|
32
|
+
}), ke = /* @__PURE__ */ new Map(), qe = (t) => String(t || "guest").replace(/[^\w-]/g, "_"), It = async ({
|
|
33
33
|
baseUrl: t,
|
|
34
34
|
token: e,
|
|
35
35
|
appCode: n,
|
|
@@ -37,38 +37,38 @@ const _n = [
|
|
|
37
37
|
}) => {
|
|
38
38
|
const s = k.get("I18N_LANGUAGES");
|
|
39
39
|
if (s && Array.isArray(s) && s.length > 0 && !o)
|
|
40
|
-
return s.map((
|
|
41
|
-
langCode:
|
|
42
|
-
langName:
|
|
40
|
+
return s.map((r) => ({
|
|
41
|
+
langCode: r.language || r.langCode || r,
|
|
42
|
+
langName: r.langName || r.language || r
|
|
43
43
|
}));
|
|
44
44
|
if (!n)
|
|
45
45
|
return [];
|
|
46
46
|
try {
|
|
47
|
-
const
|
|
47
|
+
const r = await we.get(`${t}/i18n-web//app/getsupportedlangs`, {
|
|
48
48
|
headers: {
|
|
49
49
|
appCode: n,
|
|
50
50
|
Authorization: e
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
55
|
-
langCode:
|
|
56
|
-
langName:
|
|
53
|
+
if (r.data && r.data.result === 0) {
|
|
54
|
+
const d = T.get(r.data, "retVal", []), c = d.map((i) => ({
|
|
55
|
+
langCode: i.language || i.langCode || i,
|
|
56
|
+
langName: i.langName || i.language || i
|
|
57
57
|
}));
|
|
58
|
-
return k.set("I18N_LANGUAGES",
|
|
58
|
+
return k.set("I18N_LANGUAGES", d), c;
|
|
59
59
|
}
|
|
60
|
-
} catch (
|
|
61
|
-
console.error("获取语言列表失败:",
|
|
60
|
+
} catch (r) {
|
|
61
|
+
console.error("获取语言列表失败:", r);
|
|
62
62
|
}
|
|
63
63
|
return [];
|
|
64
|
-
},
|
|
64
|
+
}, zn = async ({ baseUrl: t, token: e, appCode: n }) => we.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
|
+
), gt = async ({
|
|
72
72
|
appCode: t,
|
|
73
73
|
language: e = "zh-CN",
|
|
74
74
|
lastPullDate: n,
|
|
@@ -76,8 +76,8 @@ const _n = [
|
|
|
76
76
|
token: s
|
|
77
77
|
}) => {
|
|
78
78
|
try {
|
|
79
|
-
const
|
|
80
|
-
url:
|
|
79
|
+
const r = o + "/i18n-web/kv_translate/kv_translates", d = n ? r + "?lastPullDate=" + n : r, c = await we({
|
|
80
|
+
url: d,
|
|
81
81
|
method: "GET",
|
|
82
82
|
headers: {
|
|
83
83
|
appCode: t,
|
|
@@ -86,143 +86,143 @@ const _n = [
|
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
return c.data && c.data.result == 0 ? c.data.retVal : c;
|
|
89
|
-
} catch (
|
|
90
|
-
return console.error("获取翻译数据失败:",
|
|
89
|
+
} catch (r) {
|
|
90
|
+
return console.error("获取翻译数据失败:", r), null;
|
|
91
91
|
}
|
|
92
|
-
},
|
|
92
|
+
}, jn = async ({ data: t, token: e, baseUrl: n }) => we({
|
|
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
|
+
}), Dn = async ({ data: t, token: e, baseUrl: n }) => we({
|
|
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
|
+
}), Un = async ({
|
|
107
107
|
baseUrl: t,
|
|
108
108
|
appCode: e,
|
|
109
109
|
language: n = "zh-CN",
|
|
110
110
|
token: o,
|
|
111
111
|
routerName: s,
|
|
112
|
-
cacheScope:
|
|
112
|
+
cacheScope: r = "guest"
|
|
113
113
|
}) => {
|
|
114
114
|
try {
|
|
115
|
-
const
|
|
115
|
+
const d = qe(r), c = `I18N_${T.toUpper(e)}_${d}`, i = k.namespace(c), l = {
|
|
116
116
|
baseUrl: t,
|
|
117
117
|
appCode: e,
|
|
118
118
|
language: n,
|
|
119
119
|
token: o
|
|
120
|
-
},
|
|
120
|
+
}, u = i.get(n), h = [
|
|
121
121
|
t || "",
|
|
122
122
|
e || "",
|
|
123
123
|
n || "",
|
|
124
|
-
|
|
124
|
+
d,
|
|
125
125
|
o || "",
|
|
126
|
-
|
|
126
|
+
T.get(u, "lastPullDate", "")
|
|
127
127
|
].join("|");
|
|
128
|
-
if (
|
|
129
|
-
return
|
|
130
|
-
const
|
|
131
|
-
if (!
|
|
132
|
-
const
|
|
133
|
-
return
|
|
128
|
+
if (ke.has(h))
|
|
129
|
+
return ke.get(h);
|
|
130
|
+
const w = (async () => {
|
|
131
|
+
if (!u || !u.lastPullDate) {
|
|
132
|
+
const B = await gt(l);
|
|
133
|
+
return B ? (i.set(n, B), T.get(B, "translatesDTOs", [])) : T.get(u, "translatesDTOs", []);
|
|
134
134
|
}
|
|
135
|
-
const { lastPullDate: x } =
|
|
135
|
+
const { lastPullDate: x } = u, A = await gt({
|
|
136
136
|
...l,
|
|
137
137
|
lastPullDate: x
|
|
138
138
|
});
|
|
139
|
-
if (!
|
|
140
|
-
return
|
|
141
|
-
const
|
|
142
|
-
if (!
|
|
143
|
-
const
|
|
144
|
-
lastPullDate:
|
|
145
|
-
translatesDTOs:
|
|
139
|
+
if (!A)
|
|
140
|
+
return T.get(u, "translatesDTOs", []);
|
|
141
|
+
const $ = T.get(u, "translatesDTOs", []);
|
|
142
|
+
if (!T.isEmpty(A.translatesDTOs)) {
|
|
143
|
+
const B = On($, A.translatesDTOs, s), E = {
|
|
144
|
+
lastPullDate: A.lastPullDate,
|
|
145
|
+
translatesDTOs: B
|
|
146
146
|
};
|
|
147
|
-
return
|
|
147
|
+
return i.set(n, E, ":"), B;
|
|
148
148
|
}
|
|
149
|
-
return
|
|
149
|
+
return $;
|
|
150
150
|
})();
|
|
151
|
-
return
|
|
152
|
-
|
|
153
|
-
}),
|
|
154
|
-
} catch (
|
|
155
|
-
console.error("处理翻译数据失败:",
|
|
156
|
-
const c =
|
|
157
|
-
return
|
|
158
|
-
}
|
|
159
|
-
},
|
|
151
|
+
return ke.set(h, w), w.finally(() => {
|
|
152
|
+
ke.delete(h);
|
|
153
|
+
}), w;
|
|
154
|
+
} catch (d) {
|
|
155
|
+
console.error("处理翻译数据失败:", d);
|
|
156
|
+
const c = qe(r), i = k.namespace(`I18N_${T.toUpper(e)}_${c}`);
|
|
157
|
+
return T.get(i.get(n), "translatesDTOs", []);
|
|
158
|
+
}
|
|
159
|
+
}, Hn = ({ appCode: t, cacheScope: e } = {}) => {
|
|
160
160
|
if (t) {
|
|
161
161
|
if (e) {
|
|
162
|
-
k.namespace(`I18N_${
|
|
162
|
+
k.namespace(`I18N_${T.toUpper(t)}_${qe(e)}`).clearAll();
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
|
-
k.namespace(`I18N_${
|
|
165
|
+
k.namespace(`I18N_${T.toUpper(t)}`).clearAll();
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
168
|
/*!
|
|
169
169
|
* sweetalert2 v11.26.18
|
|
170
170
|
* Released under the MIT License.
|
|
171
171
|
*/
|
|
172
|
-
function
|
|
172
|
+
function Pt(t, e, n) {
|
|
173
173
|
if (typeof t == "function" ? t === e : t.has(e)) return arguments.length < 3 ? e : n;
|
|
174
174
|
throw new TypeError("Private element is not present on this object");
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function Vn(t, e) {
|
|
177
177
|
if (e.has(t)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
return t.get(
|
|
179
|
+
function mt(t, e) {
|
|
180
|
+
return t.get(Pt(t, e));
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
182
|
+
function Rn(t, e, n) {
|
|
183
|
+
Vn(t, e), e.set(t, n);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
return t.set(
|
|
185
|
+
function Fn(t, e, n) {
|
|
186
|
+
return t.set(Pt(t, e), n), n;
|
|
187
187
|
}
|
|
188
|
-
const
|
|
188
|
+
const qn = 100, p = {}, Kn = () => {
|
|
189
189
|
p.previousActiveElement instanceof HTMLElement ? (p.previousActiveElement.focus(), p.previousActiveElement = null) : document.body && document.body.focus();
|
|
190
|
-
},
|
|
190
|
+
}, Gn = (t) => new Promise((e) => {
|
|
191
191
|
if (!t)
|
|
192
192
|
return e();
|
|
193
193
|
const n = window.scrollX, o = window.scrollY;
|
|
194
194
|
p.restoreFocusTimeout = setTimeout(() => {
|
|
195
|
-
|
|
196
|
-
},
|
|
197
|
-
}),
|
|
198
|
-
(t, e) => (t[e] =
|
|
195
|
+
Kn(), e();
|
|
196
|
+
}, qn), window.scrollTo(n, o);
|
|
197
|
+
}), Mt = "swal2-", Wn = ["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"], a = Wn.reduce(
|
|
198
|
+
(t, e) => (t[e] = Mt + e, t),
|
|
199
199
|
/** @type {SwalClasses} */
|
|
200
200
|
{}
|
|
201
|
-
),
|
|
202
|
-
(t, e) => (t[e] =
|
|
201
|
+
), Yn = ["success", "warning", "info", "question", "error"], Ee = Yn.reduce(
|
|
202
|
+
(t, e) => (t[e] = Mt + e, t),
|
|
203
203
|
/** @type {SwalIcons} */
|
|
204
204
|
{}
|
|
205
|
-
),
|
|
206
|
-
console.warn(`${
|
|
205
|
+
), Nt = "SweetAlert2:", Je = (t) => t.charAt(0).toUpperCase() + t.slice(1), z = (t) => {
|
|
206
|
+
console.warn(`${Nt} ${typeof t == "object" ? t.join(" ") : t}`);
|
|
207
207
|
}, te = (t) => {
|
|
208
|
-
console.error(`${
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
},
|
|
214
|
-
const e =
|
|
208
|
+
console.error(`${Nt} ${t}`);
|
|
209
|
+
}, bt = [], Zn = (t) => {
|
|
210
|
+
bt.includes(t) || (bt.push(t), z(t));
|
|
211
|
+
}, Ot = (t, e = null) => {
|
|
212
|
+
Zn(`"${t}" is deprecated and will be removed in the next major release.${e ? ` Use "${e}" instead.` : ""}`);
|
|
213
|
+
}, Me = (t) => typeof t == "function" ? t() : t, Qe = (t) => t && typeof t.toPromise == "function", fe = (t) => Qe(t) ? t.toPromise() : Promise.resolve(t), et = (t) => t && Promise.resolve(t) === t, j = () => document.body.querySelector(`.${a.container}`), pe = (t) => {
|
|
214
|
+
const e = j();
|
|
215
215
|
return e ? e.querySelector(t) : null;
|
|
216
|
-
},
|
|
216
|
+
}, H = (t) => pe(`.${t}`), S = () => H(a.popup), ae = () => H(a.icon), Xn = () => H(a["icon-content"]), zt = () => H(a.title), tt = () => H(a["html-container"]), jt = () => H(a.image), nt = () => H(a["progress-steps"]), Ne = () => H(a["validation-message"]), K = () => (
|
|
217
217
|
/** @type {HTMLButtonElement} */
|
|
218
|
-
|
|
218
|
+
pe(`.${a.actions} .${a.confirm}`)
|
|
219
219
|
), le = () => (
|
|
220
220
|
/** @type {HTMLButtonElement} */
|
|
221
|
-
|
|
221
|
+
pe(`.${a.actions} .${a.cancel}`)
|
|
222
222
|
), ne = () => (
|
|
223
223
|
/** @type {HTMLButtonElement} */
|
|
224
|
-
|
|
225
|
-
),
|
|
224
|
+
pe(`.${a.actions} .${a.deny}`)
|
|
225
|
+
), Jn = () => H(a["input-label"]), ce = () => pe(`.${a.loader}`), ge = () => H(a.actions), Dt = () => H(a.footer), Oe = () => H(a["timer-progress-bar"]), ot = () => H(a.close), Qn = `
|
|
226
226
|
a[href],
|
|
227
227
|
area[href],
|
|
228
228
|
input:not([disabled]),
|
|
@@ -237,30 +237,30 @@ const jn = 100, p = {}, Vn = () => {
|
|
|
237
237
|
audio[controls],
|
|
238
238
|
video[controls],
|
|
239
239
|
summary
|
|
240
|
-
`,
|
|
241
|
-
const t =
|
|
240
|
+
`, st = () => {
|
|
241
|
+
const t = S();
|
|
242
242
|
if (!t)
|
|
243
243
|
return [];
|
|
244
|
-
const e = t.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'), n = Array.from(e).sort((
|
|
245
|
-
const c = parseInt(
|
|
246
|
-
return c >
|
|
247
|
-
}), o = t.querySelectorAll(
|
|
248
|
-
return [...new Set(n.concat(s))].filter((
|
|
249
|
-
},
|
|
250
|
-
const t =
|
|
244
|
+
const e = t.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'), n = Array.from(e).sort((r, d) => {
|
|
245
|
+
const c = parseInt(r.getAttribute("tabindex") || "0"), i = parseInt(d.getAttribute("tabindex") || "0");
|
|
246
|
+
return c > i ? 1 : c < i ? -1 : 0;
|
|
247
|
+
}), o = t.querySelectorAll(Qn), s = Array.from(o).filter((r) => r.getAttribute("tabindex") !== "-1");
|
|
248
|
+
return [...new Set(n.concat(s))].filter((r) => D(r));
|
|
249
|
+
}, rt = () => G(document.body, a.shown) && !G(document.body, a["toast-shown"]) && !G(document.body, a["no-backdrop"]), ze = () => {
|
|
250
|
+
const t = S();
|
|
251
251
|
return t ? G(t, a.toast) : !1;
|
|
252
|
-
},
|
|
253
|
-
const t =
|
|
252
|
+
}, eo = () => {
|
|
253
|
+
const t = S();
|
|
254
254
|
return t ? t.hasAttribute("data-loading") : !1;
|
|
255
|
-
},
|
|
255
|
+
}, V = (t, e) => {
|
|
256
256
|
if (t.textContent = "", e) {
|
|
257
257
|
const o = new DOMParser().parseFromString(e, "text/html"), s = o.querySelector("head");
|
|
258
|
-
s && Array.from(s.childNodes).forEach((
|
|
259
|
-
t.appendChild(
|
|
258
|
+
s && Array.from(s.childNodes).forEach((d) => {
|
|
259
|
+
t.appendChild(d);
|
|
260
260
|
});
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
const r = o.querySelector("body");
|
|
262
|
+
r && Array.from(r.childNodes).forEach((d) => {
|
|
263
|
+
d instanceof HTMLVideoElement || d instanceof HTMLAudioElement ? t.appendChild(d.cloneNode(!0)) : t.appendChild(d);
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
}, G = (t, e) => {
|
|
@@ -271,12 +271,12 @@ const jn = 100, p = {}, Vn = () => {
|
|
|
271
271
|
if (!t.classList.contains(n[o]))
|
|
272
272
|
return !1;
|
|
273
273
|
return !0;
|
|
274
|
-
},
|
|
274
|
+
}, to = (t, e) => {
|
|
275
275
|
Array.from(t.classList).forEach((n) => {
|
|
276
|
-
!Object.values(a).includes(n) && !Object.values(
|
|
276
|
+
!Object.values(a).includes(n) && !Object.values(Ee).includes(n) && !Object.values(e.showClass || {}).includes(n) && t.classList.remove(n);
|
|
277
277
|
});
|
|
278
|
-
},
|
|
279
|
-
if (
|
|
278
|
+
}, U = (t, e, n) => {
|
|
279
|
+
if (to(t, e), !e.customClass)
|
|
280
280
|
return;
|
|
281
281
|
const o = e.customClass[
|
|
282
282
|
/** @type {keyof SweetAlertCustomClass} */
|
|
@@ -287,9 +287,9 @@ const jn = 100, p = {}, Vn = () => {
|
|
|
287
287
|
z(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof o}"`);
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
|
-
|
|
290
|
+
L(t, o);
|
|
291
291
|
}
|
|
292
|
-
},
|
|
292
|
+
}, je = (t, e) => {
|
|
293
293
|
if (!e)
|
|
294
294
|
return null;
|
|
295
295
|
switch (e) {
|
|
@@ -306,21 +306,21 @@ const jn = 100, p = {}, Vn = () => {
|
|
|
306
306
|
default:
|
|
307
307
|
return t.querySelector(`.${a.popup} > .${a.input}`);
|
|
308
308
|
}
|
|
309
|
-
},
|
|
309
|
+
}, Ut = (t) => {
|
|
310
310
|
if (t.focus(), t.type !== "file") {
|
|
311
311
|
const e = t.value;
|
|
312
312
|
t.value = "", t.value = e;
|
|
313
313
|
}
|
|
314
|
-
},
|
|
314
|
+
}, Ht = (t, e, n) => {
|
|
315
315
|
!t || !e || (typeof e == "string" && (e = e.split(/\s+/).filter(Boolean)), e.forEach((o) => {
|
|
316
316
|
Array.isArray(t) ? t.forEach((s) => {
|
|
317
317
|
n ? s.classList.add(o) : s.classList.remove(o);
|
|
318
318
|
}) : n ? t.classList.add(o) : t.classList.remove(o);
|
|
319
319
|
}));
|
|
320
|
-
},
|
|
321
|
-
|
|
320
|
+
}, L = (t, e) => {
|
|
321
|
+
Ht(t, e, !0);
|
|
322
322
|
}, F = (t, e) => {
|
|
323
|
-
|
|
323
|
+
Ht(t, e, !1);
|
|
324
324
|
}, W = (t, e) => {
|
|
325
325
|
const n = Array.from(t.children);
|
|
326
326
|
for (let o = 0; o < n.length; o++) {
|
|
@@ -337,46 +337,46 @@ const jn = 100, p = {}, Vn = () => {
|
|
|
337
337
|
t && (t.style.display = e);
|
|
338
338
|
}, O = (t) => {
|
|
339
339
|
t && (t.style.display = "none");
|
|
340
|
-
},
|
|
340
|
+
}, it = (t, e = "block") => {
|
|
341
341
|
t && new MutationObserver(() => {
|
|
342
|
-
|
|
342
|
+
me(t, t.innerHTML, e);
|
|
343
343
|
}).observe(t, {
|
|
344
344
|
childList: !0,
|
|
345
345
|
subtree: !0
|
|
346
346
|
});
|
|
347
|
-
},
|
|
347
|
+
}, yt = (t, e, n, o) => {
|
|
348
348
|
const s = t.querySelector(e);
|
|
349
349
|
s && s.style.setProperty(n, o);
|
|
350
|
-
},
|
|
350
|
+
}, me = (t, e, n = "flex") => {
|
|
351
351
|
e ? M(t, n) : O(t);
|
|
352
|
-
},
|
|
352
|
+
}, D = (t) => !!(t && (t.offsetWidth || t.offsetHeight || t.getClientRects().length)), no = () => !D(K()) && !D(ne()) && !D(le()), Ke = (t) => t.scrollHeight > t.clientHeight, oo = (t, e) => {
|
|
353
353
|
let n = (
|
|
354
354
|
/** @type {HTMLElement | null} */
|
|
355
355
|
t
|
|
356
356
|
);
|
|
357
357
|
for (; n && n !== e; ) {
|
|
358
|
-
if (
|
|
358
|
+
if (Ke(n))
|
|
359
359
|
return !0;
|
|
360
360
|
n = n.parentElement;
|
|
361
361
|
}
|
|
362
362
|
return !1;
|
|
363
|
-
},
|
|
363
|
+
}, Vt = (t) => {
|
|
364
364
|
const e = window.getComputedStyle(t), n = parseFloat(e.getPropertyValue("animation-duration") || "0"), o = parseFloat(e.getPropertyValue("transition-duration") || "0");
|
|
365
365
|
return n > 0 || o > 0;
|
|
366
|
-
},
|
|
367
|
-
const n =
|
|
368
|
-
n &&
|
|
366
|
+
}, at = (t, e = !1) => {
|
|
367
|
+
const n = Oe();
|
|
368
|
+
n && D(n) && (e && (n.style.transition = "none", n.style.width = "100%"), setTimeout(() => {
|
|
369
369
|
n.style.transition = `width ${t / 1e3}s linear`, n.style.width = "0%";
|
|
370
370
|
}, 10));
|
|
371
|
-
},
|
|
372
|
-
const t =
|
|
371
|
+
}, so = () => {
|
|
372
|
+
const t = Oe();
|
|
373
373
|
if (!t)
|
|
374
374
|
return;
|
|
375
375
|
const e = parseInt(window.getComputedStyle(t).width);
|
|
376
376
|
t.style.removeProperty("transition"), t.style.width = "100%";
|
|
377
377
|
const n = parseInt(window.getComputedStyle(t).width), o = e / n * 100;
|
|
378
378
|
t.style.width = `${o}%`;
|
|
379
|
-
},
|
|
379
|
+
}, ro = () => typeof window > "u" || typeof document > "u", io = `
|
|
380
380
|
<div aria-labelledby="${a.title}" aria-describedby="${a["html-container"]}" class="${a.popup}" tabindex="-1">
|
|
381
381
|
<button type="button" class="${a.close}"></button>
|
|
382
382
|
<ul class="${a["progress-steps"]}"></ul>
|
|
@@ -409,8 +409,8 @@ const jn = 100, p = {}, Vn = () => {
|
|
|
409
409
|
<div class="${a["timer-progress-bar"]}"></div>
|
|
410
410
|
</div>
|
|
411
411
|
</div>
|
|
412
|
-
`.replace(/(^|\n)\s*/g, ""),
|
|
413
|
-
const t =
|
|
412
|
+
`.replace(/(^|\n)\s*/g, ""), ao = () => {
|
|
413
|
+
const t = j();
|
|
414
414
|
return t ? (t.remove(), F([document.documentElement, document.body], [
|
|
415
415
|
a["no-backdrop"],
|
|
416
416
|
a["toast-shown"],
|
|
@@ -419,17 +419,17 @@ const jn = 100, p = {}, Vn = () => {
|
|
|
419
419
|
]), !0) : !1;
|
|
420
420
|
}, X = () => {
|
|
421
421
|
p.currentInstance && p.currentInstance.resetValidationMessage();
|
|
422
|
-
},
|
|
423
|
-
const t =
|
|
422
|
+
}, lo = () => {
|
|
423
|
+
const t = S();
|
|
424
424
|
if (!t)
|
|
425
425
|
return;
|
|
426
|
-
const e = W(t, a.input), n = W(t, a.file), o = t.querySelector(`.${a.range} input`), s = t.querySelector(`.${a.range} output`),
|
|
427
|
-
e && (e.oninput = X), n && (n.onchange = X),
|
|
426
|
+
const e = W(t, a.input), n = W(t, a.file), o = t.querySelector(`.${a.range} input`), s = t.querySelector(`.${a.range} output`), r = W(t, a.select), d = t.querySelector(`.${a.checkbox} input`), c = W(t, a.textarea);
|
|
427
|
+
e && (e.oninput = X), n && (n.onchange = X), r && (r.onchange = X), d && (d.onchange = X), c && (c.oninput = X), o && s && (o.oninput = () => {
|
|
428
428
|
X(), s.value = o.value;
|
|
429
429
|
}, o.onchange = () => {
|
|
430
430
|
X(), s.value = o.value;
|
|
431
431
|
});
|
|
432
|
-
},
|
|
432
|
+
}, co = (t) => {
|
|
433
433
|
if (typeof t == "string") {
|
|
434
434
|
const e = document.querySelector(t);
|
|
435
435
|
if (!e)
|
|
@@ -440,139 +440,139 @@ const jn = 100, p = {}, Vn = () => {
|
|
|
440
440
|
);
|
|
441
441
|
}
|
|
442
442
|
return t;
|
|
443
|
-
},
|
|
444
|
-
const e =
|
|
443
|
+
}, uo = (t) => {
|
|
444
|
+
const e = S();
|
|
445
445
|
e && (e.setAttribute("role", t.toast ? "alert" : "dialog"), e.setAttribute("aria-live", t.toast ? "polite" : "assertive"), t.toast || e.setAttribute("aria-modal", "true"));
|
|
446
|
-
},
|
|
447
|
-
window.getComputedStyle(t).direction === "rtl" && (
|
|
448
|
-
},
|
|
449
|
-
const e =
|
|
450
|
-
if (
|
|
446
|
+
}, ho = (t) => {
|
|
447
|
+
window.getComputedStyle(t).direction === "rtl" && (L(j(), a.rtl), p.isRTL = !0);
|
|
448
|
+
}, wo = (t) => {
|
|
449
|
+
const e = ao();
|
|
450
|
+
if (ro()) {
|
|
451
451
|
te("SweetAlert2 requires document to initialize");
|
|
452
452
|
return;
|
|
453
453
|
}
|
|
454
454
|
const n = document.createElement("div");
|
|
455
|
-
n.className = a.container, e &&
|
|
456
|
-
const o =
|
|
457
|
-
o.appendChild(n), t.topLayer && (n.setAttribute("popover", ""), n.showPopover()),
|
|
458
|
-
},
|
|
459
|
-
t instanceof HTMLElement ? e.appendChild(t) : typeof t == "object" ?
|
|
460
|
-
},
|
|
461
|
-
"jquery" in t ?
|
|
462
|
-
},
|
|
455
|
+
n.className = a.container, e && L(n, a["no-transition"]), V(n, io), n.dataset.swal2Theme = t.theme;
|
|
456
|
+
const o = co(t.target || "body");
|
|
457
|
+
o.appendChild(n), t.topLayer && (n.setAttribute("popover", ""), n.showPopover()), uo(t), ho(o), lo();
|
|
458
|
+
}, lt = (t, e) => {
|
|
459
|
+
t instanceof HTMLElement ? e.appendChild(t) : typeof t == "object" ? fo(t, e) : t && V(e, t);
|
|
460
|
+
}, fo = (t, e) => {
|
|
461
|
+
"jquery" in t ? po(e, t) : V(e, t.toString());
|
|
462
|
+
}, po = (t, e) => {
|
|
463
463
|
if (t.textContent = "", 0 in e)
|
|
464
464
|
for (let n = 0; n in e; n++)
|
|
465
465
|
t.appendChild(e[n].cloneNode(!0));
|
|
466
466
|
else
|
|
467
467
|
t.appendChild(e.cloneNode(!0));
|
|
468
|
-
},
|
|
469
|
-
const n =
|
|
470
|
-
!n || !o || (!e.showConfirmButton && !e.showDenyButton && !e.showCancelButton ? O(n) : M(n),
|
|
468
|
+
}, go = (t, e) => {
|
|
469
|
+
const n = ge(), o = ce();
|
|
470
|
+
!n || !o || (!e.showConfirmButton && !e.showDenyButton && !e.showCancelButton ? O(n) : M(n), U(n, e, "actions"), mo(n, o, e), V(o, e.loaderHtml || ""), U(o, e, "loader"));
|
|
471
471
|
};
|
|
472
|
-
function
|
|
473
|
-
const o = K(), s = ne(),
|
|
474
|
-
!o || !s || !
|
|
472
|
+
function mo(t, e, n) {
|
|
473
|
+
const o = K(), s = ne(), r = le();
|
|
474
|
+
!o || !s || !r || (He(o, "confirm", n), He(s, "deny", n), He(r, "cancel", n), bo(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))));
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function bo(t, e, n, o) {
|
|
477
477
|
if (!o.buttonsStyling) {
|
|
478
478
|
F([t, e, n], a.styled);
|
|
479
479
|
return;
|
|
480
480
|
}
|
|
481
|
-
|
|
481
|
+
L([t, e, n], a.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), Ue(t), Ue(e), Ue(n);
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function Ue(t) {
|
|
484
484
|
const e = window.getComputedStyle(t);
|
|
485
485
|
if (e.getPropertyValue("--swal2-action-button-focus-box-shadow"))
|
|
486
486
|
return;
|
|
487
487
|
const n = e.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/, "rgba($1, $2, $3, 0.5)");
|
|
488
488
|
t.style.setProperty("--swal2-action-button-focus-box-shadow", e.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/, ` ${n}`));
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function He(t, e, n) {
|
|
491
491
|
const o = (
|
|
492
492
|
/** @type {'Confirm' | 'Deny' | 'Cancel'} */
|
|
493
|
-
|
|
493
|
+
Je(e)
|
|
494
494
|
);
|
|
495
|
-
|
|
495
|
+
me(t, n[`show${o}Button`], "inline-block"), V(t, n[`${e}ButtonText`] || ""), t.setAttribute("aria-label", n[`${e}ButtonAriaLabel`] || ""), t.className = a[e], U(t, n, `${e}Button`);
|
|
496
496
|
}
|
|
497
|
-
const
|
|
498
|
-
const n =
|
|
499
|
-
n && (
|
|
500
|
-
},
|
|
501
|
-
const n =
|
|
502
|
-
n && (
|
|
497
|
+
const yo = (t, e) => {
|
|
498
|
+
const n = ot();
|
|
499
|
+
n && (V(n, e.closeButtonHtml || ""), U(n, e, "closeButton"), me(n, e.showCloseButton), n.setAttribute("aria-label", e.closeButtonAriaLabel || ""));
|
|
500
|
+
}, vo = (t, e) => {
|
|
501
|
+
const n = j();
|
|
502
|
+
n && (Co(n, e.backdrop), ko(n, e.position), xo(n, e.grow), U(n, e, "container"));
|
|
503
503
|
};
|
|
504
|
-
function
|
|
505
|
-
typeof e == "string" ? t.style.background = e : e ||
|
|
504
|
+
function Co(t, e) {
|
|
505
|
+
typeof e == "string" ? t.style.background = e : e || L([document.documentElement, document.body], a["no-backdrop"]);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
e && (e in a ?
|
|
507
|
+
function ko(t, e) {
|
|
508
|
+
e && (e in a ? L(t, a[e]) : (z('The "position" parameter is not valid, defaulting to "center"'), L(t, a.center)));
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
e &&
|
|
510
|
+
function xo(t, e) {
|
|
511
|
+
e && L(t, a[`grow-${e}`]);
|
|
512
512
|
}
|
|
513
|
-
var
|
|
513
|
+
var _ = {
|
|
514
514
|
innerParams: /* @__PURE__ */ new WeakMap(),
|
|
515
515
|
domCache: /* @__PURE__ */ new WeakMap()
|
|
516
516
|
};
|
|
517
|
-
const
|
|
518
|
-
const n =
|
|
517
|
+
const Ao = ["input", "file", "range", "select", "radio", "checkbox", "textarea"], Eo = (t, e) => {
|
|
518
|
+
const n = S();
|
|
519
519
|
if (!n)
|
|
520
520
|
return;
|
|
521
|
-
const o =
|
|
522
|
-
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
}), e.input && (s &&
|
|
526
|
-
},
|
|
521
|
+
const o = _.innerParams.get(t), s = !o || e.input !== o.input;
|
|
522
|
+
Ao.forEach((r) => {
|
|
523
|
+
const d = W(n, a[r]);
|
|
524
|
+
d && (To(r, e.inputAttributes), d.className = a[r], s && O(d));
|
|
525
|
+
}), e.input && (s && Lo(e), _o(e));
|
|
526
|
+
}, Lo = (t) => {
|
|
527
527
|
if (!t.input)
|
|
528
528
|
return;
|
|
529
529
|
if (!I[t.input]) {
|
|
530
530
|
te(`Unexpected type of input! Expected ${Object.keys(I).join(" | ")}, got "${t.input}"`);
|
|
531
531
|
return;
|
|
532
532
|
}
|
|
533
|
-
const e =
|
|
533
|
+
const e = Rt(t.input);
|
|
534
534
|
if (!e)
|
|
535
535
|
return;
|
|
536
536
|
const n = I[t.input](e, t);
|
|
537
537
|
M(e), t.inputAutoFocus && setTimeout(() => {
|
|
538
|
-
|
|
538
|
+
Ut(n);
|
|
539
539
|
});
|
|
540
|
-
},
|
|
540
|
+
}, So = (t) => {
|
|
541
541
|
for (let e = 0; e < t.attributes.length; e++) {
|
|
542
542
|
const n = t.attributes[e].name;
|
|
543
543
|
["id", "type", "value", "style"].includes(n) || t.removeAttribute(n);
|
|
544
544
|
}
|
|
545
|
-
},
|
|
546
|
-
const n =
|
|
545
|
+
}, To = (t, e) => {
|
|
546
|
+
const n = S();
|
|
547
547
|
if (!n)
|
|
548
548
|
return;
|
|
549
|
-
const o =
|
|
549
|
+
const o = je(n, t);
|
|
550
550
|
if (o) {
|
|
551
|
-
|
|
551
|
+
So(o);
|
|
552
552
|
for (const s in e)
|
|
553
553
|
o.setAttribute(s, e[s]);
|
|
554
554
|
}
|
|
555
|
-
},
|
|
555
|
+
}, _o = (t) => {
|
|
556
556
|
if (!t.input)
|
|
557
557
|
return;
|
|
558
|
-
const e =
|
|
559
|
-
e &&
|
|
560
|
-
},
|
|
558
|
+
const e = Rt(t.input);
|
|
559
|
+
e && U(e, t, "input");
|
|
560
|
+
}, ct = (t, e) => {
|
|
561
561
|
!t.placeholder && e.inputPlaceholder && (t.placeholder = e.inputPlaceholder);
|
|
562
|
-
},
|
|
562
|
+
}, be = (t, e, n) => {
|
|
563
563
|
if (n.inputLabel) {
|
|
564
564
|
const o = document.createElement("label"), s = a["input-label"];
|
|
565
|
-
o.setAttribute("for", t.id), o.className = s, typeof n.customClass == "object" &&
|
|
565
|
+
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);
|
|
566
566
|
}
|
|
567
|
-
},
|
|
568
|
-
const e =
|
|
567
|
+
}, Rt = (t) => {
|
|
568
|
+
const e = S();
|
|
569
569
|
if (e)
|
|
570
570
|
return W(e, a[
|
|
571
571
|
/** @type {SwalClass} */
|
|
572
572
|
t
|
|
573
573
|
] || a.input);
|
|
574
|
-
},
|
|
575
|
-
["string", "number"].includes(typeof e) ? t.value = `${e}` :
|
|
574
|
+
}, Le = (t, e) => {
|
|
575
|
+
["string", "number"].includes(typeof e) ? t.value = `${e}` : et(e) || z(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof e}"`);
|
|
576
576
|
}, I = {};
|
|
577
577
|
I.text = I.email = I.password = I.number = I.tel = I.url = I.search = I.date = I["datetime-local"] = I.time = I.week = I.month = /** @type {(input: Input | HTMLElement, params: SweetAlertOptions) => Input} */
|
|
578
578
|
(t, e) => {
|
|
@@ -580,7 +580,7 @@ I.text = I.email = I.password = I.number = I.tel = I.url = I.search = I.date = I
|
|
|
580
580
|
/** @type {HTMLInputElement} */
|
|
581
581
|
t
|
|
582
582
|
);
|
|
583
|
-
return
|
|
583
|
+
return Le(n, e.inputValue), be(n, n, e), ct(n, e), n.type = /** @type {string} */
|
|
584
584
|
e.input, n;
|
|
585
585
|
};
|
|
586
586
|
I.file = (t, e) => {
|
|
@@ -588,20 +588,20 @@ I.file = (t, e) => {
|
|
|
588
588
|
/** @type {HTMLInputElement} */
|
|
589
589
|
t
|
|
590
590
|
);
|
|
591
|
-
return
|
|
591
|
+
return be(n, n, e), ct(n, e), n;
|
|
592
592
|
};
|
|
593
593
|
I.range = (t, e) => {
|
|
594
594
|
const n = (
|
|
595
595
|
/** @type {HTMLElement} */
|
|
596
596
|
t
|
|
597
597
|
), o = n.querySelector("input"), s = n.querySelector("output");
|
|
598
|
-
return o && (
|
|
599
|
-
e.input,
|
|
598
|
+
return o && (Le(o, e.inputValue), o.type = /** @type {string} */
|
|
599
|
+
e.input, be(
|
|
600
600
|
o,
|
|
601
601
|
/** @type {Input} */
|
|
602
602
|
t,
|
|
603
603
|
e
|
|
604
|
-
)), s &&
|
|
604
|
+
)), s && Le(s, e.inputValue), /** @type {Input} */
|
|
605
605
|
t;
|
|
606
606
|
};
|
|
607
607
|
I.select = (t, e) => {
|
|
@@ -611,9 +611,9 @@ I.select = (t, e) => {
|
|
|
611
611
|
);
|
|
612
612
|
if (n.textContent = "", e.inputPlaceholder) {
|
|
613
613
|
const o = document.createElement("option");
|
|
614
|
-
|
|
614
|
+
V(o, e.inputPlaceholder), o.value = "", o.disabled = !0, o.selected = !0, n.appendChild(o);
|
|
615
615
|
}
|
|
616
|
-
return
|
|
616
|
+
return be(n, n, e), n;
|
|
617
617
|
};
|
|
618
618
|
I.radio = (t) => {
|
|
619
619
|
const e = (
|
|
@@ -624,17 +624,17 @@ I.radio = (t) => {
|
|
|
624
624
|
t;
|
|
625
625
|
};
|
|
626
626
|
I.checkbox = (t, e) => {
|
|
627
|
-
const n =
|
|
627
|
+
const n = S();
|
|
628
628
|
if (!n)
|
|
629
629
|
throw new Error("Popup not found");
|
|
630
|
-
const o =
|
|
630
|
+
const o = je(n, "checkbox");
|
|
631
631
|
if (!o)
|
|
632
632
|
throw new Error("Checkbox input not found");
|
|
633
633
|
o.value = "1", o.checked = !!e.inputValue;
|
|
634
|
-
const
|
|
635
|
-
if (
|
|
636
|
-
const
|
|
637
|
-
|
|
634
|
+
const r = /** @type {HTMLElement} */ t.querySelector("span");
|
|
635
|
+
if (r) {
|
|
636
|
+
const d = e.inputPlaceholder || e.inputLabel;
|
|
637
|
+
d && V(r, d);
|
|
638
638
|
}
|
|
639
639
|
return o;
|
|
640
640
|
};
|
|
@@ -643,104 +643,104 @@ I.textarea = (t, e) => {
|
|
|
643
643
|
/** @type {HTMLTextAreaElement} */
|
|
644
644
|
t
|
|
645
645
|
);
|
|
646
|
-
|
|
646
|
+
Le(n, e.inputValue), ct(n, e), be(n, n, e);
|
|
647
647
|
const o = (s) => parseInt(window.getComputedStyle(s).marginLeft) + parseInt(window.getComputedStyle(s).marginRight);
|
|
648
648
|
return setTimeout(() => {
|
|
649
649
|
if ("MutationObserver" in window) {
|
|
650
|
-
const s =
|
|
650
|
+
const s = S();
|
|
651
651
|
if (!s)
|
|
652
652
|
return;
|
|
653
|
-
const
|
|
653
|
+
const r = parseInt(window.getComputedStyle(s).width), d = () => {
|
|
654
654
|
if (!document.body.contains(n))
|
|
655
655
|
return;
|
|
656
|
-
const c = n.offsetWidth + o(n),
|
|
657
|
-
|
|
656
|
+
const c = n.offsetWidth + o(n), i = S();
|
|
657
|
+
i && (c > r ? i.style.width = `${c}px` : Q(i, "width", e.width));
|
|
658
658
|
};
|
|
659
|
-
new MutationObserver(
|
|
659
|
+
new MutationObserver(d).observe(n, {
|
|
660
660
|
attributes: !0,
|
|
661
661
|
attributeFilter: ["style"]
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
664
|
}), n;
|
|
665
665
|
};
|
|
666
|
-
const
|
|
667
|
-
const n =
|
|
668
|
-
n && (
|
|
669
|
-
},
|
|
670
|
-
const n =
|
|
671
|
-
n && (
|
|
672
|
-
},
|
|
673
|
-
const n =
|
|
666
|
+
const $o = (t, e) => {
|
|
667
|
+
const n = tt();
|
|
668
|
+
n && (it(n), U(n, e, "htmlContainer"), e.html ? (lt(e.html, n), M(n, "block")) : e.text ? (n.textContent = e.text, M(n, "block")) : O(n), Eo(t, e));
|
|
669
|
+
}, Bo = (t, e) => {
|
|
670
|
+
const n = Dt();
|
|
671
|
+
n && (it(n), me(n, !!e.footer, "block"), e.footer && lt(e.footer, n), U(n, e, "footer"));
|
|
672
|
+
}, Io = (t, e) => {
|
|
673
|
+
const n = _.innerParams.get(t), o = ae();
|
|
674
674
|
if (!o)
|
|
675
675
|
return;
|
|
676
676
|
if (n && e.icon === n.icon) {
|
|
677
|
-
|
|
677
|
+
Ct(o, e), vt(o, e);
|
|
678
678
|
return;
|
|
679
679
|
}
|
|
680
680
|
if (!e.icon && !e.iconHtml) {
|
|
681
681
|
O(o);
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
|
-
if (e.icon && Object.keys(
|
|
684
|
+
if (e.icon && Object.keys(Ee).indexOf(e.icon) === -1) {
|
|
685
685
|
te(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${e.icon}"`), O(o);
|
|
686
686
|
return;
|
|
687
687
|
}
|
|
688
|
-
M(o),
|
|
689
|
-
},
|
|
690
|
-
for (const [n, o] of Object.entries(
|
|
688
|
+
M(o), Ct(o, e), vt(o, e), L(o, e.showClass && e.showClass.icon), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", Ft);
|
|
689
|
+
}, vt = (t, e) => {
|
|
690
|
+
for (const [n, o] of Object.entries(Ee))
|
|
691
691
|
e.icon !== n && F(t, o);
|
|
692
|
-
|
|
693
|
-
},
|
|
694
|
-
const t =
|
|
692
|
+
L(t, e.icon && Ee[e.icon]), No(t, e), Ft(), U(t, e, "icon");
|
|
693
|
+
}, Ft = () => {
|
|
694
|
+
const t = S();
|
|
695
695
|
if (!t)
|
|
696
696
|
return;
|
|
697
697
|
const e = window.getComputedStyle(t).getPropertyValue("background-color"), n = t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");
|
|
698
698
|
for (let o = 0; o < n.length; o++)
|
|
699
699
|
n[o].style.backgroundColor = e;
|
|
700
|
-
},
|
|
700
|
+
}, Po = (t) => `
|
|
701
701
|
${t.animation ? '<div class="swal2-success-circular-line-left"></div>' : ""}
|
|
702
702
|
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
703
703
|
<div class="swal2-success-ring"></div>
|
|
704
704
|
${t.animation ? '<div class="swal2-success-fix"></div>' : ""}
|
|
705
705
|
${t.animation ? '<div class="swal2-success-circular-line-right"></div>' : ""}
|
|
706
|
-
`,
|
|
706
|
+
`, Mo = `
|
|
707
707
|
<span class="swal2-x-mark">
|
|
708
708
|
<span class="swal2-x-mark-line-left"></span>
|
|
709
709
|
<span class="swal2-x-mark-line-right"></span>
|
|
710
710
|
</span>
|
|
711
|
-
`,
|
|
711
|
+
`, Ct = (t, e) => {
|
|
712
712
|
if (!e.icon && !e.iconHtml)
|
|
713
713
|
return;
|
|
714
714
|
let n = t.innerHTML, o = "";
|
|
715
|
-
e.iconHtml ? o =
|
|
715
|
+
e.iconHtml ? o = kt(e.iconHtml) : e.icon === "success" ? (o = Po(e), n = n.replace(/ style=".*?"/g, "")) : e.icon === "error" ? o = Mo : e.icon && (o = kt({
|
|
716
716
|
question: "?",
|
|
717
717
|
warning: "!",
|
|
718
718
|
info: "i"
|
|
719
|
-
}[e.icon])), n.trim() !== o.trim() &&
|
|
720
|
-
},
|
|
719
|
+
}[e.icon])), n.trim() !== o.trim() && V(t, o);
|
|
720
|
+
}, No = (t, e) => {
|
|
721
721
|
if (e.iconColor) {
|
|
722
722
|
t.style.color = e.iconColor, t.style.borderColor = e.iconColor;
|
|
723
723
|
for (const n of [".swal2-success-line-tip", ".swal2-success-line-long", ".swal2-x-mark-line-left", ".swal2-x-mark-line-right"])
|
|
724
|
-
|
|
725
|
-
|
|
724
|
+
yt(t, n, "background-color", e.iconColor);
|
|
725
|
+
yt(t, ".swal2-success-ring", "border-color", e.iconColor);
|
|
726
726
|
}
|
|
727
|
-
},
|
|
728
|
-
const n =
|
|
727
|
+
}, kt = (t) => `<div class="${a["icon-content"]}">${t}</div>`, Oo = (t, e) => {
|
|
728
|
+
const n = jt();
|
|
729
729
|
if (n) {
|
|
730
730
|
if (!e.imageUrl) {
|
|
731
731
|
O(n);
|
|
732
732
|
return;
|
|
733
733
|
}
|
|
734
|
-
M(n, ""), n.setAttribute("src", e.imageUrl), n.setAttribute("alt", e.imageAlt || ""), Q(n, "width", e.imageWidth), Q(n, "height", e.imageHeight), n.className = a.image,
|
|
734
|
+
M(n, ""), n.setAttribute("src", e.imageUrl), n.setAttribute("alt", e.imageAlt || ""), Q(n, "width", e.imageWidth), Q(n, "height", e.imageHeight), n.className = a.image, U(n, e, "image");
|
|
735
735
|
}
|
|
736
736
|
};
|
|
737
|
-
let
|
|
738
|
-
const
|
|
739
|
-
t.addEventListener("mousedown",
|
|
740
|
-
},
|
|
741
|
-
t.removeEventListener("mousedown",
|
|
742
|
-
},
|
|
743
|
-
const e =
|
|
737
|
+
let dt = !1, qt = 0, Kt = 0, Gt = 0, Wt = 0;
|
|
738
|
+
const zo = (t) => {
|
|
739
|
+
t.addEventListener("mousedown", Se), document.body.addEventListener("mousemove", Te), t.addEventListener("mouseup", _e), t.addEventListener("touchstart", Se), document.body.addEventListener("touchmove", Te), t.addEventListener("touchend", _e);
|
|
740
|
+
}, jo = (t) => {
|
|
741
|
+
t.removeEventListener("mousedown", Se), document.body.removeEventListener("mousemove", Te), t.removeEventListener("mouseup", _e), t.removeEventListener("touchstart", Se), document.body.removeEventListener("touchmove", Te), t.removeEventListener("touchend", _e);
|
|
742
|
+
}, Se = (t) => {
|
|
743
|
+
const e = S();
|
|
744
744
|
if (!e)
|
|
745
745
|
return;
|
|
746
746
|
const n = ae();
|
|
@@ -748,24 +748,24 @@ const Io = (t) => {
|
|
|
748
748
|
/** @type {HTMLElement} */
|
|
749
749
|
t.target
|
|
750
750
|
)) {
|
|
751
|
-
|
|
752
|
-
const o =
|
|
753
|
-
|
|
751
|
+
dt = !0;
|
|
752
|
+
const o = Yt(t);
|
|
753
|
+
qt = o.clientX, Kt = o.clientY, Gt = parseInt(e.style.insetInlineStart) || 0, Wt = parseInt(e.style.insetBlockStart) || 0, L(e, "swal2-dragging");
|
|
754
754
|
}
|
|
755
|
-
},
|
|
756
|
-
const e =
|
|
757
|
-
if (e &&
|
|
755
|
+
}, Te = (t) => {
|
|
756
|
+
const e = S();
|
|
757
|
+
if (e && dt) {
|
|
758
758
|
let {
|
|
759
759
|
clientX: n,
|
|
760
760
|
clientY: o
|
|
761
|
-
} =
|
|
762
|
-
const s = n -
|
|
763
|
-
e.style.insetInlineStart = `${
|
|
764
|
-
}
|
|
765
|
-
},
|
|
766
|
-
const t =
|
|
767
|
-
|
|
768
|
-
},
|
|
761
|
+
} = Yt(t);
|
|
762
|
+
const s = n - qt;
|
|
763
|
+
e.style.insetInlineStart = `${Gt + (p.isRTL ? -s : s)}px`, e.style.insetBlockStart = `${Wt + (o - Kt)}px`;
|
|
764
|
+
}
|
|
765
|
+
}, _e = () => {
|
|
766
|
+
const t = S();
|
|
767
|
+
dt = !1, F(t, "swal2-dragging");
|
|
768
|
+
}, Yt = (t) => {
|
|
769
769
|
let e = 0, n = 0;
|
|
770
770
|
return t.type.startsWith("mouse") ? (e = /** @type {MouseEvent} */
|
|
771
771
|
t.clientX, n = /** @type {MouseEvent} */
|
|
@@ -775,8 +775,8 @@ const Io = (t) => {
|
|
|
775
775
|
clientX: e,
|
|
776
776
|
clientY: n
|
|
777
777
|
};
|
|
778
|
-
},
|
|
779
|
-
const n =
|
|
778
|
+
}, Do = (t, e) => {
|
|
779
|
+
const n = j(), o = S();
|
|
780
780
|
if (!(!n || !o)) {
|
|
781
781
|
if (e.toast) {
|
|
782
782
|
Q(n, "width", e.width), o.style.width = "100%";
|
|
@@ -784,13 +784,13 @@ const Io = (t) => {
|
|
|
784
784
|
s && o.insertBefore(s, ae());
|
|
785
785
|
} else
|
|
786
786
|
Q(o, "width", e.width);
|
|
787
|
-
Q(o, "padding", e.padding), e.color && (o.style.color = e.color), e.background && (o.style.background = e.background), O(
|
|
787
|
+
Q(o, "padding", e.padding), e.color && (o.style.color = e.color), e.background && (o.style.background = e.background), O(Ne()), Uo(o, e), e.draggable && !e.toast ? (L(o, a.draggable), zo(o)) : (F(o, a.draggable), jo(o));
|
|
788
788
|
}
|
|
789
|
-
},
|
|
789
|
+
}, Uo = (t, e) => {
|
|
790
790
|
const n = e.showClass || {};
|
|
791
|
-
t.className = `${a.popup} ${
|
|
792
|
-
},
|
|
793
|
-
const n =
|
|
791
|
+
t.className = `${a.popup} ${D(t) ? n.popup : ""}`, e.toast ? (L([document.documentElement, document.body], a["toast-shown"]), L(t, a.toast)) : L(t, a.modal), U(t, e, "popup"), typeof e.customClass == "string" && L(t, e.customClass), e.icon && L(t, a[`icon-${e.icon}`]);
|
|
792
|
+
}, Ho = (t, e) => {
|
|
793
|
+
const n = nt();
|
|
794
794
|
if (!n)
|
|
795
795
|
return;
|
|
796
796
|
const {
|
|
@@ -801,43 +801,43 @@ const Io = (t) => {
|
|
|
801
801
|
O(n);
|
|
802
802
|
return;
|
|
803
803
|
}
|
|
804
|
-
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((
|
|
805
|
-
const c =
|
|
806
|
-
if (n.appendChild(c),
|
|
807
|
-
const
|
|
808
|
-
n.appendChild(
|
|
804
|
+
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, d) => {
|
|
805
|
+
const c = Vo(r);
|
|
806
|
+
if (n.appendChild(c), d === s && L(c, a["active-progress-step"]), d !== o.length - 1) {
|
|
807
|
+
const i = Ro(e);
|
|
808
|
+
n.appendChild(i);
|
|
809
809
|
}
|
|
810
810
|
});
|
|
811
|
-
},
|
|
811
|
+
}, Vo = (t) => {
|
|
812
812
|
const e = document.createElement("li");
|
|
813
|
-
return
|
|
814
|
-
},
|
|
813
|
+
return L(e, a["progress-step"]), V(e, t), e;
|
|
814
|
+
}, Ro = (t) => {
|
|
815
815
|
const e = document.createElement("li");
|
|
816
|
-
return
|
|
817
|
-
},
|
|
818
|
-
const n =
|
|
819
|
-
n && (
|
|
820
|
-
},
|
|
816
|
+
return L(e, a["progress-step-line"]), t.progressStepsDistance && Q(e, "width", t.progressStepsDistance), e;
|
|
817
|
+
}, Fo = (t, e) => {
|
|
818
|
+
const n = zt();
|
|
819
|
+
n && (it(n), me(n, !!(e.title || e.titleText), "block"), e.title && lt(e.title, n), e.titleText && (n.innerText = e.titleText), U(n, e, "title"));
|
|
820
|
+
}, Zt = (t, e) => {
|
|
821
821
|
var n;
|
|
822
|
-
|
|
823
|
-
const o =
|
|
822
|
+
Do(t, e), vo(t, e), Ho(t, e), Io(t, e), Oo(t, e), Fo(t, e), yo(t, e), $o(t, e), go(t, e), Bo(t, e);
|
|
823
|
+
const o = S();
|
|
824
824
|
typeof e.didRender == "function" && o && e.didRender(o), (n = p.eventEmitter) === null || n === void 0 || n.emit("didRender", o);
|
|
825
|
-
},
|
|
825
|
+
}, qo = () => D(S()), Xt = () => {
|
|
826
826
|
var t;
|
|
827
827
|
return (t = K()) === null || t === void 0 ? void 0 : t.click();
|
|
828
|
-
},
|
|
828
|
+
}, Ko = () => {
|
|
829
829
|
var t;
|
|
830
830
|
return (t = ne()) === null || t === void 0 ? void 0 : t.click();
|
|
831
|
-
},
|
|
831
|
+
}, Go = () => {
|
|
832
832
|
var t;
|
|
833
833
|
return (t = le()) === null || t === void 0 ? void 0 : t.click();
|
|
834
|
-
},
|
|
834
|
+
}, de = Object.freeze({
|
|
835
835
|
cancel: "cancel",
|
|
836
836
|
backdrop: "backdrop",
|
|
837
837
|
close: "close",
|
|
838
838
|
esc: "esc",
|
|
839
839
|
timer: "timer"
|
|
840
|
-
}),
|
|
840
|
+
}), Jt = (t) => {
|
|
841
841
|
if (t.keydownTarget && t.keydownHandlerAdded && t.keydownHandler) {
|
|
842
842
|
const e = (
|
|
843
843
|
/** @type {EventListenerOrEventListenerObject} */
|
|
@@ -848,157 +848,157 @@ const Io = (t) => {
|
|
|
848
848
|
capture: t.keydownListenerCapture
|
|
849
849
|
}), t.keydownHandlerAdded = !1;
|
|
850
850
|
}
|
|
851
|
-
},
|
|
852
|
-
if (
|
|
853
|
-
const o = (
|
|
851
|
+
}, Wo = (t, e, n) => {
|
|
852
|
+
if (Jt(t), !e.toast) {
|
|
853
|
+
const o = (r) => Zo(e, r, n);
|
|
854
854
|
t.keydownHandler = o;
|
|
855
|
-
const s = e.keydownListenerCapture ? window :
|
|
855
|
+
const s = e.keydownListenerCapture ? window : S();
|
|
856
856
|
if (s) {
|
|
857
857
|
t.keydownTarget = s, t.keydownListenerCapture = e.keydownListenerCapture;
|
|
858
|
-
const
|
|
858
|
+
const r = (
|
|
859
859
|
/** @type {EventListenerOrEventListenerObject} */
|
|
860
860
|
/** @type {unknown} */
|
|
861
861
|
o
|
|
862
862
|
);
|
|
863
|
-
t.keydownTarget.addEventListener("keydown",
|
|
863
|
+
t.keydownTarget.addEventListener("keydown", r, {
|
|
864
864
|
capture: t.keydownListenerCapture
|
|
865
865
|
}), t.keydownHandlerAdded = !0;
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
|
-
},
|
|
868
|
+
}, Ge = (t, e) => {
|
|
869
869
|
var n;
|
|
870
|
-
const o =
|
|
870
|
+
const o = st();
|
|
871
871
|
if (o.length) {
|
|
872
872
|
t = t + e, t === -2 && (t = o.length - 1), t === o.length ? t = 0 : t === -1 && (t = o.length - 1), o[t].focus();
|
|
873
873
|
return;
|
|
874
874
|
}
|
|
875
|
-
(n =
|
|
876
|
-
},
|
|
877
|
-
t && (e.isComposing || e.keyCode === 229 || (t.stopKeydownPropagation && e.stopPropagation(), e.key === "Enter" ?
|
|
878
|
-
},
|
|
879
|
-
if (!
|
|
875
|
+
(n = S()) === null || n === void 0 || n.focus();
|
|
876
|
+
}, Qt = ["ArrowRight", "ArrowDown"], Yo = ["ArrowLeft", "ArrowUp"], Zo = (t, e, n) => {
|
|
877
|
+
t && (e.isComposing || e.keyCode === 229 || (t.stopKeydownPropagation && e.stopPropagation(), e.key === "Enter" ? Xo(e, t) : e.key === "Tab" ? Jo(e) : [...Qt, ...Yo].includes(e.key) ? Qo(e.key) : e.key === "Escape" && es(e, t, n)));
|
|
878
|
+
}, Xo = (t, e) => {
|
|
879
|
+
if (!Me(e.allowEnterKey))
|
|
880
880
|
return;
|
|
881
|
-
const n =
|
|
881
|
+
const n = S();
|
|
882
882
|
if (!n || !e.input)
|
|
883
883
|
return;
|
|
884
|
-
const o =
|
|
884
|
+
const o = je(n, e.input);
|
|
885
885
|
if (t.target && o && t.target instanceof HTMLElement && t.target.outerHTML === o.outerHTML) {
|
|
886
886
|
if (["textarea", "file"].includes(e.input))
|
|
887
887
|
return;
|
|
888
|
-
|
|
888
|
+
Xt(), t.preventDefault();
|
|
889
889
|
}
|
|
890
|
-
},
|
|
891
|
-
const e = t.target, n =
|
|
890
|
+
}, Jo = (t) => {
|
|
891
|
+
const e = t.target, n = st();
|
|
892
892
|
let o = -1;
|
|
893
893
|
for (let s = 0; s < n.length; s++)
|
|
894
894
|
if (e === n[s]) {
|
|
895
895
|
o = s;
|
|
896
896
|
break;
|
|
897
897
|
}
|
|
898
|
-
t.shiftKey ?
|
|
899
|
-
},
|
|
900
|
-
const e =
|
|
898
|
+
t.shiftKey ? Ge(o, -1) : Ge(o, 1), t.stopPropagation(), t.preventDefault();
|
|
899
|
+
}, Qo = (t) => {
|
|
900
|
+
const e = ge(), n = K(), o = ne(), s = le();
|
|
901
901
|
if (!e || !n || !o || !s)
|
|
902
902
|
return;
|
|
903
|
-
const
|
|
904
|
-
if (document.activeElement instanceof HTMLElement && !
|
|
903
|
+
const r = [n, o, s];
|
|
904
|
+
if (document.activeElement instanceof HTMLElement && !r.includes(document.activeElement))
|
|
905
905
|
return;
|
|
906
|
-
const
|
|
906
|
+
const d = Qt.includes(t) ? "nextElementSibling" : "previousElementSibling";
|
|
907
907
|
let c = document.activeElement;
|
|
908
908
|
if (c) {
|
|
909
|
-
for (let
|
|
910
|
-
if (c = c[
|
|
909
|
+
for (let i = 0; i < e.children.length; i++) {
|
|
910
|
+
if (c = c[d], !c)
|
|
911
911
|
return;
|
|
912
|
-
if (c instanceof HTMLButtonElement &&
|
|
912
|
+
if (c instanceof HTMLButtonElement && D(c))
|
|
913
913
|
break;
|
|
914
914
|
}
|
|
915
915
|
c instanceof HTMLButtonElement && c.focus();
|
|
916
916
|
}
|
|
917
|
-
},
|
|
918
|
-
t.preventDefault(),
|
|
917
|
+
}, es = (t, e, n) => {
|
|
918
|
+
t.preventDefault(), Me(e.allowEscapeKey) && n(de.esc);
|
|
919
919
|
};
|
|
920
|
-
var
|
|
920
|
+
var re = {
|
|
921
921
|
swalPromiseResolve: /* @__PURE__ */ new WeakMap(),
|
|
922
922
|
swalPromiseReject: /* @__PURE__ */ new WeakMap()
|
|
923
923
|
};
|
|
924
|
-
const
|
|
925
|
-
const t =
|
|
924
|
+
const ts = () => {
|
|
925
|
+
const t = j();
|
|
926
926
|
Array.from(document.body.children).forEach((n) => {
|
|
927
927
|
n.contains(t) || (n.hasAttribute("aria-hidden") && n.setAttribute("data-previous-aria-hidden", n.getAttribute("aria-hidden") || ""), n.setAttribute("aria-hidden", "true"));
|
|
928
928
|
});
|
|
929
|
-
},
|
|
929
|
+
}, en = () => {
|
|
930
930
|
Array.from(document.body.children).forEach((e) => {
|
|
931
931
|
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");
|
|
932
932
|
});
|
|
933
|
-
},
|
|
934
|
-
if (
|
|
933
|
+
}, tn = typeof window < "u" && !!window.GestureEvent, ns = () => {
|
|
934
|
+
if (tn && !G(document.body, a.iosfix)) {
|
|
935
935
|
const t = document.body.scrollTop;
|
|
936
|
-
document.body.style.top = `${t * -1}px`,
|
|
936
|
+
document.body.style.top = `${t * -1}px`, L(document.body, a.iosfix), os();
|
|
937
937
|
}
|
|
938
|
-
},
|
|
939
|
-
const t =
|
|
938
|
+
}, os = () => {
|
|
939
|
+
const t = j();
|
|
940
940
|
if (!t)
|
|
941
941
|
return;
|
|
942
942
|
let e;
|
|
943
943
|
t.ontouchstart = (n) => {
|
|
944
|
-
e =
|
|
944
|
+
e = ss(n);
|
|
945
945
|
}, t.ontouchmove = (n) => {
|
|
946
946
|
e && (n.preventDefault(), n.stopPropagation());
|
|
947
947
|
};
|
|
948
|
-
},
|
|
949
|
-
const e = t.target, n =
|
|
950
|
-
return !n || !o ||
|
|
948
|
+
}, ss = (t) => {
|
|
949
|
+
const e = t.target, n = j(), o = tt();
|
|
950
|
+
return !n || !o || rs(t) || is(t) ? !1 : e === n || !Ke(n) && e instanceof HTMLElement && !oo(e, o) && // #2823
|
|
951
951
|
e.tagName !== "INPUT" && // #1603
|
|
952
952
|
e.tagName !== "TEXTAREA" && // #2266
|
|
953
|
-
!(
|
|
953
|
+
!(Ke(o) && // #1944
|
|
954
954
|
o.contains(e));
|
|
955
|
-
},
|
|
956
|
-
t.touches[0].touchType === "stylus"),
|
|
955
|
+
}, rs = (t) => !!(t.touches && t.touches.length && // @ts-ignore - touchType is not a standard property
|
|
956
|
+
t.touches[0].touchType === "stylus"), is = (t) => t.touches && t.touches.length > 1, as = () => {
|
|
957
957
|
if (G(document.body, a.iosfix)) {
|
|
958
958
|
const t = parseInt(document.body.style.top, 10);
|
|
959
959
|
F(document.body, a.iosfix), document.body.style.top = "", document.body.scrollTop = t * -1;
|
|
960
960
|
}
|
|
961
|
-
},
|
|
961
|
+
}, ls = () => {
|
|
962
962
|
const t = document.createElement("div");
|
|
963
963
|
t.className = a["scrollbar-measure"], document.body.appendChild(t);
|
|
964
964
|
const e = t.getBoundingClientRect().width - t.clientWidth;
|
|
965
965
|
return document.body.removeChild(t), e;
|
|
966
966
|
};
|
|
967
967
|
let se = null;
|
|
968
|
-
const
|
|
969
|
-
se === null && (document.body.scrollHeight > window.innerHeight || t === "scroll") && (se = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = `${se +
|
|
970
|
-
},
|
|
968
|
+
const cs = (t) => {
|
|
969
|
+
se === null && (document.body.scrollHeight > window.innerHeight || t === "scroll") && (se = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = `${se + ls()}px`);
|
|
970
|
+
}, ds = () => {
|
|
971
971
|
se !== null && (document.body.style.paddingRight = `${se}px`, se = null);
|
|
972
972
|
};
|
|
973
|
-
function
|
|
974
|
-
|
|
973
|
+
function nn(t, e, n, o) {
|
|
974
|
+
ze() ? xt(t, o) : (Gn(n).then(() => xt(t, o)), Jt(p)), tn ? (e.setAttribute("style", "display:none !important"), e.removeAttribute("class"), e.innerHTML = "") : e.remove(), rt() && (ds(), as(), en()), us();
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function us() {
|
|
977
977
|
F([document.documentElement, document.body], [a.shown, a["height-auto"], a["no-backdrop"], a["toast-shown"]]);
|
|
978
978
|
}
|
|
979
979
|
function Y(t) {
|
|
980
|
-
t =
|
|
981
|
-
const e =
|
|
982
|
-
this.isAwaitingPromise ? t.isDismissed || (
|
|
980
|
+
t = ws(t);
|
|
981
|
+
const e = re.swalPromiseResolve.get(this), n = hs(this);
|
|
982
|
+
this.isAwaitingPromise ? t.isDismissed || (ye(this), e(t)) : n && e(t);
|
|
983
983
|
}
|
|
984
|
-
const
|
|
985
|
-
const e =
|
|
984
|
+
const hs = (t) => {
|
|
985
|
+
const e = S();
|
|
986
986
|
if (!e)
|
|
987
987
|
return !1;
|
|
988
|
-
const n =
|
|
988
|
+
const n = _.innerParams.get(t);
|
|
989
989
|
if (!n || G(e, n.hideClass.popup))
|
|
990
990
|
return !1;
|
|
991
|
-
F(e, n.showClass.popup),
|
|
992
|
-
const o =
|
|
993
|
-
return F(o, n.showClass.backdrop),
|
|
991
|
+
F(e, n.showClass.popup), L(e, n.hideClass.popup);
|
|
992
|
+
const o = j();
|
|
993
|
+
return F(o, n.showClass.backdrop), L(o, n.hideClass.backdrop), fs(t, e, n), !0;
|
|
994
994
|
};
|
|
995
|
-
function
|
|
996
|
-
const e =
|
|
997
|
-
|
|
995
|
+
function on(t) {
|
|
996
|
+
const e = re.swalPromiseReject.get(this);
|
|
997
|
+
ye(this), e && e(t);
|
|
998
998
|
}
|
|
999
|
-
const
|
|
1000
|
-
t.isAwaitingPromise && (delete t.isAwaitingPromise,
|
|
1001
|
-
},
|
|
999
|
+
const ye = (t) => {
|
|
1000
|
+
t.isAwaitingPromise && (delete t.isAwaitingPromise, _.innerParams.get(t) || t._destroy());
|
|
1001
|
+
}, ws = (t) => typeof t > "u" ? {
|
|
1002
1002
|
isConfirmed: !1,
|
|
1003
1003
|
isDenied: !1,
|
|
1004
1004
|
isDismissed: !0
|
|
@@ -1006,145 +1006,145 @@ const me = (t) => {
|
|
|
1006
1006
|
isConfirmed: !1,
|
|
1007
1007
|
isDenied: !1,
|
|
1008
1008
|
isDismissed: !1
|
|
1009
|
-
}, t),
|
|
1009
|
+
}, t), fs = (t, e, n) => {
|
|
1010
1010
|
var o;
|
|
1011
|
-
const s =
|
|
1012
|
-
typeof n.willClose == "function" && n.willClose(e), (o = p.eventEmitter) === null || o === void 0 || o.emit("willClose", e),
|
|
1013
|
-
},
|
|
1014
|
-
p.swalCloseEventFinishedCallback =
|
|
1015
|
-
const
|
|
1016
|
-
if (
|
|
1011
|
+
const s = j(), r = Vt(e);
|
|
1012
|
+
typeof n.willClose == "function" && n.willClose(e), (o = p.eventEmitter) === null || o === void 0 || o.emit("willClose", e), r && s ? ps(t, e, s, !!n.returnFocus, n.didClose) : s && nn(t, s, !!n.returnFocus, n.didClose);
|
|
1013
|
+
}, ps = (t, e, n, o, s) => {
|
|
1014
|
+
p.swalCloseEventFinishedCallback = nn.bind(null, t, n, o, s);
|
|
1015
|
+
const r = function(d) {
|
|
1016
|
+
if (d.target === e) {
|
|
1017
1017
|
var c;
|
|
1018
|
-
(c = p.swalCloseEventFinishedCallback) === null || c === void 0 || c.call(p), delete p.swalCloseEventFinishedCallback, e.removeEventListener("animationend",
|
|
1018
|
+
(c = p.swalCloseEventFinishedCallback) === null || c === void 0 || c.call(p), delete p.swalCloseEventFinishedCallback, e.removeEventListener("animationend", r), e.removeEventListener("transitionend", r);
|
|
1019
1019
|
}
|
|
1020
1020
|
};
|
|
1021
|
-
e.addEventListener("animationend",
|
|
1022
|
-
},
|
|
1021
|
+
e.addEventListener("animationend", r), e.addEventListener("transitionend", r);
|
|
1022
|
+
}, xt = (t, e) => {
|
|
1023
1023
|
setTimeout(() => {
|
|
1024
1024
|
var n;
|
|
1025
1025
|
typeof e == "function" && e.bind(t.params)(), (n = p.eventEmitter) === null || n === void 0 || n.emit("didClose"), t._destroy && t._destroy();
|
|
1026
1026
|
});
|
|
1027
|
-
},
|
|
1028
|
-
let e =
|
|
1029
|
-
if (e || new N(), e =
|
|
1027
|
+
}, ie = (t) => {
|
|
1028
|
+
let e = S();
|
|
1029
|
+
if (e || new N(), e = S(), !e)
|
|
1030
1030
|
return;
|
|
1031
1031
|
const n = ce();
|
|
1032
|
-
|
|
1033
|
-
},
|
|
1034
|
-
const n =
|
|
1035
|
-
!n || !o || (!e &&
|
|
1036
|
-
},
|
|
1037
|
-
e.input === "select" || e.input === "radio" ?
|
|
1038
|
-
},
|
|
1032
|
+
ze() ? O(ae()) : gs(e, t), M(n), e.setAttribute("data-loading", "true"), e.setAttribute("aria-busy", "true"), e.focus();
|
|
1033
|
+
}, gs = (t, e) => {
|
|
1034
|
+
const n = ge(), o = ce();
|
|
1035
|
+
!n || !o || (!e && D(K()) && (e = K()), M(n), e && (O(e), o.setAttribute("data-button-to-replace", e.className), n.insertBefore(o, e)), L([t, n], a.loading));
|
|
1036
|
+
}, ms = (t, e) => {
|
|
1037
|
+
e.input === "select" || e.input === "radio" ? ks(t, e) : ["text", "email", "number", "tel", "textarea"].some((n) => n === e.input) && (Qe(e.inputValue) || et(e.inputValue)) && (ie(K()), xs(t, e));
|
|
1038
|
+
}, bs = (t, e) => {
|
|
1039
1039
|
const n = t.getInput();
|
|
1040
1040
|
if (!n)
|
|
1041
1041
|
return null;
|
|
1042
1042
|
switch (e.input) {
|
|
1043
1043
|
case "checkbox":
|
|
1044
|
-
return
|
|
1044
|
+
return ys(n);
|
|
1045
1045
|
case "radio":
|
|
1046
|
-
return
|
|
1046
|
+
return vs(n);
|
|
1047
1047
|
case "file":
|
|
1048
|
-
return
|
|
1048
|
+
return Cs(n);
|
|
1049
1049
|
default:
|
|
1050
1050
|
return e.inputAutoTrim ? n.value.trim() : n.value;
|
|
1051
1051
|
}
|
|
1052
|
-
},
|
|
1053
|
-
const n =
|
|
1052
|
+
}, ys = (t) => t.checked ? 1 : 0, vs = (t) => t.checked ? t.value : null, Cs = (t) => t.files && t.files.length ? t.getAttribute("multiple") !== null ? t.files : t.files[0] : null, ks = (t, e) => {
|
|
1053
|
+
const n = S();
|
|
1054
1054
|
if (!n)
|
|
1055
1055
|
return;
|
|
1056
1056
|
const o = (s) => {
|
|
1057
|
-
e.input === "select" ?
|
|
1057
|
+
e.input === "select" ? As(n, $e(s), e) : e.input === "radio" && Es(n, $e(s), e);
|
|
1058
1058
|
};
|
|
1059
|
-
|
|
1059
|
+
Qe(e.inputOptions) || et(e.inputOptions) ? (ie(K()), fe(e.inputOptions).then((s) => {
|
|
1060
1060
|
t.hideLoading(), o(s);
|
|
1061
1061
|
})) : typeof e.inputOptions == "object" ? o(e.inputOptions) : te(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`);
|
|
1062
|
-
},
|
|
1062
|
+
}, xs = (t, e) => {
|
|
1063
1063
|
const n = t.getInput();
|
|
1064
|
-
n && (O(n),
|
|
1064
|
+
n && (O(n), fe(e.inputValue).then((o) => {
|
|
1065
1065
|
n.value = e.input === "number" ? `${parseFloat(o) || 0}` : `${o}`, M(n), n.focus(), t.hideLoading();
|
|
1066
1066
|
}).catch((o) => {
|
|
1067
1067
|
te(`Error in inputValue promise: ${o}`), n.value = "", M(n), n.focus(), t.hideLoading();
|
|
1068
1068
|
}));
|
|
1069
1069
|
};
|
|
1070
|
-
function
|
|
1070
|
+
function As(t, e, n) {
|
|
1071
1071
|
const o = W(t, a.select);
|
|
1072
1072
|
if (!o)
|
|
1073
1073
|
return;
|
|
1074
|
-
const s = (
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1074
|
+
const s = (r, d, c) => {
|
|
1075
|
+
const i = document.createElement("option");
|
|
1076
|
+
i.value = c, V(i, d), i.selected = sn(c, n.inputValue), r.appendChild(i);
|
|
1077
1077
|
};
|
|
1078
|
-
e.forEach((
|
|
1079
|
-
const
|
|
1078
|
+
e.forEach((r) => {
|
|
1079
|
+
const d = r[0], c = r[1];
|
|
1080
1080
|
if (Array.isArray(c)) {
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1081
|
+
const i = document.createElement("optgroup");
|
|
1082
|
+
i.label = d, i.disabled = !1, o.appendChild(i), c.forEach((l) => s(i, l[1], l[0]));
|
|
1083
1083
|
} else
|
|
1084
|
-
s(o, c,
|
|
1084
|
+
s(o, c, d);
|
|
1085
1085
|
}), o.focus();
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function Es(t, e, n) {
|
|
1088
1088
|
const o = W(t, a.radio);
|
|
1089
1089
|
if (!o)
|
|
1090
1090
|
return;
|
|
1091
|
-
e.forEach((
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1091
|
+
e.forEach((r) => {
|
|
1092
|
+
const d = r[0], c = r[1], i = document.createElement("input"), l = document.createElement("label");
|
|
1093
|
+
i.type = "radio", i.name = a.radio, i.value = d, sn(d, n.inputValue) && (i.checked = !0);
|
|
1094
|
+
const u = document.createElement("span");
|
|
1095
|
+
V(u, c), u.className = a.label, l.appendChild(i), l.appendChild(u), o.appendChild(l);
|
|
1096
1096
|
});
|
|
1097
1097
|
const s = o.querySelectorAll("input");
|
|
1098
1098
|
s.length && s[0].focus();
|
|
1099
1099
|
}
|
|
1100
|
-
const
|
|
1100
|
+
const $e = (t) => {
|
|
1101
1101
|
const e = [];
|
|
1102
1102
|
return t instanceof Map ? t.forEach((n, o) => {
|
|
1103
1103
|
let s = n;
|
|
1104
|
-
typeof s == "object" && (s =
|
|
1104
|
+
typeof s == "object" && (s = $e(s)), e.push([o, s]);
|
|
1105
1105
|
}) : Object.keys(t).forEach((n) => {
|
|
1106
1106
|
let o = t[n];
|
|
1107
|
-
typeof o == "object" && (o =
|
|
1107
|
+
typeof o == "object" && (o = $e(o)), e.push([n, o]);
|
|
1108
1108
|
}), e;
|
|
1109
|
-
},
|
|
1110
|
-
const e =
|
|
1111
|
-
t.disableButtons(), e.input ?
|
|
1112
|
-
},
|
|
1113
|
-
const e =
|
|
1114
|
-
t.disableButtons(), e.returnInputValueOnDeny ?
|
|
1115
|
-
},
|
|
1116
|
-
t.disableButtons(), e(
|
|
1117
|
-
},
|
|
1118
|
-
const n =
|
|
1109
|
+
}, sn = (t, e) => !!e && e !== null && e !== void 0 && e.toString() === t.toString(), Ls = (t) => {
|
|
1110
|
+
const e = _.innerParams.get(t);
|
|
1111
|
+
t.disableButtons(), e.input ? rn(t, "confirm") : ht(t, !0);
|
|
1112
|
+
}, Ss = (t) => {
|
|
1113
|
+
const e = _.innerParams.get(t);
|
|
1114
|
+
t.disableButtons(), e.returnInputValueOnDeny ? rn(t, "deny") : ut(t, !1);
|
|
1115
|
+
}, Ts = (t, e) => {
|
|
1116
|
+
t.disableButtons(), e(de.cancel);
|
|
1117
|
+
}, rn = (t, e) => {
|
|
1118
|
+
const n = _.innerParams.get(t);
|
|
1119
1119
|
if (!n.input) {
|
|
1120
|
-
te(`The "input" parameter is needed to be set when using returnInputValueOn${
|
|
1120
|
+
te(`The "input" parameter is needed to be set when using returnInputValueOn${Je(e)}`);
|
|
1121
1121
|
return;
|
|
1122
1122
|
}
|
|
1123
|
-
const o = t.getInput(), s =
|
|
1124
|
-
n.inputValidator ?
|
|
1125
|
-
},
|
|
1126
|
-
const o =
|
|
1127
|
-
t.disableInput(), Promise.resolve().then(() =>
|
|
1128
|
-
t.enableButtons(), t.enableInput(),
|
|
1123
|
+
const o = t.getInput(), s = bs(t, n);
|
|
1124
|
+
n.inputValidator ? _s(t, s, e) : o && !o.checkValidity() ? (t.enableButtons(), t.showValidationMessage(n.validationMessage || o.validationMessage)) : e === "deny" ? ut(t, s) : ht(t, s);
|
|
1125
|
+
}, _s = (t, e, n) => {
|
|
1126
|
+
const o = _.innerParams.get(t);
|
|
1127
|
+
t.disableInput(), Promise.resolve().then(() => fe(o.inputValidator(e, o.validationMessage))).then((r) => {
|
|
1128
|
+
t.enableButtons(), t.enableInput(), r ? t.showValidationMessage(r) : n === "deny" ? ut(t, e) : ht(t, e);
|
|
1129
1129
|
});
|
|
1130
|
-
},
|
|
1131
|
-
const n =
|
|
1132
|
-
n.showLoaderOnDeny &&
|
|
1133
|
-
s === !1 ? (t.hideLoading(),
|
|
1130
|
+
}, ut = (t, e) => {
|
|
1131
|
+
const n = _.innerParams.get(t);
|
|
1132
|
+
n.showLoaderOnDeny && ie(ne()), n.preDeny ? (t.isAwaitingPromise = !0, Promise.resolve().then(() => fe(n.preDeny(e, n.validationMessage))).then((s) => {
|
|
1133
|
+
s === !1 ? (t.hideLoading(), ye(t)) : t.close(
|
|
1134
1134
|
/** @type SweetAlertResult */
|
|
1135
1135
|
{
|
|
1136
1136
|
isDenied: !0,
|
|
1137
1137
|
value: typeof s > "u" ? e : s
|
|
1138
1138
|
}
|
|
1139
1139
|
);
|
|
1140
|
-
}).catch((s) =>
|
|
1140
|
+
}).catch((s) => an(t, s))) : t.close(
|
|
1141
1141
|
/** @type SweetAlertResult */
|
|
1142
1142
|
{
|
|
1143
1143
|
isDenied: !0,
|
|
1144
1144
|
value: e
|
|
1145
1145
|
}
|
|
1146
1146
|
);
|
|
1147
|
-
},
|
|
1147
|
+
}, At = (t, e) => {
|
|
1148
1148
|
t.close(
|
|
1149
1149
|
/** @type SweetAlertResult */
|
|
1150
1150
|
{
|
|
@@ -1152,41 +1152,41 @@ const Te = (t) => {
|
|
|
1152
1152
|
value: e
|
|
1153
1153
|
}
|
|
1154
1154
|
);
|
|
1155
|
-
},
|
|
1155
|
+
}, an = (t, e) => {
|
|
1156
1156
|
t.rejectPromise(e);
|
|
1157
|
-
},
|
|
1158
|
-
const n =
|
|
1159
|
-
n.showLoaderOnConfirm &&
|
|
1160
|
-
|
|
1161
|
-
}).catch((s) =>
|
|
1157
|
+
}, ht = (t, e) => {
|
|
1158
|
+
const n = _.innerParams.get(t);
|
|
1159
|
+
n.showLoaderOnConfirm && ie(), n.preConfirm ? (t.resetValidationMessage(), t.isAwaitingPromise = !0, Promise.resolve().then(() => fe(n.preConfirm(e, n.validationMessage))).then((s) => {
|
|
1160
|
+
D(Ne()) || s === !1 ? (t.hideLoading(), ye(t)) : At(t, typeof s > "u" ? e : s);
|
|
1161
|
+
}).catch((s) => an(t, s))) : At(t, e);
|
|
1162
1162
|
};
|
|
1163
|
-
function
|
|
1164
|
-
const t =
|
|
1163
|
+
function Be() {
|
|
1164
|
+
const t = _.innerParams.get(this);
|
|
1165
1165
|
if (!t)
|
|
1166
1166
|
return;
|
|
1167
|
-
const e =
|
|
1168
|
-
O(e.loader),
|
|
1167
|
+
const e = _.domCache.get(this);
|
|
1168
|
+
O(e.loader), ze() ? t.icon && M(ae()) : $s(e), F([e.popup, e.actions], a.loading), e.popup.removeAttribute("aria-busy"), e.popup.removeAttribute("data-loading"), e.confirmButton.disabled = !1, e.denyButton.disabled = !1, e.cancelButton.disabled = !1;
|
|
1169
1169
|
}
|
|
1170
|
-
const
|
|
1170
|
+
const $s = (t) => {
|
|
1171
1171
|
const e = t.loader.getAttribute("data-button-to-replace"), n = e ? t.popup.getElementsByClassName(e) : [];
|
|
1172
1172
|
n.length ? M(
|
|
1173
1173
|
/** @type {HTMLElement} */
|
|
1174
1174
|
n[0],
|
|
1175
1175
|
"inline-block"
|
|
1176
|
-
) :
|
|
1176
|
+
) : no() && O(t.actions);
|
|
1177
1177
|
};
|
|
1178
|
-
function
|
|
1179
|
-
const t =
|
|
1180
|
-
return e ?
|
|
1178
|
+
function ln() {
|
|
1179
|
+
const t = _.innerParams.get(this), e = _.domCache.get(this);
|
|
1180
|
+
return e ? je(e.popup, t.input) : null;
|
|
1181
1181
|
}
|
|
1182
|
-
function
|
|
1183
|
-
const o =
|
|
1182
|
+
function cn(t, e, n) {
|
|
1183
|
+
const o = _.domCache.get(t);
|
|
1184
1184
|
e.forEach((s) => {
|
|
1185
1185
|
o[s].disabled = n;
|
|
1186
1186
|
});
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1189
|
-
const n =
|
|
1188
|
+
function dn(t, e) {
|
|
1189
|
+
const n = S();
|
|
1190
1190
|
if (!(!n || !t))
|
|
1191
1191
|
if (t.type === "radio") {
|
|
1192
1192
|
const o = n.querySelectorAll(`[name="${a.radio}"]`);
|
|
@@ -1195,26 +1195,26 @@ function an(t, e) {
|
|
|
1195
1195
|
} else
|
|
1196
1196
|
t.disabled = e;
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1199
|
-
|
|
1198
|
+
function un() {
|
|
1199
|
+
cn(this, ["confirmButton", "denyButton", "cancelButton"], !1);
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1202
|
-
|
|
1201
|
+
function hn() {
|
|
1202
|
+
cn(this, ["confirmButton", "denyButton", "cancelButton"], !0);
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1205
|
-
|
|
1204
|
+
function wn() {
|
|
1205
|
+
dn(this.getInput(), !1);
|
|
1206
1206
|
}
|
|
1207
|
-
function
|
|
1208
|
-
|
|
1207
|
+
function fn() {
|
|
1208
|
+
dn(this.getInput(), !0);
|
|
1209
1209
|
}
|
|
1210
|
-
function
|
|
1211
|
-
const e =
|
|
1212
|
-
|
|
1210
|
+
function pn(t) {
|
|
1211
|
+
const e = _.domCache.get(this), n = _.innerParams.get(this);
|
|
1212
|
+
V(e.validationMessage, t), e.validationMessage.className = a["validation-message"], n.customClass && n.customClass.validationMessage && L(e.validationMessage, n.customClass.validationMessage), M(e.validationMessage);
|
|
1213
1213
|
const o = this.getInput();
|
|
1214
|
-
o && (o.setAttribute("aria-invalid", "true"), o.setAttribute("aria-describedby", a["validation-message"]),
|
|
1214
|
+
o && (o.setAttribute("aria-invalid", "true"), o.setAttribute("aria-describedby", a["validation-message"]), Ut(o), L(o, a.inputerror));
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1217
|
-
const t =
|
|
1216
|
+
function gn() {
|
|
1217
|
+
const t = _.domCache.get(this);
|
|
1218
1218
|
t.validationMessage && O(t.validationMessage);
|
|
1219
1219
|
const e = this.getInput();
|
|
1220
1220
|
e && (e.removeAttribute("aria-invalid"), e.removeAttribute("aria-describedby"), F(e, a.inputerror));
|
|
@@ -1312,28 +1312,28 @@ const Z = {
|
|
|
1312
1312
|
didDestroy: void 0,
|
|
1313
1313
|
scrollbarPadding: !0,
|
|
1314
1314
|
topLayer: !1
|
|
1315
|
-
},
|
|
1315
|
+
}, Bs = ["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"], Is = {
|
|
1316
1316
|
allowEnterKey: void 0
|
|
1317
|
-
},
|
|
1318
|
-
|
|
1319
|
-
},
|
|
1320
|
-
|
|
1321
|
-
},
|
|
1322
|
-
const e =
|
|
1323
|
-
e &&
|
|
1324
|
-
},
|
|
1317
|
+
}, Ps = ["allowOutsideClick", "allowEnterKey", "backdrop", "draggable", "focusConfirm", "focusDeny", "focusCancel", "returnFocus", "heightAuto", "keydownListenerCapture"], mn = (t) => Object.prototype.hasOwnProperty.call(Z, t), bn = (t) => Bs.indexOf(t) !== -1, yn = (t) => Is[t], Ms = (t) => {
|
|
1318
|
+
mn(t) || z(`Unknown parameter "${t}"`);
|
|
1319
|
+
}, Ns = (t) => {
|
|
1320
|
+
Ps.includes(t) && z(`The parameter "${t}" is incompatible with toasts`);
|
|
1321
|
+
}, Os = (t) => {
|
|
1322
|
+
const e = yn(t);
|
|
1323
|
+
e && Ot(t, e);
|
|
1324
|
+
}, vn = (t) => {
|
|
1325
1325
|
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}"`);
|
|
1326
1326
|
for (const e in t)
|
|
1327
|
-
|
|
1327
|
+
Ms(e), t.toast && Ns(e), Os(e);
|
|
1328
1328
|
};
|
|
1329
|
-
function
|
|
1330
|
-
const e =
|
|
1329
|
+
function Cn(t) {
|
|
1330
|
+
const e = j(), n = S(), o = _.innerParams.get(this);
|
|
1331
1331
|
if (!n || G(n, o.hideClass.popup)) {
|
|
1332
1332
|
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.");
|
|
1333
1333
|
return;
|
|
1334
1334
|
}
|
|
1335
|
-
const s =
|
|
1336
|
-
|
|
1335
|
+
const s = zs(t), r = Object.assign({}, o, s);
|
|
1336
|
+
vn(r), e && (e.dataset.swal2Theme = r.theme), Zt(this, r), _.innerParams.set(this, r), Object.defineProperties(this, {
|
|
1337
1337
|
params: {
|
|
1338
1338
|
value: Object.assign({}, this.params, t),
|
|
1339
1339
|
writable: !1,
|
|
@@ -1341,10 +1341,10 @@ function bn(t) {
|
|
|
1341
1341
|
}
|
|
1342
1342
|
});
|
|
1343
1343
|
}
|
|
1344
|
-
const
|
|
1344
|
+
const zs = (t) => {
|
|
1345
1345
|
const e = {};
|
|
1346
1346
|
return Object.keys(t).forEach((n) => {
|
|
1347
|
-
if (
|
|
1347
|
+
if (bn(n)) {
|
|
1348
1348
|
const o = (
|
|
1349
1349
|
/** @type {Record<string, any>} */
|
|
1350
1350
|
t
|
|
@@ -1354,85 +1354,85 @@ const Is = (t) => {
|
|
|
1354
1354
|
z(`Invalid parameter to update: ${n}`);
|
|
1355
1355
|
}), e;
|
|
1356
1356
|
};
|
|
1357
|
-
function
|
|
1357
|
+
function kn() {
|
|
1358
1358
|
var t;
|
|
1359
|
-
const e =
|
|
1359
|
+
const e = _.domCache.get(this), n = _.innerParams.get(this);
|
|
1360
1360
|
if (!n) {
|
|
1361
|
-
|
|
1361
|
+
xn(this);
|
|
1362
1362
|
return;
|
|
1363
1363
|
}
|
|
1364
|
-
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"),
|
|
1364
|
+
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"), js(this);
|
|
1365
1365
|
}
|
|
1366
|
-
const
|
|
1367
|
-
|
|
1368
|
-
},
|
|
1369
|
-
t.isAwaitingPromise ? (
|
|
1370
|
-
},
|
|
1366
|
+
const js = (t) => {
|
|
1367
|
+
xn(t), delete t.params, delete p.keydownHandler, delete p.keydownTarget, delete p.currentInstance;
|
|
1368
|
+
}, xn = (t) => {
|
|
1369
|
+
t.isAwaitingPromise ? (Ve(_, t), t.isAwaitingPromise = !0) : (Ve(re, t), Ve(_, 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);
|
|
1370
|
+
}, Ve = (t, e) => {
|
|
1371
1371
|
for (const n in t)
|
|
1372
1372
|
t[n].delete(e);
|
|
1373
1373
|
};
|
|
1374
|
-
var
|
|
1374
|
+
var Ds = /* @__PURE__ */ Object.freeze({
|
|
1375
1375
|
__proto__: null,
|
|
1376
|
-
_destroy:
|
|
1376
|
+
_destroy: kn,
|
|
1377
1377
|
close: Y,
|
|
1378
1378
|
closeModal: Y,
|
|
1379
1379
|
closePopup: Y,
|
|
1380
1380
|
closeToast: Y,
|
|
1381
|
-
disableButtons:
|
|
1382
|
-
disableInput:
|
|
1383
|
-
disableLoading:
|
|
1384
|
-
enableButtons:
|
|
1385
|
-
enableInput:
|
|
1386
|
-
getInput:
|
|
1387
|
-
handleAwaitingPromise:
|
|
1388
|
-
hideLoading:
|
|
1389
|
-
rejectPromise:
|
|
1390
|
-
resetValidationMessage:
|
|
1391
|
-
showValidationMessage:
|
|
1392
|
-
update:
|
|
1381
|
+
disableButtons: hn,
|
|
1382
|
+
disableInput: fn,
|
|
1383
|
+
disableLoading: Be,
|
|
1384
|
+
enableButtons: un,
|
|
1385
|
+
enableInput: wn,
|
|
1386
|
+
getInput: ln,
|
|
1387
|
+
handleAwaitingPromise: ye,
|
|
1388
|
+
hideLoading: Be,
|
|
1389
|
+
rejectPromise: on,
|
|
1390
|
+
resetValidationMessage: gn,
|
|
1391
|
+
showValidationMessage: pn,
|
|
1392
|
+
update: Cn
|
|
1393
1393
|
});
|
|
1394
|
-
const
|
|
1395
|
-
t.toast ?
|
|
1396
|
-
},
|
|
1394
|
+
const Us = (t, e, n) => {
|
|
1395
|
+
t.toast ? Hs(t, e, n) : (Rs(e), Fs(e), qs(t, e, n));
|
|
1396
|
+
}, Hs = (t, e, n) => {
|
|
1397
1397
|
e.popup.onclick = () => {
|
|
1398
|
-
t && (
|
|
1398
|
+
t && (Vs(t) || t.timer || t.input) || n(de.close);
|
|
1399
1399
|
};
|
|
1400
|
-
},
|
|
1401
|
-
let
|
|
1402
|
-
const
|
|
1400
|
+
}, Vs = (t) => !!(t.showConfirmButton || t.showDenyButton || t.showCancelButton || t.showCloseButton);
|
|
1401
|
+
let Ie = !1;
|
|
1402
|
+
const Rs = (t) => {
|
|
1403
1403
|
t.popup.onmousedown = () => {
|
|
1404
1404
|
t.container.onmouseup = function(e) {
|
|
1405
1405
|
t.container.onmouseup = () => {
|
|
1406
|
-
}, e.target === t.container && (
|
|
1406
|
+
}, e.target === t.container && (Ie = !0);
|
|
1407
1407
|
};
|
|
1408
1408
|
};
|
|
1409
|
-
},
|
|
1409
|
+
}, Fs = (t) => {
|
|
1410
1410
|
t.container.onmousedown = (e) => {
|
|
1411
1411
|
e.target === t.container && e.preventDefault(), t.popup.onmouseup = function(n) {
|
|
1412
1412
|
t.popup.onmouseup = () => {
|
|
1413
|
-
}, (n.target === t.popup || n.target instanceof HTMLElement && t.popup.contains(n.target)) && (
|
|
1413
|
+
}, (n.target === t.popup || n.target instanceof HTMLElement && t.popup.contains(n.target)) && (Ie = !0);
|
|
1414
1414
|
};
|
|
1415
1415
|
};
|
|
1416
|
-
},
|
|
1416
|
+
}, qs = (t, e, n) => {
|
|
1417
1417
|
e.container.onclick = (o) => {
|
|
1418
|
-
if (
|
|
1419
|
-
|
|
1418
|
+
if (Ie) {
|
|
1419
|
+
Ie = !1;
|
|
1420
1420
|
return;
|
|
1421
1421
|
}
|
|
1422
|
-
o.target === e.container &&
|
|
1422
|
+
o.target === e.container && Me(t.allowOutsideClick) && n(de.backdrop);
|
|
1423
1423
|
};
|
|
1424
|
-
},
|
|
1424
|
+
}, Ks = (t) => typeof t == "object" && t !== null && "jquery" in t, Et = (t) => t instanceof Element || Ks(t), Gs = (t) => {
|
|
1425
1425
|
const e = {};
|
|
1426
|
-
return typeof t[0] == "object" && !
|
|
1426
|
+
return typeof t[0] == "object" && !Et(t[0]) ? Object.assign(e, t[0]) : ["title", "html", "icon"].forEach((n, o) => {
|
|
1427
1427
|
const s = t[o];
|
|
1428
|
-
typeof s == "string" ||
|
|
1428
|
+
typeof s == "string" || Et(s) ? e[n] = s : s !== void 0 && te(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof s}`);
|
|
1429
1429
|
}), /** @type {SweetAlertOptions} */
|
|
1430
1430
|
e;
|
|
1431
1431
|
};
|
|
1432
|
-
function
|
|
1432
|
+
function Ws(...t) {
|
|
1433
1433
|
return new this(...t);
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1435
|
+
function Ys(t) {
|
|
1436
1436
|
class e extends this {
|
|
1437
1437
|
/**
|
|
1438
1438
|
* @param {any} params
|
|
@@ -1444,44 +1444,44 @@ function Fs(t) {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
return e;
|
|
1446
1446
|
}
|
|
1447
|
-
const
|
|
1447
|
+
const Zs = () => p.timeout && p.timeout.getTimerLeft(), An = () => {
|
|
1448
1448
|
if (p.timeout)
|
|
1449
|
-
return
|
|
1450
|
-
},
|
|
1449
|
+
return so(), p.timeout.stop();
|
|
1450
|
+
}, En = () => {
|
|
1451
1451
|
if (p.timeout) {
|
|
1452
1452
|
const t = p.timeout.start();
|
|
1453
|
-
return
|
|
1453
|
+
return at(t), t;
|
|
1454
1454
|
}
|
|
1455
|
-
},
|
|
1455
|
+
}, Xs = () => {
|
|
1456
1456
|
const t = p.timeout;
|
|
1457
|
-
return t && (t.running ?
|
|
1458
|
-
},
|
|
1457
|
+
return t && (t.running ? An() : En());
|
|
1458
|
+
}, Js = (t) => {
|
|
1459
1459
|
if (p.timeout) {
|
|
1460
1460
|
const e = p.timeout.increase(t);
|
|
1461
|
-
return
|
|
1461
|
+
return at(e, !0), e;
|
|
1462
1462
|
}
|
|
1463
|
-
},
|
|
1464
|
-
let
|
|
1465
|
-
const
|
|
1466
|
-
function
|
|
1467
|
-
|
|
1463
|
+
}, Qs = () => !!(p.timeout && p.timeout.isRunning());
|
|
1464
|
+
let Lt = !1;
|
|
1465
|
+
const We = {};
|
|
1466
|
+
function er(t = "data-swal-template") {
|
|
1467
|
+
We[t] = this, Lt || (document.body.addEventListener("click", tr), Lt = !0);
|
|
1468
1468
|
}
|
|
1469
|
-
const
|
|
1469
|
+
const tr = (t) => {
|
|
1470
1470
|
for (let e = (
|
|
1471
1471
|
/** @type {any} */
|
|
1472
1472
|
t.target
|
|
1473
1473
|
); e && e !== document; e = e.parentNode)
|
|
1474
|
-
for (const n in
|
|
1474
|
+
for (const n in We) {
|
|
1475
1475
|
const o = e.getAttribute && e.getAttribute(n);
|
|
1476
1476
|
if (o) {
|
|
1477
|
-
|
|
1477
|
+
We[n].fire({
|
|
1478
1478
|
template: o
|
|
1479
1479
|
});
|
|
1480
1480
|
return;
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
1483
|
};
|
|
1484
|
-
class
|
|
1484
|
+
class nr {
|
|
1485
1485
|
constructor() {
|
|
1486
1486
|
this.events = {};
|
|
1487
1487
|
}
|
|
@@ -1546,12 +1546,12 @@ class Xs {
|
|
|
1546
1546
|
this.events = {};
|
|
1547
1547
|
}
|
|
1548
1548
|
}
|
|
1549
|
-
p.eventEmitter = new
|
|
1550
|
-
const
|
|
1549
|
+
p.eventEmitter = new nr();
|
|
1550
|
+
const or = (t, e) => {
|
|
1551
1551
|
p.eventEmitter && p.eventEmitter.on(t, e);
|
|
1552
|
-
},
|
|
1552
|
+
}, sr = (t, e) => {
|
|
1553
1553
|
p.eventEmitter && p.eventEmitter.once(t, e);
|
|
1554
|
-
},
|
|
1554
|
+
}, rr = (t, e) => {
|
|
1555
1555
|
if (p.eventEmitter) {
|
|
1556
1556
|
if (!t) {
|
|
1557
1557
|
p.eventEmitter.reset();
|
|
@@ -1560,52 +1560,52 @@ const Js = (t, e) => {
|
|
|
1560
1560
|
e ? p.eventEmitter.removeListener(t, e) : p.eventEmitter.removeAllListeners(t);
|
|
1561
1561
|
}
|
|
1562
1562
|
};
|
|
1563
|
-
var
|
|
1563
|
+
var ir = /* @__PURE__ */ Object.freeze({
|
|
1564
1564
|
__proto__: null,
|
|
1565
|
-
argsToParams:
|
|
1566
|
-
bindClickHandler:
|
|
1567
|
-
clickCancel:
|
|
1568
|
-
clickConfirm:
|
|
1569
|
-
clickDeny:
|
|
1570
|
-
enableLoading:
|
|
1571
|
-
fire:
|
|
1572
|
-
getActions:
|
|
1565
|
+
argsToParams: Gs,
|
|
1566
|
+
bindClickHandler: er,
|
|
1567
|
+
clickCancel: Go,
|
|
1568
|
+
clickConfirm: Xt,
|
|
1569
|
+
clickDeny: Ko,
|
|
1570
|
+
enableLoading: ie,
|
|
1571
|
+
fire: Ws,
|
|
1572
|
+
getActions: ge,
|
|
1573
1573
|
getCancelButton: le,
|
|
1574
|
-
getCloseButton:
|
|
1574
|
+
getCloseButton: ot,
|
|
1575
1575
|
getConfirmButton: K,
|
|
1576
|
-
getContainer:
|
|
1576
|
+
getContainer: j,
|
|
1577
1577
|
getDenyButton: ne,
|
|
1578
|
-
getFocusableElements:
|
|
1579
|
-
getFooter:
|
|
1580
|
-
getHtmlContainer:
|
|
1578
|
+
getFocusableElements: st,
|
|
1579
|
+
getFooter: Dt,
|
|
1580
|
+
getHtmlContainer: tt,
|
|
1581
1581
|
getIcon: ae,
|
|
1582
|
-
getIconContent:
|
|
1583
|
-
getImage:
|
|
1584
|
-
getInputLabel:
|
|
1582
|
+
getIconContent: Xn,
|
|
1583
|
+
getImage: jt,
|
|
1584
|
+
getInputLabel: Jn,
|
|
1585
1585
|
getLoader: ce,
|
|
1586
|
-
getPopup:
|
|
1587
|
-
getProgressSteps:
|
|
1588
|
-
getTimerLeft:
|
|
1589
|
-
getTimerProgressBar:
|
|
1590
|
-
getTitle:
|
|
1591
|
-
getValidationMessage:
|
|
1592
|
-
increaseTimer:
|
|
1593
|
-
isDeprecatedParameter:
|
|
1594
|
-
isLoading:
|
|
1595
|
-
isTimerRunning:
|
|
1596
|
-
isUpdatableParameter:
|
|
1597
|
-
isValidParameter:
|
|
1598
|
-
isVisible:
|
|
1599
|
-
mixin:
|
|
1600
|
-
off:
|
|
1601
|
-
on:
|
|
1602
|
-
once:
|
|
1603
|
-
resumeTimer:
|
|
1604
|
-
showLoading:
|
|
1605
|
-
stopTimer:
|
|
1606
|
-
toggleTimer:
|
|
1586
|
+
getPopup: S,
|
|
1587
|
+
getProgressSteps: nt,
|
|
1588
|
+
getTimerLeft: Zs,
|
|
1589
|
+
getTimerProgressBar: Oe,
|
|
1590
|
+
getTitle: zt,
|
|
1591
|
+
getValidationMessage: Ne,
|
|
1592
|
+
increaseTimer: Js,
|
|
1593
|
+
isDeprecatedParameter: yn,
|
|
1594
|
+
isLoading: eo,
|
|
1595
|
+
isTimerRunning: Qs,
|
|
1596
|
+
isUpdatableParameter: bn,
|
|
1597
|
+
isValidParameter: mn,
|
|
1598
|
+
isVisible: qo,
|
|
1599
|
+
mixin: Ys,
|
|
1600
|
+
off: rr,
|
|
1601
|
+
on: or,
|
|
1602
|
+
once: sr,
|
|
1603
|
+
resumeTimer: En,
|
|
1604
|
+
showLoading: ie,
|
|
1605
|
+
stopTimer: An,
|
|
1606
|
+
toggleTimer: Xs
|
|
1607
1607
|
});
|
|
1608
|
-
class
|
|
1608
|
+
class ar {
|
|
1609
1609
|
/**
|
|
1610
1610
|
* @param {() => void} callback
|
|
1611
1611
|
* @param {number} delay
|
|
@@ -1646,7 +1646,7 @@ class ni {
|
|
|
1646
1646
|
return this.running;
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
|
-
const
|
|
1649
|
+
const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
1650
1650
|
const e = typeof t.template == "string" ? (
|
|
1651
1651
|
/** @type {HTMLTemplateElement} */
|
|
1652
1652
|
document.querySelector(t.template)
|
|
@@ -1654,75 +1654,75 @@ const xn = ["swal-title", "swal-html", "swal-footer"], oi = (t) => {
|
|
|
1654
1654
|
if (!e)
|
|
1655
1655
|
return {};
|
|
1656
1656
|
const n = e.content;
|
|
1657
|
-
return
|
|
1658
|
-
},
|
|
1657
|
+
return gr(n), Object.assign(cr(n), dr(n), ur(n), hr(n), wr(n), fr(n), pr(n, Ln));
|
|
1658
|
+
}, cr = (t) => {
|
|
1659
1659
|
const e = {};
|
|
1660
1660
|
return Array.from(t.querySelectorAll("swal-param")).forEach((o) => {
|
|
1661
1661
|
ee(o, ["name", "value"]);
|
|
1662
1662
|
const s = (
|
|
1663
1663
|
/** @type {keyof SweetAlertOptions} */
|
|
1664
1664
|
o.getAttribute("name")
|
|
1665
|
-
),
|
|
1666
|
-
!s || !
|
|
1665
|
+
), r = o.getAttribute("value");
|
|
1666
|
+
!s || !r || (s in Z && typeof Z[
|
|
1667
1667
|
/** @type {keyof typeof defaultParams} */
|
|
1668
1668
|
s
|
|
1669
|
-
] == "boolean" ? e[s] =
|
|
1669
|
+
] == "boolean" ? e[s] = r !== "false" : s in Z && typeof Z[
|
|
1670
1670
|
/** @type {keyof typeof defaultParams} */
|
|
1671
1671
|
s
|
|
1672
|
-
] == "object" ? e[s] = JSON.parse(
|
|
1672
|
+
] == "object" ? e[s] = JSON.parse(r) : e[s] = r);
|
|
1673
1673
|
}), e;
|
|
1674
|
-
},
|
|
1674
|
+
}, dr = (t) => {
|
|
1675
1675
|
const e = {};
|
|
1676
1676
|
return Array.from(t.querySelectorAll("swal-function-param")).forEach((o) => {
|
|
1677
1677
|
const s = (
|
|
1678
1678
|
/** @type {keyof SweetAlertOptions} */
|
|
1679
1679
|
o.getAttribute("name")
|
|
1680
|
-
),
|
|
1681
|
-
!s || !
|
|
1680
|
+
), r = o.getAttribute("value");
|
|
1681
|
+
!s || !r || (e[s] = new Function(`return ${r}`)());
|
|
1682
1682
|
}), e;
|
|
1683
|
-
},
|
|
1683
|
+
}, ur = (t) => {
|
|
1684
1684
|
const e = {};
|
|
1685
1685
|
return Array.from(t.querySelectorAll("swal-button")).forEach((o) => {
|
|
1686
1686
|
ee(o, ["type", "color", "aria-label"]);
|
|
1687
1687
|
const s = o.getAttribute("type");
|
|
1688
1688
|
if (!(!s || !["confirm", "cancel", "deny"].includes(s))) {
|
|
1689
|
-
if (e[`${s}ButtonText`] = o.innerHTML, e[`show${
|
|
1690
|
-
const
|
|
1691
|
-
|
|
1689
|
+
if (e[`${s}ButtonText`] = o.innerHTML, e[`show${Je(s)}Button`] = !0, o.hasAttribute("color")) {
|
|
1690
|
+
const r = o.getAttribute("color");
|
|
1691
|
+
r !== null && (e[`${s}ButtonColor`] = r);
|
|
1692
1692
|
}
|
|
1693
1693
|
if (o.hasAttribute("aria-label")) {
|
|
1694
|
-
const
|
|
1695
|
-
|
|
1694
|
+
const r = o.getAttribute("aria-label");
|
|
1695
|
+
r !== null && (e[`${s}ButtonAriaLabel`] = r);
|
|
1696
1696
|
}
|
|
1697
1697
|
}
|
|
1698
1698
|
}), e;
|
|
1699
|
-
},
|
|
1699
|
+
}, hr = (t) => {
|
|
1700
1700
|
const e = {}, n = t.querySelector("swal-image");
|
|
1701
1701
|
return n && (ee(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;
|
|
1702
|
-
},
|
|
1702
|
+
}, wr = (t) => {
|
|
1703
1703
|
const e = {}, n = t.querySelector("swal-icon");
|
|
1704
1704
|
return n && (ee(n, ["type", "color"]), n.hasAttribute("type") && (e.icon = n.getAttribute("type")), n.hasAttribute("color") && (e.iconColor = n.getAttribute("color")), e.iconHtml = n.innerHTML), e;
|
|
1705
|
-
},
|
|
1705
|
+
}, fr = (t) => {
|
|
1706
1706
|
const e = {}, n = t.querySelector("swal-input");
|
|
1707
1707
|
n && (ee(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")));
|
|
1708
1708
|
const o = Array.from(t.querySelectorAll("swal-input-option"));
|
|
1709
1709
|
return o.length && (e.inputOptions = {}, o.forEach((s) => {
|
|
1710
1710
|
ee(s, ["value"]);
|
|
1711
|
-
const
|
|
1712
|
-
if (!
|
|
1711
|
+
const r = s.getAttribute("value");
|
|
1712
|
+
if (!r)
|
|
1713
1713
|
return;
|
|
1714
|
-
const
|
|
1715
|
-
e.inputOptions[
|
|
1714
|
+
const d = s.innerHTML;
|
|
1715
|
+
e.inputOptions[r] = d;
|
|
1716
1716
|
})), e;
|
|
1717
|
-
},
|
|
1717
|
+
}, pr = (t, e) => {
|
|
1718
1718
|
const n = {};
|
|
1719
1719
|
for (const o in e) {
|
|
1720
|
-
const s = e[o],
|
|
1721
|
-
|
|
1720
|
+
const s = e[o], r = t.querySelector(s);
|
|
1721
|
+
r && (ee(r, []), n[s.replace(/^swal-/, "")] = r.innerHTML.trim());
|
|
1722
1722
|
}
|
|
1723
1723
|
return n;
|
|
1724
|
-
},
|
|
1725
|
-
const e =
|
|
1724
|
+
}, gr = (t) => {
|
|
1725
|
+
const e = Ln.concat(["swal-param", "swal-function-param", "swal-button", "swal-image", "swal-icon", "swal-input", "swal-input-option"]);
|
|
1726
1726
|
Array.from(t.children).forEach((n) => {
|
|
1727
1727
|
const o = n.tagName.toLowerCase();
|
|
1728
1728
|
e.includes(o) || z(`Unrecognized element <${o}>`);
|
|
@@ -1731,40 +1731,40 @@ const xn = ["swal-title", "swal-html", "swal-footer"], oi = (t) => {
|
|
|
1731
1731
|
Array.from(t.attributes).forEach((n) => {
|
|
1732
1732
|
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."}`]);
|
|
1733
1733
|
});
|
|
1734
|
-
},
|
|
1734
|
+
}, Sn = 10, mr = (t) => {
|
|
1735
1735
|
var e, n;
|
|
1736
|
-
const o =
|
|
1736
|
+
const o = j(), s = S();
|
|
1737
1737
|
if (!o || !s)
|
|
1738
1738
|
return;
|
|
1739
1739
|
typeof t.willOpen == "function" && t.willOpen(s), (e = p.eventEmitter) === null || e === void 0 || e.emit("willOpen", s);
|
|
1740
|
-
const
|
|
1741
|
-
if (
|
|
1742
|
-
|
|
1743
|
-
},
|
|
1740
|
+
const d = window.getComputedStyle(document.body).overflowY;
|
|
1741
|
+
if (vr(o, s, t), setTimeout(() => {
|
|
1742
|
+
br(o, s);
|
|
1743
|
+
}, Sn), rt() && (yr(o, t.scrollbarPadding !== void 0 ? t.scrollbarPadding : !1, d), ts()), !ze() && !p.previousActiveElement && (p.previousActiveElement = document.activeElement), typeof t.didOpen == "function") {
|
|
1744
1744
|
const c = t.didOpen;
|
|
1745
1745
|
setTimeout(() => c(s));
|
|
1746
1746
|
}
|
|
1747
1747
|
(n = p.eventEmitter) === null || n === void 0 || n.emit("didOpen", s);
|
|
1748
|
-
},
|
|
1749
|
-
const e =
|
|
1748
|
+
}, Pe = (t) => {
|
|
1749
|
+
const e = S();
|
|
1750
1750
|
if (!e || t.target !== e)
|
|
1751
1751
|
return;
|
|
1752
|
-
const n =
|
|
1753
|
-
n && (e.removeEventListener("animationend",
|
|
1754
|
-
},
|
|
1755
|
-
|
|
1756
|
-
},
|
|
1757
|
-
|
|
1752
|
+
const n = j();
|
|
1753
|
+
n && (e.removeEventListener("animationend", Pe), e.removeEventListener("transitionend", Pe), n.style.overflowY = "auto", F(n, a["no-transition"]));
|
|
1754
|
+
}, br = (t, e) => {
|
|
1755
|
+
Vt(e) ? (t.style.overflowY = "hidden", e.addEventListener("animationend", Pe), e.addEventListener("transitionend", Pe)) : t.style.overflowY = "auto";
|
|
1756
|
+
}, yr = (t, e, n) => {
|
|
1757
|
+
ns(), e && n !== "hidden" && cs(n), setTimeout(() => {
|
|
1758
1758
|
t.scrollTop = 0;
|
|
1759
1759
|
});
|
|
1760
|
-
},
|
|
1760
|
+
}, vr = (t, e, n) => {
|
|
1761
1761
|
var o;
|
|
1762
|
-
(o = n.showClass) !== null && o !== void 0 && o.backdrop &&
|
|
1762
|
+
(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(() => {
|
|
1763
1763
|
var s;
|
|
1764
|
-
(s = n.showClass) !== null && s !== void 0 && s.popup &&
|
|
1765
|
-
},
|
|
1764
|
+
(s = n.showClass) !== null && s !== void 0 && s.popup && L(e, n.showClass.popup), e.style.removeProperty("opacity");
|
|
1765
|
+
}, Sn)) : M(e, "grid"), L([document.documentElement, document.body], a.shown), n.heightAuto && n.backdrop && !n.toast && L([document.documentElement, document.body], a["height-auto"]);
|
|
1766
1766
|
};
|
|
1767
|
-
var
|
|
1767
|
+
var St = {
|
|
1768
1768
|
/**
|
|
1769
1769
|
* @param {string} string
|
|
1770
1770
|
* @param {string} [validationMessage]
|
|
@@ -1778,29 +1778,29 @@ var At = {
|
|
|
1778
1778
|
*/
|
|
1779
1779
|
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")
|
|
1780
1780
|
};
|
|
1781
|
-
function
|
|
1782
|
-
t.inputValidator || (t.input === "email" && (t.inputValidator =
|
|
1781
|
+
function Cr(t) {
|
|
1782
|
+
t.inputValidator || (t.input === "email" && (t.inputValidator = St.email), t.input === "url" && (t.inputValidator = St.url));
|
|
1783
1783
|
}
|
|
1784
|
-
function
|
|
1784
|
+
function kr(t) {
|
|
1785
1785
|
(!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");
|
|
1786
1786
|
}
|
|
1787
|
-
function
|
|
1788
|
-
|
|
1787
|
+
function xr(t) {
|
|
1788
|
+
Cr(t), t.showLoaderOnConfirm && !t.preConfirm && z(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
|
1789
1789
|
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
1790
|
-
https://sweetalert2.github.io/#ajax-request`),
|
|
1791
|
-
`).join("<br />")),
|
|
1790
|
+
https://sweetalert2.github.io/#ajax-request`), kr(t), typeof t.title == "string" && (t.title = t.title.split(`
|
|
1791
|
+
`).join("<br />")), wo(t);
|
|
1792
1792
|
}
|
|
1793
1793
|
let q;
|
|
1794
|
-
var
|
|
1794
|
+
var xe = /* @__PURE__ */ new WeakMap();
|
|
1795
1795
|
class P {
|
|
1796
1796
|
/**
|
|
1797
1797
|
* @param {...(SweetAlertOptions | string)} args
|
|
1798
1798
|
* @this {SweetAlert}
|
|
1799
1799
|
*/
|
|
1800
1800
|
constructor(...e) {
|
|
1801
|
-
if (
|
|
1801
|
+
if (Rn(
|
|
1802
1802
|
this,
|
|
1803
|
-
|
|
1803
|
+
xe,
|
|
1804
1804
|
/** @type {Promise<SweetAlertResult>} */
|
|
1805
1805
|
Promise.resolve({
|
|
1806
1806
|
isConfirmed: !1,
|
|
@@ -1811,81 +1811,81 @@ class P {
|
|
|
1811
1811
|
return;
|
|
1812
1812
|
q = this;
|
|
1813
1813
|
const n = Object.freeze(this.constructor.argsToParams(e));
|
|
1814
|
-
this.params = n, this.isAwaitingPromise = !1,
|
|
1814
|
+
this.params = n, this.isAwaitingPromise = !1, Fn(xe, this, this._main(q.params));
|
|
1815
1815
|
}
|
|
1816
1816
|
/**
|
|
1817
1817
|
* @param {any} userParams
|
|
1818
1818
|
* @param {any} mixinParams
|
|
1819
1819
|
*/
|
|
1820
1820
|
_main(e, n = {}) {
|
|
1821
|
-
if (
|
|
1822
|
-
const
|
|
1823
|
-
isAwaitingPromise:
|
|
1821
|
+
if (vn(Object.assign({}, n, e)), p.currentInstance) {
|
|
1822
|
+
const r = re.swalPromiseResolve.get(p.currentInstance), {
|
|
1823
|
+
isAwaitingPromise: d
|
|
1824
1824
|
} = p.currentInstance;
|
|
1825
|
-
p.currentInstance._destroy(),
|
|
1825
|
+
p.currentInstance._destroy(), d || r({
|
|
1826
1826
|
isDismissed: !0
|
|
1827
|
-
}),
|
|
1827
|
+
}), rt() && en();
|
|
1828
1828
|
}
|
|
1829
1829
|
p.currentInstance = q;
|
|
1830
|
-
const o =
|
|
1831
|
-
|
|
1832
|
-
const s =
|
|
1833
|
-
return
|
|
1830
|
+
const o = Er(e, n);
|
|
1831
|
+
xr(o), Object.freeze(o), p.timeout && (p.timeout.stop(), delete p.timeout), clearTimeout(p.restoreFocusTimeout);
|
|
1832
|
+
const s = Lr(q);
|
|
1833
|
+
return Zt(q, o), _.innerParams.set(q, o), Ar(q, s, o);
|
|
1834
1834
|
}
|
|
1835
1835
|
// `catch` cannot be the name of a module export, so we define our thenable methods here instead
|
|
1836
1836
|
/**
|
|
1837
1837
|
* @param {any} onFulfilled
|
|
1838
1838
|
*/
|
|
1839
1839
|
then(e) {
|
|
1840
|
-
return
|
|
1840
|
+
return mt(xe, this).then(e);
|
|
1841
1841
|
}
|
|
1842
1842
|
/**
|
|
1843
1843
|
* @param {any} onFinally
|
|
1844
1844
|
*/
|
|
1845
1845
|
finally(e) {
|
|
1846
|
-
return
|
|
1846
|
+
return mt(xe, this).finally(e);
|
|
1847
1847
|
}
|
|
1848
1848
|
}
|
|
1849
|
-
const
|
|
1850
|
-
const
|
|
1849
|
+
const Ar = (t, e, n) => new Promise((o, s) => {
|
|
1850
|
+
const r = (d) => {
|
|
1851
1851
|
t.close({
|
|
1852
1852
|
isDismissed: !0,
|
|
1853
|
-
dismiss:
|
|
1853
|
+
dismiss: d,
|
|
1854
1854
|
isConfirmed: !1,
|
|
1855
1855
|
isDenied: !1
|
|
1856
1856
|
});
|
|
1857
1857
|
};
|
|
1858
|
-
|
|
1859
|
-
|
|
1858
|
+
re.swalPromiseResolve.set(t, o), re.swalPromiseReject.set(t, s), e.confirmButton.onclick = () => {
|
|
1859
|
+
Ls(t);
|
|
1860
1860
|
}, e.denyButton.onclick = () => {
|
|
1861
|
-
|
|
1861
|
+
Ss(t);
|
|
1862
1862
|
}, e.cancelButton.onclick = () => {
|
|
1863
|
-
|
|
1863
|
+
Ts(t, r);
|
|
1864
1864
|
}, e.closeButton.onclick = () => {
|
|
1865
|
-
|
|
1866
|
-
},
|
|
1865
|
+
r(de.close);
|
|
1866
|
+
}, Us(n, e, r), Wo(p, n, r), ms(t, n), mr(n), Sr(p, n, r), Tr(e, n), setTimeout(() => {
|
|
1867
1867
|
e.container.scrollTop = 0;
|
|
1868
1868
|
});
|
|
1869
|
-
}),
|
|
1870
|
-
const n =
|
|
1869
|
+
}), Er = (t, e) => {
|
|
1870
|
+
const n = lr(t), o = Object.assign({}, Z, e, n, t);
|
|
1871
1871
|
return o.showClass = Object.assign({}, Z.showClass, o.showClass), o.hideClass = Object.assign({}, Z.hideClass, o.hideClass), o.animation === !1 && (o.showClass = {
|
|
1872
1872
|
backdrop: "swal2-noanimation"
|
|
1873
1873
|
}, o.hideClass = {}), o;
|
|
1874
|
-
},
|
|
1874
|
+
}, Lr = (t) => {
|
|
1875
1875
|
const e = (
|
|
1876
1876
|
/** @type {DomCache} */
|
|
1877
1877
|
{
|
|
1878
1878
|
popup: (
|
|
1879
1879
|
/** @type {HTMLElement} */
|
|
1880
|
-
|
|
1880
|
+
S()
|
|
1881
1881
|
),
|
|
1882
1882
|
container: (
|
|
1883
1883
|
/** @type {HTMLElement} */
|
|
1884
|
-
|
|
1884
|
+
j()
|
|
1885
1885
|
),
|
|
1886
1886
|
actions: (
|
|
1887
1887
|
/** @type {HTMLElement} */
|
|
1888
|
-
|
|
1888
|
+
ge()
|
|
1889
1889
|
),
|
|
1890
1890
|
confirmButton: (
|
|
1891
1891
|
/** @type {HTMLElement} */
|
|
@@ -1905,70 +1905,70 @@ const vi = (t, e, n) => new Promise((o, s) => {
|
|
|
1905
1905
|
),
|
|
1906
1906
|
closeButton: (
|
|
1907
1907
|
/** @type {HTMLElement} */
|
|
1908
|
-
|
|
1908
|
+
ot()
|
|
1909
1909
|
),
|
|
1910
1910
|
validationMessage: (
|
|
1911
1911
|
/** @type {HTMLElement} */
|
|
1912
|
-
|
|
1912
|
+
Ne()
|
|
1913
1913
|
),
|
|
1914
1914
|
progressSteps: (
|
|
1915
1915
|
/** @type {HTMLElement} */
|
|
1916
|
-
|
|
1916
|
+
nt()
|
|
1917
1917
|
)
|
|
1918
1918
|
}
|
|
1919
1919
|
);
|
|
1920
|
-
return
|
|
1921
|
-
},
|
|
1922
|
-
const o =
|
|
1923
|
-
O(o), e.timer && (t.timeout = new
|
|
1920
|
+
return _.domCache.set(t, e), e;
|
|
1921
|
+
}, Sr = (t, e, n) => {
|
|
1922
|
+
const o = Oe();
|
|
1923
|
+
O(o), e.timer && (t.timeout = new ar(() => {
|
|
1924
1924
|
n("timer"), delete t.timeout;
|
|
1925
|
-
}, e.timer), e.timerProgressBar && o && (M(o),
|
|
1926
|
-
t.timeout && t.timeout.running &&
|
|
1925
|
+
}, e.timer), e.timerProgressBar && o && (M(o), U(o, e, "timerProgressBar"), setTimeout(() => {
|
|
1926
|
+
t.timeout && t.timeout.running && at(
|
|
1927
1927
|
/** @type {number} */
|
|
1928
1928
|
e.timer
|
|
1929
1929
|
);
|
|
1930
1930
|
})));
|
|
1931
|
-
},
|
|
1931
|
+
}, Tr = (t, e) => {
|
|
1932
1932
|
if (!e.toast) {
|
|
1933
|
-
if (!
|
|
1934
|
-
|
|
1933
|
+
if (!Me(e.allowEnterKey)) {
|
|
1934
|
+
Ot("allowEnterKey"), Br();
|
|
1935
1935
|
return;
|
|
1936
1936
|
}
|
|
1937
|
-
|
|
1937
|
+
_r(t) || $r(t, e) || Ge(-1, 1);
|
|
1938
1938
|
}
|
|
1939
|
-
},
|
|
1939
|
+
}, _r = (t) => {
|
|
1940
1940
|
const e = Array.from(t.popup.querySelectorAll("[autofocus]"));
|
|
1941
1941
|
for (const n of e)
|
|
1942
|
-
if (n instanceof HTMLElement &&
|
|
1942
|
+
if (n instanceof HTMLElement && D(n))
|
|
1943
1943
|
return n.focus(), !0;
|
|
1944
1944
|
return !1;
|
|
1945
|
-
},
|
|
1945
|
+
}, $r = (t, e) => e.focusDeny && D(t.denyButton) ? (t.denyButton.focus(), !0) : e.focusCancel && D(t.cancelButton) ? (t.cancelButton.focus(), !0) : e.focusConfirm && D(t.confirmButton) ? (t.confirmButton.focus(), !0) : !1, Br = () => {
|
|
1946
1946
|
document.activeElement instanceof HTMLElement && typeof document.activeElement.blur == "function" && document.activeElement.blur();
|
|
1947
1947
|
};
|
|
1948
|
-
P.prototype.disableButtons =
|
|
1949
|
-
P.prototype.enableButtons =
|
|
1950
|
-
P.prototype.getInput =
|
|
1951
|
-
P.prototype.disableInput =
|
|
1952
|
-
P.prototype.enableInput =
|
|
1953
|
-
P.prototype.hideLoading =
|
|
1954
|
-
P.prototype.disableLoading =
|
|
1955
|
-
P.prototype.showValidationMessage =
|
|
1956
|
-
P.prototype.resetValidationMessage =
|
|
1948
|
+
P.prototype.disableButtons = hn;
|
|
1949
|
+
P.prototype.enableButtons = un;
|
|
1950
|
+
P.prototype.getInput = ln;
|
|
1951
|
+
P.prototype.disableInput = fn;
|
|
1952
|
+
P.prototype.enableInput = wn;
|
|
1953
|
+
P.prototype.hideLoading = Be;
|
|
1954
|
+
P.prototype.disableLoading = Be;
|
|
1955
|
+
P.prototype.showValidationMessage = pn;
|
|
1956
|
+
P.prototype.resetValidationMessage = gn;
|
|
1957
1957
|
P.prototype.close = Y;
|
|
1958
1958
|
P.prototype.closePopup = Y;
|
|
1959
1959
|
P.prototype.closeModal = Y;
|
|
1960
1960
|
P.prototype.closeToast = Y;
|
|
1961
|
-
P.prototype.rejectPromise =
|
|
1962
|
-
P.prototype.update =
|
|
1963
|
-
P.prototype._destroy =
|
|
1964
|
-
Object.assign(P,
|
|
1965
|
-
Object.keys(
|
|
1961
|
+
P.prototype.rejectPromise = on;
|
|
1962
|
+
P.prototype.update = Cn;
|
|
1963
|
+
P.prototype._destroy = kn;
|
|
1964
|
+
Object.assign(P, ir);
|
|
1965
|
+
Object.keys(Ds).forEach((t) => {
|
|
1966
1966
|
P[t] = function(...e) {
|
|
1967
1967
|
if (q && q[t])
|
|
1968
1968
|
return q[t](...e);
|
|
1969
1969
|
};
|
|
1970
1970
|
});
|
|
1971
|
-
P.DismissReason =
|
|
1971
|
+
P.DismissReason = de;
|
|
1972
1972
|
P.version = "11.26.18";
|
|
1973
1973
|
const N = P;
|
|
1974
1974
|
N.default = N;
|
|
@@ -1981,8 +1981,8 @@ typeof document < "u" && (function(t, e) {
|
|
|
1981
1981
|
n.innerText = e;
|
|
1982
1982
|
}
|
|
1983
1983
|
})(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}}');
|
|
1984
|
-
|
|
1985
|
-
class
|
|
1984
|
+
Xe.create();
|
|
1985
|
+
class Ir {
|
|
1986
1986
|
constructor() {
|
|
1987
1987
|
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);
|
|
1988
1988
|
}
|
|
@@ -2007,13 +2007,13 @@ class Si {
|
|
|
2007
2007
|
return;
|
|
2008
2008
|
}
|
|
2009
2009
|
try {
|
|
2010
|
-
const n = await
|
|
2010
|
+
const n = await zn({
|
|
2011
2011
|
baseUrl: this.baseUrl,
|
|
2012
2012
|
appCode: this.appCode,
|
|
2013
2013
|
token: this.token
|
|
2014
2014
|
});
|
|
2015
2015
|
if (n.data && n.data.result === 0) {
|
|
2016
|
-
const o =
|
|
2016
|
+
const o = T.get(n.data, "retVal", []);
|
|
2017
2017
|
this.languages = o.map((s) => ({
|
|
2018
2018
|
langCode: s.language || s.langCode || s,
|
|
2019
2019
|
langName: s.langName || s.language || s
|
|
@@ -2068,11 +2068,11 @@ class Si {
|
|
|
2068
2068
|
let s;
|
|
2069
2069
|
for (; s = n.nextNode(); )
|
|
2070
2070
|
o.push(s);
|
|
2071
|
-
o.forEach((
|
|
2072
|
-
const
|
|
2073
|
-
if (!
|
|
2074
|
-
const c = this.findKeyByValue(
|
|
2075
|
-
c ? this.wrapTextNode(
|
|
2071
|
+
o.forEach((r) => {
|
|
2072
|
+
const d = r.textContent;
|
|
2073
|
+
if (!d || !d.trim()) return;
|
|
2074
|
+
const c = this.findKeyByValue(d.trim());
|
|
2075
|
+
c ? this.wrapTextNode(r, c) : this.wrapPartialTextNode(r);
|
|
2076
2076
|
});
|
|
2077
2077
|
}
|
|
2078
2078
|
/**
|
|
@@ -2084,15 +2084,15 @@ class Si {
|
|
|
2084
2084
|
if (!n) return;
|
|
2085
2085
|
const o = [];
|
|
2086
2086
|
if (globalThis.__I18N_KEY_VALUE_MAP__)
|
|
2087
|
-
for (const [s,
|
|
2087
|
+
for (const [s, r] of Object.entries(
|
|
2088
2088
|
globalThis.__I18N_KEY_VALUE_MAP__
|
|
2089
2089
|
))
|
|
2090
2090
|
n.includes(s) && o.push({
|
|
2091
2091
|
translatedValue: s,
|
|
2092
|
-
key:
|
|
2092
|
+
key: r,
|
|
2093
2093
|
index: n.indexOf(s)
|
|
2094
2094
|
});
|
|
2095
|
-
o.sort((s,
|
|
2095
|
+
o.sort((s, r) => s.index - r.index), o.length > 0 && this.wrapMultipleTextParts(e, o);
|
|
2096
2096
|
}
|
|
2097
2097
|
/**
|
|
2098
2098
|
* 包装文本节点中的多个部分内容
|
|
@@ -2101,21 +2101,21 @@ class Si {
|
|
|
2101
2101
|
const o = e.parentElement;
|
|
2102
2102
|
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"))
|
|
2103
2103
|
return;
|
|
2104
|
-
const s = e.textContent,
|
|
2105
|
-
let
|
|
2104
|
+
const s = e.textContent, r = document.createDocumentFragment();
|
|
2105
|
+
let d = 0;
|
|
2106
2106
|
if (n.forEach((c) => {
|
|
2107
|
-
const { translatedValue:
|
|
2108
|
-
if (
|
|
2109
|
-
const
|
|
2110
|
-
|
|
2107
|
+
const { translatedValue: i, key: l, index: u } = c;
|
|
2108
|
+
if (u > d) {
|
|
2109
|
+
const w = s.substring(d, u);
|
|
2110
|
+
r.appendChild(document.createTextNode(w));
|
|
2111
2111
|
}
|
|
2112
|
-
const
|
|
2113
|
-
|
|
2114
|
-
}),
|
|
2115
|
-
const c = s.substring(
|
|
2116
|
-
|
|
2112
|
+
const h = document.createElement("span");
|
|
2113
|
+
h.className = "i18n-editable-text i18n-text-overlay", h.setAttribute("data-i18n-key", l), h.textContent = i, r.appendChild(h), this.wrappedElements.add(h), d = u + i.length;
|
|
2114
|
+
}), d < s.length) {
|
|
2115
|
+
const c = s.substring(d);
|
|
2116
|
+
r.appendChild(document.createTextNode(c));
|
|
2117
2117
|
}
|
|
2118
|
-
o.replaceChild(
|
|
2118
|
+
o.replaceChild(r, e);
|
|
2119
2119
|
}
|
|
2120
2120
|
/**
|
|
2121
2121
|
* 根据翻译值查找 key
|
|
@@ -2125,14 +2125,14 @@ class Si {
|
|
|
2125
2125
|
if (!e) return null;
|
|
2126
2126
|
if (globalThis.__I18N_KEY_VALUE_MAP__ && globalThis.__I18N_KEY_VALUE_MAP__[e])
|
|
2127
2127
|
return globalThis.__I18N_KEY_VALUE_MAP__[e];
|
|
2128
|
-
const s = `I18N_MESSAGES_COMMON_${(k.get("I18N_CONFIG") || {}).locale || "zh-CN"}`,
|
|
2129
|
-
for (const [
|
|
2128
|
+
const s = `I18N_MESSAGES_COMMON_${(k.get("I18N_CONFIG") || {}).locale || "zh-CN"}`, r = k.get(s) || {};
|
|
2129
|
+
for (const [i, l] of Object.entries(r))
|
|
2130
2130
|
if (l === e)
|
|
2131
|
-
return
|
|
2132
|
-
const
|
|
2133
|
-
for (const [
|
|
2131
|
+
return i;
|
|
2132
|
+
const d = `I18N_MESSAGES_${this.currentLocale}`, c = k.get(d) || {};
|
|
2133
|
+
for (const [i, l] of Object.entries(c))
|
|
2134
2134
|
if (l === e)
|
|
2135
|
-
return
|
|
2135
|
+
return i;
|
|
2136
2136
|
return null;
|
|
2137
2137
|
}
|
|
2138
2138
|
/**
|
|
@@ -2208,12 +2208,12 @@ class Si {
|
|
|
2208
2208
|
type="text"
|
|
2209
2209
|
class="i18n-edit-input"
|
|
2210
2210
|
data-lang="${c.langCode}"
|
|
2211
|
-
value="${this.escapeHtml(
|
|
2211
|
+
value="${this.escapeHtml(T.get(o, c.langCode) || "")}"
|
|
2212
2212
|
placeholder="请输入${c.langName}翻译"
|
|
2213
2213
|
/>
|
|
2214
2214
|
</div>
|
|
2215
2215
|
`
|
|
2216
|
-
).join(""), { value:
|
|
2216
|
+
).join(""), { value: r, isConfirmed: d } = await N.fire({
|
|
2217
2217
|
title: `原值参考:${o["zh-CN_raw"]}`,
|
|
2218
2218
|
html: `
|
|
2219
2219
|
<div class="i18n-edit-form">
|
|
@@ -2232,20 +2232,20 @@ class Si {
|
|
|
2232
2232
|
htmlContainer: "i18n-edit-modal-content"
|
|
2233
2233
|
},
|
|
2234
2234
|
preConfirm: async () => {
|
|
2235
|
-
const c = document.querySelectorAll(".i18n-edit-input"),
|
|
2236
|
-
c.forEach((
|
|
2237
|
-
|
|
2235
|
+
const c = document.querySelectorAll(".i18n-edit-input"), i = {};
|
|
2236
|
+
c.forEach((u) => {
|
|
2237
|
+
i[u.getAttribute("data-lang")] = u.value;
|
|
2238
2238
|
});
|
|
2239
2239
|
const l = document.getElementById("i18n-save-error");
|
|
2240
2240
|
l && (l.style.display = "none", l.textContent = "");
|
|
2241
2241
|
try {
|
|
2242
|
-
return await this.saveTranslations(e,
|
|
2243
|
-
} catch (
|
|
2244
|
-
return l && (l.textContent =
|
|
2242
|
+
return await this.saveTranslations(e, i, n), i;
|
|
2243
|
+
} catch (u) {
|
|
2244
|
+
return l && (l.textContent = u.message || "保存失败,请检查网络连接或权限", l.style.display = "block"), !1;
|
|
2245
2245
|
}
|
|
2246
2246
|
}
|
|
2247
2247
|
});
|
|
2248
|
-
|
|
2248
|
+
d && r && (this.notifyLanguageUpdate(), N.fire({
|
|
2249
2249
|
text: "保存成功",
|
|
2250
2250
|
icon: "success",
|
|
2251
2251
|
timer: 1500,
|
|
@@ -2268,12 +2268,12 @@ class Si {
|
|
|
2268
2268
|
if (!this.appCode)
|
|
2269
2269
|
return [];
|
|
2270
2270
|
try {
|
|
2271
|
-
const o = (k.get("I18N_CONFIG") || {}).routerName || "", s = await
|
|
2271
|
+
const o = (k.get("I18N_CONFIG") || {}).routerName || "", s = await jn({
|
|
2272
2272
|
baseUrl: this.baseUrl,
|
|
2273
2273
|
data: {
|
|
2274
2274
|
appCode: this.appCode,
|
|
2275
2275
|
commaSeparatedKeys: e,
|
|
2276
|
-
commaSeparatedLangs:
|
|
2276
|
+
commaSeparatedLangs: T.map(this.languages, "langCode").toString(),
|
|
2277
2277
|
searchBlur: "",
|
|
2278
2278
|
page: o,
|
|
2279
2279
|
pageSize: 10
|
|
@@ -2281,7 +2281,7 @@ class Si {
|
|
|
2281
2281
|
token: this.token
|
|
2282
2282
|
});
|
|
2283
2283
|
if (s.data && s.data.result === 0)
|
|
2284
|
-
return
|
|
2284
|
+
return T.get(s.data, "retVal.datas", []);
|
|
2285
2285
|
} catch (n) {
|
|
2286
2286
|
console.error("获取翻译数据失败:", n);
|
|
2287
2287
|
}
|
|
@@ -2291,29 +2291,29 @@ class Si {
|
|
|
2291
2291
|
* 保存翻译数据
|
|
2292
2292
|
*/
|
|
2293
2293
|
async saveTranslations(e, n, o) {
|
|
2294
|
-
var
|
|
2295
|
-
const s = o[0], { page:
|
|
2294
|
+
var i;
|
|
2295
|
+
const s = o[0], { page: r } = s;
|
|
2296
2296
|
console.log(n);
|
|
2297
|
-
const
|
|
2298
|
-
|
|
2299
|
-
|
|
2297
|
+
const d = [];
|
|
2298
|
+
T.map(n, (l, u) => {
|
|
2299
|
+
d.push({
|
|
2300
2300
|
appCode: this.appCode,
|
|
2301
|
-
page:
|
|
2301
|
+
page: r,
|
|
2302
2302
|
key: e,
|
|
2303
2303
|
unitCode: this.unitCode,
|
|
2304
|
-
lang:
|
|
2304
|
+
lang: u,
|
|
2305
2305
|
value: l,
|
|
2306
2306
|
fromAi: "F"
|
|
2307
2307
|
});
|
|
2308
2308
|
});
|
|
2309
|
-
const c = await
|
|
2310
|
-
data: { data:
|
|
2309
|
+
const c = await Dn({
|
|
2310
|
+
data: { data: d, isLocal: "F" },
|
|
2311
2311
|
token: this.token,
|
|
2312
2312
|
baseUrl: this.baseUrl
|
|
2313
2313
|
});
|
|
2314
2314
|
if (c.data && c.data.result === 0)
|
|
2315
2315
|
return !0;
|
|
2316
|
-
throw new Error(((
|
|
2316
|
+
throw new Error(((i = c.data) == null ? void 0 : i.message) || "保存失败");
|
|
2317
2317
|
}
|
|
2318
2318
|
/**
|
|
2319
2319
|
* HTML 转义
|
|
@@ -2342,28 +2342,28 @@ class Si {
|
|
|
2342
2342
|
});
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
2345
|
-
const
|
|
2346
|
-
function
|
|
2345
|
+
const Pr = new Ir();
|
|
2346
|
+
function Mr(t) {
|
|
2347
2347
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
2348
2348
|
}
|
|
2349
|
-
var
|
|
2350
|
-
function
|
|
2351
|
-
return
|
|
2349
|
+
var Re = { exports: {} }, Tt;
|
|
2350
|
+
function Nr() {
|
|
2351
|
+
return Tt || (Tt = 1, (function(t) {
|
|
2352
2352
|
var e = (function() {
|
|
2353
|
-
var n = String.fromCharCode, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",
|
|
2354
|
-
function
|
|
2355
|
-
if (!i
|
|
2356
|
-
i
|
|
2357
|
-
for (var
|
|
2358
|
-
i
|
|
2353
|
+
var n = String.fromCharCode, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$", r = {};
|
|
2354
|
+
function d(i, l) {
|
|
2355
|
+
if (!r[i]) {
|
|
2356
|
+
r[i] = {};
|
|
2357
|
+
for (var u = 0; u < i.length; u++)
|
|
2358
|
+
r[i][i.charAt(u)] = u;
|
|
2359
2359
|
}
|
|
2360
|
-
return i
|
|
2360
|
+
return r[i][l];
|
|
2361
2361
|
}
|
|
2362
2362
|
var c = {
|
|
2363
|
-
compressToBase64: function(
|
|
2364
|
-
if (
|
|
2365
|
-
var l = c._compress(
|
|
2366
|
-
return o.charAt(
|
|
2363
|
+
compressToBase64: function(i) {
|
|
2364
|
+
if (i == null) return "";
|
|
2365
|
+
var l = c._compress(i, 6, function(u) {
|
|
2366
|
+
return o.charAt(u);
|
|
2367
2367
|
});
|
|
2368
2368
|
switch (l.length % 4) {
|
|
2369
2369
|
// To produce valid Base64
|
|
@@ -2379,161 +2379,161 @@ function $i() {
|
|
|
2379
2379
|
return l + "=";
|
|
2380
2380
|
}
|
|
2381
2381
|
},
|
|
2382
|
-
decompressFromBase64: function(
|
|
2383
|
-
return
|
|
2384
|
-
return
|
|
2382
|
+
decompressFromBase64: function(i) {
|
|
2383
|
+
return i == null ? "" : i == "" ? null : c._decompress(i.length, 32, function(l) {
|
|
2384
|
+
return d(o, i.charAt(l));
|
|
2385
2385
|
});
|
|
2386
2386
|
},
|
|
2387
|
-
compressToUTF16: function(
|
|
2388
|
-
return
|
|
2387
|
+
compressToUTF16: function(i) {
|
|
2388
|
+
return i == null ? "" : c._compress(i, 15, function(l) {
|
|
2389
2389
|
return n(l + 32);
|
|
2390
2390
|
}) + " ";
|
|
2391
2391
|
},
|
|
2392
|
-
decompressFromUTF16: function(
|
|
2393
|
-
return
|
|
2394
|
-
return
|
|
2392
|
+
decompressFromUTF16: function(i) {
|
|
2393
|
+
return i == null ? "" : i == "" ? null : c._decompress(i.length, 16384, function(l) {
|
|
2394
|
+
return i.charCodeAt(l) - 32;
|
|
2395
2395
|
});
|
|
2396
2396
|
},
|
|
2397
2397
|
//compress into uint8array (UCS-2 big endian format)
|
|
2398
|
-
compressToUint8Array: function(
|
|
2399
|
-
for (var l = c.compress(
|
|
2400
|
-
var x = l.charCodeAt(
|
|
2401
|
-
|
|
2398
|
+
compressToUint8Array: function(i) {
|
|
2399
|
+
for (var l = c.compress(i), u = new Uint8Array(l.length * 2), h = 0, w = l.length; h < w; h++) {
|
|
2400
|
+
var x = l.charCodeAt(h);
|
|
2401
|
+
u[h * 2] = x >>> 8, u[h * 2 + 1] = x % 256;
|
|
2402
2402
|
}
|
|
2403
|
-
return
|
|
2403
|
+
return u;
|
|
2404
2404
|
},
|
|
2405
2405
|
//decompress from uint8array (UCS-2 big endian format)
|
|
2406
|
-
decompressFromUint8Array: function(
|
|
2407
|
-
if (
|
|
2408
|
-
return c.decompress(
|
|
2409
|
-
for (var l = new Array(
|
|
2410
|
-
l[
|
|
2411
|
-
var
|
|
2406
|
+
decompressFromUint8Array: function(i) {
|
|
2407
|
+
if (i == null)
|
|
2408
|
+
return c.decompress(i);
|
|
2409
|
+
for (var l = new Array(i.length / 2), u = 0, h = l.length; u < h; u++)
|
|
2410
|
+
l[u] = i[u * 2] * 256 + i[u * 2 + 1];
|
|
2411
|
+
var w = [];
|
|
2412
2412
|
return l.forEach(function(x) {
|
|
2413
|
-
|
|
2414
|
-
}), c.decompress(
|
|
2413
|
+
w.push(n(x));
|
|
2414
|
+
}), c.decompress(w.join(""));
|
|
2415
2415
|
},
|
|
2416
2416
|
//compress into a string that is already URI encoded
|
|
2417
|
-
compressToEncodedURIComponent: function(
|
|
2418
|
-
return
|
|
2417
|
+
compressToEncodedURIComponent: function(i) {
|
|
2418
|
+
return i == null ? "" : c._compress(i, 6, function(l) {
|
|
2419
2419
|
return s.charAt(l);
|
|
2420
2420
|
});
|
|
2421
2421
|
},
|
|
2422
2422
|
//decompress from an output of compressToEncodedURIComponent
|
|
2423
|
-
decompressFromEncodedURIComponent: function(
|
|
2424
|
-
return
|
|
2425
|
-
return
|
|
2423
|
+
decompressFromEncodedURIComponent: function(i) {
|
|
2424
|
+
return i == null ? "" : i == "" ? null : (i = i.replace(/ /g, "+"), c._decompress(i.length, 32, function(l) {
|
|
2425
|
+
return d(s, i.charAt(l));
|
|
2426
2426
|
}));
|
|
2427
2427
|
},
|
|
2428
|
-
compress: function(
|
|
2429
|
-
return c._compress(
|
|
2428
|
+
compress: function(i) {
|
|
2429
|
+
return c._compress(i, 16, function(l) {
|
|
2430
2430
|
return n(l);
|
|
2431
2431
|
});
|
|
2432
2432
|
},
|
|
2433
|
-
_compress: function(
|
|
2434
|
-
if (
|
|
2435
|
-
var
|
|
2436
|
-
for (m = 0; m <
|
|
2437
|
-
if (
|
|
2438
|
-
|
|
2433
|
+
_compress: function(i, l, u) {
|
|
2434
|
+
if (i == null) return "";
|
|
2435
|
+
var h, w, x = {}, A = {}, $ = "", B = "", E = "", b = 2, v = 3, y = 2, C = [], f = 0, g = 0, m;
|
|
2436
|
+
for (m = 0; m < i.length; m += 1)
|
|
2437
|
+
if ($ = i.charAt(m), Object.prototype.hasOwnProperty.call(x, $) || (x[$] = v++, A[$] = !0), B = E + $, Object.prototype.hasOwnProperty.call(x, B))
|
|
2438
|
+
E = B;
|
|
2439
2439
|
else {
|
|
2440
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2441
|
-
if (
|
|
2442
|
-
for (
|
|
2443
|
-
|
|
2444
|
-
for (
|
|
2445
|
-
|
|
2440
|
+
if (Object.prototype.hasOwnProperty.call(A, E)) {
|
|
2441
|
+
if (E.charCodeAt(0) < 256) {
|
|
2442
|
+
for (h = 0; h < y; h++)
|
|
2443
|
+
f = f << 1, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++;
|
|
2444
|
+
for (w = E.charCodeAt(0), h = 0; h < 8; h++)
|
|
2445
|
+
f = f << 1 | w & 1, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++, w = w >> 1;
|
|
2446
2446
|
} else {
|
|
2447
|
-
for (
|
|
2448
|
-
|
|
2449
|
-
for (
|
|
2450
|
-
|
|
2447
|
+
for (w = 1, h = 0; h < y; h++)
|
|
2448
|
+
f = f << 1 | w, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++, w = 0;
|
|
2449
|
+
for (w = E.charCodeAt(0), h = 0; h < 16; h++)
|
|
2450
|
+
f = f << 1 | w & 1, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++, w = w >> 1;
|
|
2451
2451
|
}
|
|
2452
|
-
b--, b == 0 && (b = Math.pow(2, y), y++), delete
|
|
2452
|
+
b--, b == 0 && (b = Math.pow(2, y), y++), delete A[E];
|
|
2453
2453
|
} else
|
|
2454
|
-
for (
|
|
2455
|
-
|
|
2456
|
-
b--, b == 0 && (b = Math.pow(2, y), y++), x[
|
|
2454
|
+
for (w = x[E], h = 0; h < y; h++)
|
|
2455
|
+
f = f << 1 | w & 1, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++, w = w >> 1;
|
|
2456
|
+
b--, b == 0 && (b = Math.pow(2, y), y++), x[B] = v++, E = String($);
|
|
2457
2457
|
}
|
|
2458
|
-
if (
|
|
2459
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2460
|
-
if (
|
|
2461
|
-
for (
|
|
2462
|
-
|
|
2463
|
-
for (
|
|
2464
|
-
|
|
2458
|
+
if (E !== "") {
|
|
2459
|
+
if (Object.prototype.hasOwnProperty.call(A, E)) {
|
|
2460
|
+
if (E.charCodeAt(0) < 256) {
|
|
2461
|
+
for (h = 0; h < y; h++)
|
|
2462
|
+
f = f << 1, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++;
|
|
2463
|
+
for (w = E.charCodeAt(0), h = 0; h < 8; h++)
|
|
2464
|
+
f = f << 1 | w & 1, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++, w = w >> 1;
|
|
2465
2465
|
} else {
|
|
2466
|
-
for (
|
|
2467
|
-
|
|
2468
|
-
for (
|
|
2469
|
-
|
|
2466
|
+
for (w = 1, h = 0; h < y; h++)
|
|
2467
|
+
f = f << 1 | w, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++, w = 0;
|
|
2468
|
+
for (w = E.charCodeAt(0), h = 0; h < 16; h++)
|
|
2469
|
+
f = f << 1 | w & 1, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++, w = w >> 1;
|
|
2470
2470
|
}
|
|
2471
|
-
b--, b == 0 && (b = Math.pow(2, y), y++), delete
|
|
2471
|
+
b--, b == 0 && (b = Math.pow(2, y), y++), delete A[E];
|
|
2472
2472
|
} else
|
|
2473
|
-
for (
|
|
2474
|
-
|
|
2473
|
+
for (w = x[E], h = 0; h < y; h++)
|
|
2474
|
+
f = f << 1 | w & 1, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++, w = w >> 1;
|
|
2475
2475
|
b--, b == 0 && (b = Math.pow(2, y), y++);
|
|
2476
2476
|
}
|
|
2477
|
-
for (
|
|
2478
|
-
|
|
2477
|
+
for (w = 2, h = 0; h < y; h++)
|
|
2478
|
+
f = f << 1 | w & 1, g == l - 1 ? (g = 0, C.push(u(f)), f = 0) : g++, w = w >> 1;
|
|
2479
2479
|
for (; ; )
|
|
2480
|
-
if (
|
|
2481
|
-
C.push(f
|
|
2480
|
+
if (f = f << 1, g == l - 1) {
|
|
2481
|
+
C.push(u(f));
|
|
2482
2482
|
break;
|
|
2483
2483
|
} else g++;
|
|
2484
2484
|
return C.join("");
|
|
2485
2485
|
},
|
|
2486
|
-
decompress: function(
|
|
2487
|
-
return
|
|
2488
|
-
return
|
|
2486
|
+
decompress: function(i) {
|
|
2487
|
+
return i == null ? "" : i == "" ? null : c._decompress(i.length, 32768, function(l) {
|
|
2488
|
+
return i.charCodeAt(l);
|
|
2489
2489
|
});
|
|
2490
2490
|
},
|
|
2491
|
-
_decompress: function(
|
|
2492
|
-
var
|
|
2493
|
-
for (
|
|
2494
|
-
|
|
2495
|
-
for (v = 0, C = Math.pow(2, 2),
|
|
2496
|
-
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val =
|
|
2491
|
+
_decompress: function(i, l, u) {
|
|
2492
|
+
var h = [], w = 4, x = 4, A = 3, $ = "", B = [], E, b, v, y, C, f, g, m = { val: u(0), position: l, index: 1 };
|
|
2493
|
+
for (E = 0; E < 3; E += 1)
|
|
2494
|
+
h[E] = E;
|
|
2495
|
+
for (v = 0, C = Math.pow(2, 2), f = 1; f != C; )
|
|
2496
|
+
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val = u(m.index++)), v |= (y > 0 ? 1 : 0) * f, f <<= 1;
|
|
2497
2497
|
switch (v) {
|
|
2498
2498
|
case 0:
|
|
2499
|
-
for (v = 0, C = Math.pow(2, 8),
|
|
2500
|
-
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val =
|
|
2499
|
+
for (v = 0, C = Math.pow(2, 8), f = 1; f != C; )
|
|
2500
|
+
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val = u(m.index++)), v |= (y > 0 ? 1 : 0) * f, f <<= 1;
|
|
2501
2501
|
g = n(v);
|
|
2502
2502
|
break;
|
|
2503
2503
|
case 1:
|
|
2504
|
-
for (v = 0, C = Math.pow(2, 16),
|
|
2505
|
-
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val =
|
|
2504
|
+
for (v = 0, C = Math.pow(2, 16), f = 1; f != C; )
|
|
2505
|
+
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val = u(m.index++)), v |= (y > 0 ? 1 : 0) * f, f <<= 1;
|
|
2506
2506
|
g = n(v);
|
|
2507
2507
|
break;
|
|
2508
2508
|
case 2:
|
|
2509
2509
|
return "";
|
|
2510
2510
|
}
|
|
2511
|
-
for (
|
|
2512
|
-
if (m.index >
|
|
2511
|
+
for (h[3] = g, b = g, B.push(g); ; ) {
|
|
2512
|
+
if (m.index > i)
|
|
2513
2513
|
return "";
|
|
2514
|
-
for (v = 0, C = Math.pow(2,
|
|
2515
|
-
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val =
|
|
2514
|
+
for (v = 0, C = Math.pow(2, A), f = 1; f != C; )
|
|
2515
|
+
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val = u(m.index++)), v |= (y > 0 ? 1 : 0) * f, f <<= 1;
|
|
2516
2516
|
switch (g = v) {
|
|
2517
2517
|
case 0:
|
|
2518
|
-
for (v = 0, C = Math.pow(2, 8),
|
|
2519
|
-
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val =
|
|
2520
|
-
|
|
2518
|
+
for (v = 0, C = Math.pow(2, 8), f = 1; f != C; )
|
|
2519
|
+
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val = u(m.index++)), v |= (y > 0 ? 1 : 0) * f, f <<= 1;
|
|
2520
|
+
h[x++] = n(v), g = x - 1, w--;
|
|
2521
2521
|
break;
|
|
2522
2522
|
case 1:
|
|
2523
|
-
for (v = 0, C = Math.pow(2, 16),
|
|
2524
|
-
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val =
|
|
2525
|
-
|
|
2523
|
+
for (v = 0, C = Math.pow(2, 16), f = 1; f != C; )
|
|
2524
|
+
y = m.val & m.position, m.position >>= 1, m.position == 0 && (m.position = l, m.val = u(m.index++)), v |= (y > 0 ? 1 : 0) * f, f <<= 1;
|
|
2525
|
+
h[x++] = n(v), g = x - 1, w--;
|
|
2526
2526
|
break;
|
|
2527
2527
|
case 2:
|
|
2528
|
-
return
|
|
2528
|
+
return B.join("");
|
|
2529
2529
|
}
|
|
2530
|
-
if (
|
|
2531
|
-
|
|
2530
|
+
if (w == 0 && (w = Math.pow(2, A), A++), h[g])
|
|
2531
|
+
$ = h[g];
|
|
2532
2532
|
else if (g === x)
|
|
2533
|
-
|
|
2533
|
+
$ = b + b.charAt(0);
|
|
2534
2534
|
else
|
|
2535
2535
|
return null;
|
|
2536
|
-
|
|
2536
|
+
B.push($), h[x++] = b + $.charAt(0), w--, b = $, w == 0 && (w = Math.pow(2, A), A++);
|
|
2537
2537
|
}
|
|
2538
2538
|
}
|
|
2539
2539
|
};
|
|
@@ -2542,11 +2542,11 @@ function $i() {
|
|
|
2542
2542
|
t != null ? t.exports = e : typeof angular < "u" && angular != null && angular.module("LZString", []).factory("LZString", function() {
|
|
2543
2543
|
return e;
|
|
2544
2544
|
});
|
|
2545
|
-
})(
|
|
2545
|
+
})(Re)), Re.exports;
|
|
2546
2546
|
}
|
|
2547
|
-
var
|
|
2548
|
-
const
|
|
2549
|
-
function
|
|
2547
|
+
var Or = Nr();
|
|
2548
|
+
const Ae = /* @__PURE__ */ Mr(Or);
|
|
2549
|
+
function Ye(t) {
|
|
2550
2550
|
const e = [], n = /(?:\$t|_ctx\.\$t)\s*\(\s*(['"])([^'"]+?)\1/gs;
|
|
2551
2551
|
if (t.template) {
|
|
2552
2552
|
let o;
|
|
@@ -2568,18 +2568,18 @@ function Ge(t) {
|
|
|
2568
2568
|
if (t.methods)
|
|
2569
2569
|
for (const o in t.methods) {
|
|
2570
2570
|
const s = t.methods[o].toString();
|
|
2571
|
-
let
|
|
2572
|
-
for (; (
|
|
2573
|
-
e.push(
|
|
2571
|
+
let r;
|
|
2572
|
+
for (; (r = n.exec(s)) !== null; )
|
|
2573
|
+
e.push(r[2]);
|
|
2574
2574
|
}
|
|
2575
2575
|
if (t.components)
|
|
2576
2576
|
for (const o in t.components) {
|
|
2577
2577
|
const s = t.components[o];
|
|
2578
|
-
e.push(...
|
|
2578
|
+
e.push(...Ye(s));
|
|
2579
2579
|
}
|
|
2580
2580
|
return [...new Set(e)];
|
|
2581
2581
|
}
|
|
2582
|
-
const
|
|
2582
|
+
const _t = {
|
|
2583
2583
|
name: "Earth",
|
|
2584
2584
|
props: {
|
|
2585
2585
|
editable: {
|
|
@@ -2619,35 +2619,35 @@ const St = {
|
|
|
2619
2619
|
},
|
|
2620
2620
|
emits: ["update:modelValue"],
|
|
2621
2621
|
setup(t, { emit: e }) {
|
|
2622
|
-
const n = oe("zh-CN"), o = oe(""), s = oe(""),
|
|
2622
|
+
const n = oe("zh-CN"), o = oe(""), s = oe(""), r = oe([]), d = () => {
|
|
2623
2623
|
const b = k.get("I18N_CONFIG") || {};
|
|
2624
2624
|
o.value = b.appCode || "", s.value = b.token || (k.get("I18N_CONFIG") || {}).token || "", n.value = k.get("I18N_LANGUAGE") || b.locale || "zh-CN";
|
|
2625
2625
|
}, c = async () => {
|
|
2626
2626
|
if (t.languages && t.languages.length > 0) {
|
|
2627
|
-
|
|
2627
|
+
r.value = t.languages;
|
|
2628
2628
|
return;
|
|
2629
2629
|
}
|
|
2630
|
-
const b = await
|
|
2630
|
+
const b = await It({
|
|
2631
2631
|
baseUrl: t.baseUrl,
|
|
2632
2632
|
token: s.value,
|
|
2633
2633
|
appCode: o.value
|
|
2634
2634
|
});
|
|
2635
|
-
|
|
2636
|
-
},
|
|
2635
|
+
r.value = b;
|
|
2636
|
+
}, i = De(() => {
|
|
2637
2637
|
const b = {};
|
|
2638
2638
|
return !t.modelValue || !Array.isArray(t.modelValue) || t.modelValue.forEach((v) => {
|
|
2639
2639
|
v && typeof v == "object" && Object.keys(v).forEach((y) => {
|
|
2640
2640
|
b[y] = v[y];
|
|
2641
2641
|
});
|
|
2642
2642
|
}), b;
|
|
2643
|
-
}), l =
|
|
2643
|
+
}), l = De(() => i.value[n.value] || ""), u = De(() => Object.keys(i.value).filter((v) => v !== n.value).map((v) => ({
|
|
2644
2644
|
lang: v,
|
|
2645
|
-
value:
|
|
2646
|
-
}))),
|
|
2645
|
+
value: i.value[v]
|
|
2646
|
+
}))), h = (b) => {
|
|
2647
2647
|
if (!b) return "";
|
|
2648
2648
|
const v = document.createElement("div");
|
|
2649
2649
|
return v.textContent = b, v.innerHTML;
|
|
2650
|
-
},
|
|
2650
|
+
}, w = (b) => {
|
|
2651
2651
|
b.data && b.data.type === "updateLanguage" && (n.value = k.get("I18N_LANGUAGE") || "zh-CN");
|
|
2652
2652
|
}, x = () => {
|
|
2653
2653
|
if (typeof window > "u") return;
|
|
@@ -2663,13 +2663,13 @@ const St = {
|
|
|
2663
2663
|
Array.from(new Set(y)).forEach((C) => {
|
|
2664
2664
|
C.postMessage(b, v);
|
|
2665
2665
|
});
|
|
2666
|
-
},
|
|
2666
|
+
}, A = () => {
|
|
2667
2667
|
window.addEventListener("storage", (b) => {
|
|
2668
2668
|
b.key === "I18N_LANGUAGE" && (n.value = b.newValue || "zh-CN");
|
|
2669
2669
|
});
|
|
2670
|
-
},
|
|
2671
|
-
|
|
2672
|
-
const b =
|
|
2670
|
+
}, $ = async () => {
|
|
2671
|
+
r.value.length === 0 && await c();
|
|
2672
|
+
const b = r.value.map(
|
|
2673
2673
|
(C) => `
|
|
2674
2674
|
<div class="i18n-edit-field">
|
|
2675
2675
|
<label class="i18n-edit-label">${C.langName}:</label>
|
|
@@ -2677,7 +2677,7 @@ const St = {
|
|
|
2677
2677
|
type="text"
|
|
2678
2678
|
class="i18n-edit-input"
|
|
2679
2679
|
data-lang="${C.langCode}"
|
|
2680
|
-
value="${
|
|
2680
|
+
value="${h(i.value[C.langCode] || "")}"
|
|
2681
2681
|
placeholder="请输入${C.langName}"
|
|
2682
2682
|
/>
|
|
2683
2683
|
</div>
|
|
@@ -2701,23 +2701,23 @@ const St = {
|
|
|
2701
2701
|
htmlContainer: "i18n-earth-modal-content"
|
|
2702
2702
|
},
|
|
2703
2703
|
preConfirm: async () => {
|
|
2704
|
-
const C = document.querySelectorAll(".i18n-edit-input"),
|
|
2704
|
+
const C = document.querySelectorAll(".i18n-edit-input"), f = {};
|
|
2705
2705
|
C.forEach((m) => {
|
|
2706
|
-
|
|
2706
|
+
f[m.getAttribute("data-lang")] = m.value;
|
|
2707
2707
|
});
|
|
2708
2708
|
const g = document.getElementById("i18n-save-error");
|
|
2709
2709
|
if (g && (g.style.display = "none", g.textContent = ""), t.request && typeof t.request == "function")
|
|
2710
2710
|
try {
|
|
2711
|
-
return await t.request(
|
|
2711
|
+
return await t.request(f), f;
|
|
2712
2712
|
} catch (m) {
|
|
2713
2713
|
return g && (g.textContent = m.message || "保存失败", g.style.display = "block"), !1;
|
|
2714
2714
|
}
|
|
2715
|
-
return
|
|
2715
|
+
return f;
|
|
2716
2716
|
}
|
|
2717
2717
|
});
|
|
2718
2718
|
if (y && v) {
|
|
2719
|
-
const C = Object.keys(v).map((
|
|
2720
|
-
[
|
|
2719
|
+
const C = Object.keys(v).map((f) => ({
|
|
2720
|
+
[f]: v[f]
|
|
2721
2721
|
}));
|
|
2722
2722
|
e("update:modelValue", C), x(), N.fire({
|
|
2723
2723
|
text: "保存成功",
|
|
@@ -2728,8 +2728,8 @@ const St = {
|
|
|
2728
2728
|
toast: !0
|
|
2729
2729
|
});
|
|
2730
2730
|
}
|
|
2731
|
-
},
|
|
2732
|
-
const b =
|
|
2731
|
+
}, B = () => {
|
|
2732
|
+
const b = u.value;
|
|
2733
2733
|
if (b.length === 0) {
|
|
2734
2734
|
N.fire({
|
|
2735
2735
|
title: "多语言翻译",
|
|
@@ -2769,20 +2769,20 @@ const St = {
|
|
|
2769
2769
|
htmlContainer: "i18n-earth-modal-content"
|
|
2770
2770
|
}
|
|
2771
2771
|
});
|
|
2772
|
-
},
|
|
2773
|
-
t.request && typeof t.request == "function" ?
|
|
2772
|
+
}, E = () => {
|
|
2773
|
+
t.request && typeof t.request == "function" ? $() : B();
|
|
2774
2774
|
};
|
|
2775
|
-
return
|
|
2776
|
-
|
|
2775
|
+
return In(() => {
|
|
2776
|
+
d(), c(), window.addEventListener("message", w), A();
|
|
2777
2777
|
}), {
|
|
2778
2778
|
currentValue: l,
|
|
2779
|
-
openModal:
|
|
2779
|
+
openModal: E
|
|
2780
2780
|
};
|
|
2781
2781
|
},
|
|
2782
2782
|
render() {
|
|
2783
2783
|
const { editable: t, width: e, className: n } = this, o = e !== null ? { width: e + "px" } : {}, s = n ? `earth ${n}` : "earth";
|
|
2784
|
-
return
|
|
2785
|
-
|
|
2784
|
+
return ve("div", { class: s }, [
|
|
2785
|
+
ve("input", {
|
|
2786
2786
|
class: "input",
|
|
2787
2787
|
type: "text",
|
|
2788
2788
|
value: this.currentValue,
|
|
@@ -2791,7 +2791,7 @@ const St = {
|
|
|
2791
2791
|
placeholder: "",
|
|
2792
2792
|
style: o
|
|
2793
2793
|
}),
|
|
2794
|
-
|
|
2794
|
+
ve(
|
|
2795
2795
|
"svg",
|
|
2796
2796
|
{
|
|
2797
2797
|
class: "icon earth-icon",
|
|
@@ -2802,7 +2802,7 @@ const St = {
|
|
|
2802
2802
|
onClick: this.openModal
|
|
2803
2803
|
},
|
|
2804
2804
|
[
|
|
2805
|
-
|
|
2805
|
+
ve("path", {
|
|
2806
2806
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"
|
|
2807
2807
|
})
|
|
2808
2808
|
]
|
|
@@ -2810,62 +2810,105 @@ const St = {
|
|
|
2810
2810
|
]);
|
|
2811
2811
|
}
|
|
2812
2812
|
};
|
|
2813
|
-
function
|
|
2814
|
-
|
|
2813
|
+
function he(t) {
|
|
2814
|
+
if (!t || typeof t != "string") return t;
|
|
2815
|
+
const e = t.toLowerCase();
|
|
2816
|
+
return {
|
|
2817
|
+
"zh-cn": "zh-CN",
|
|
2818
|
+
"zh-tw": "zh-TW",
|
|
2819
|
+
"zh-hk": "zh-HK",
|
|
2820
|
+
"zh-mo": "zh-MO",
|
|
2821
|
+
"en-us": "en-US"
|
|
2822
|
+
}[e] || t;
|
|
2823
|
+
}
|
|
2824
|
+
function Tn(t = {}) {
|
|
2825
|
+
const e = Object.entries(t || {});
|
|
2826
|
+
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(([d, c]) => {
|
|
2827
|
+
const i = he(d);
|
|
2828
|
+
o[i] = o[i] || {}, o[i][s] = c;
|
|
2829
|
+
}), o), {}) : e.reduce((o, [s, r]) => (o[he(s)] = r, o), {});
|
|
2830
|
+
}
|
|
2831
|
+
function $t(t, e) {
|
|
2832
|
+
return t[e] || t[he(e)] || t[String(e || "").toLowerCase()] || {};
|
|
2833
|
+
}
|
|
2834
|
+
function ue(t, e) {
|
|
2835
|
+
if (typeof t != "string" || !e || typeof e != "object" || Array.isArray(e))
|
|
2836
|
+
return t;
|
|
2837
|
+
const n = Object.entries(e);
|
|
2838
|
+
return t.replace(/\\?\$\{\s*([^}]+?)\s*\}/g, (o, s) => {
|
|
2839
|
+
const r = String(s || "").trim(), d = n.find(([i]) => i === r || r === "this." + i || r === "_vm." + i || r === "_ctx." + i || r === "$setup." + i || i === r.replace(/^(?:this|_vm|_ctx|\$setup)\./, ""));
|
|
2840
|
+
if (!d)
|
|
2841
|
+
return o;
|
|
2842
|
+
const c = d[1];
|
|
2843
|
+
return c != null ? String(c) : o;
|
|
2844
|
+
});
|
|
2845
|
+
}
|
|
2846
|
+
function _n(t, e) {
|
|
2847
|
+
return e === void 0 && t && typeof t == "object" && !Array.isArray(t) ? {
|
|
2848
|
+
defaultValue: void 0,
|
|
2849
|
+
values: t
|
|
2850
|
+
} : {
|
|
2851
|
+
defaultValue: t,
|
|
2852
|
+
values: e
|
|
2853
|
+
};
|
|
2854
|
+
}
|
|
2855
|
+
function zr(t) {
|
|
2856
|
+
const { locale: e = "zh-CN", messages: n = {} } = t, o = Tn(n), s = oe(e), r = oe(0), d = wt(), c = Ze() && d && typeof d.observable == "function" ? d.observable({
|
|
2815
2857
|
locale: e,
|
|
2816
2858
|
messageVersion: 0
|
|
2817
|
-
}) : null,
|
|
2818
|
-
s.value =
|
|
2819
|
-
},
|
|
2820
|
-
|
|
2821
|
-
},
|
|
2859
|
+
}) : null, i = () => c ? c.locale : s.value, l = (w) => {
|
|
2860
|
+
s.value = w, c && (c.locale = w);
|
|
2861
|
+
}, u = () => {
|
|
2862
|
+
r.value += 1, c && (c.messageVersion += 1);
|
|
2863
|
+
}, h = {
|
|
2822
2864
|
// 当前语言 (兼容 Vue 3 的 .value 访问)
|
|
2823
2865
|
locale: {
|
|
2824
2866
|
get value() {
|
|
2825
|
-
return
|
|
2867
|
+
return i();
|
|
2826
2868
|
},
|
|
2827
|
-
set value(
|
|
2828
|
-
l(
|
|
2869
|
+
set value(w) {
|
|
2870
|
+
l(w);
|
|
2829
2871
|
}
|
|
2830
2872
|
},
|
|
2831
2873
|
// 翻译函数(支持嵌套 key 的点号访问)
|
|
2832
|
-
t(
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2874
|
+
t(w, x, A) {
|
|
2875
|
+
const $ = _n(x, A);
|
|
2876
|
+
x = $.defaultValue, A = $.values, r.value, c && c.messageVersion;
|
|
2877
|
+
const B = i();
|
|
2878
|
+
if (B === "zh-CN" && !w.startsWith("i.") && !w.startsWith("pro."))
|
|
2879
|
+
return ue(x || w, A);
|
|
2880
|
+
const E = $t(o, B);
|
|
2881
|
+
let b = E[w];
|
|
2882
|
+
return b === void 0 && w.includes(".") && (b = w.split(".").reduce((y, C) => y && typeof y == "object" ? y[C] : void 0, E)), ue(b && typeof b == "string" && b !== w ? b : x || w, A);
|
|
2840
2883
|
},
|
|
2841
2884
|
// 设置某个语言的所有消息
|
|
2842
|
-
setLocaleMessage(
|
|
2843
|
-
return o[
|
|
2885
|
+
setLocaleMessage(w, x) {
|
|
2886
|
+
return o[he(w)] = { ...x }, u(), o[he(w)];
|
|
2844
2887
|
},
|
|
2845
2888
|
// 获取某个语言的消息
|
|
2846
|
-
getLocaleMessage(
|
|
2847
|
-
return o
|
|
2889
|
+
getLocaleMessage(w) {
|
|
2890
|
+
return $t(o, w);
|
|
2848
2891
|
}
|
|
2849
2892
|
};
|
|
2850
|
-
return
|
|
2893
|
+
return h.global = h, h;
|
|
2851
2894
|
}
|
|
2852
|
-
const
|
|
2895
|
+
const $n = Xe.create({
|
|
2853
2896
|
timeout: 8e3
|
|
2854
2897
|
});
|
|
2855
|
-
|
|
2898
|
+
$n.interceptors.request.use((t) => {
|
|
2856
2899
|
const n = (k.get("I18N_CONFIG") || {}).token;
|
|
2857
2900
|
return n && (t.headers.Authorization = `Bearer ${n}`), t;
|
|
2858
2901
|
});
|
|
2859
|
-
function
|
|
2902
|
+
function jr(t) {
|
|
2860
2903
|
const e = {
|
|
2861
2904
|
alg: "HS512"
|
|
2862
2905
|
// 算法
|
|
2863
2906
|
}, n = {
|
|
2864
2907
|
orgCode: t
|
|
2865
2908
|
}, o = JSON.stringify(e), s = JSON.stringify(n);
|
|
2866
|
-
return
|
|
2909
|
+
return Pn.JWS.sign("HS512", o, s, "");
|
|
2867
2910
|
}
|
|
2868
|
-
function
|
|
2911
|
+
function Bt(t) {
|
|
2869
2912
|
if (!t) return "";
|
|
2870
2913
|
const e = String(t);
|
|
2871
2914
|
let n = 0;
|
|
@@ -2873,22 +2916,22 @@ function Tt(t) {
|
|
|
2873
2916
|
n = (n << 5) - n + e.charCodeAt(o), n |= 0;
|
|
2874
2917
|
return `user_${Math.abs(n)}`;
|
|
2875
2918
|
}
|
|
2876
|
-
function
|
|
2919
|
+
function Fe(t, ...e) {
|
|
2877
2920
|
if (typeof t == "function")
|
|
2878
2921
|
return t(...e);
|
|
2879
2922
|
}
|
|
2880
|
-
function
|
|
2923
|
+
function wt(t) {
|
|
2881
2924
|
return t && (t.version || t.prototype || t.config) ? t : R && R.version ? R : R && R.default && R.default.version ? R.default : R && R.Vue && R.Vue.version ? R.Vue : R;
|
|
2882
2925
|
}
|
|
2883
|
-
function
|
|
2926
|
+
function Ze(t) {
|
|
2884
2927
|
if (t && t.config && t.config.globalProperties)
|
|
2885
2928
|
return !1;
|
|
2886
|
-
const e =
|
|
2929
|
+
const e = wt(t), n = e && e.version;
|
|
2887
2930
|
return typeof n == "string" ? n.split(".")[0] === "2" : !!(e && e.prototype);
|
|
2888
2931
|
}
|
|
2889
|
-
function
|
|
2932
|
+
function Bn(t, e = /* @__PURE__ */ new Set()) {
|
|
2890
2933
|
if (!t || e.has(t)) return;
|
|
2891
|
-
e.add(t), typeof t.$forceUpdate == "function" && t.$forceUpdate(), (t.$children || []).forEach((o) =>
|
|
2934
|
+
e.add(t), typeof t.$forceUpdate == "function" && t.$forceUpdate(), (t.$children || []).forEach((o) => Bn(o, e));
|
|
2892
2935
|
}
|
|
2893
2936
|
class J {
|
|
2894
2937
|
constructor(e = {}) {
|
|
@@ -2896,32 +2939,32 @@ class J {
|
|
|
2896
2939
|
router: n,
|
|
2897
2940
|
appCode: o,
|
|
2898
2941
|
messages: s,
|
|
2899
|
-
token:
|
|
2900
|
-
orgCode:
|
|
2942
|
+
token: r,
|
|
2943
|
+
orgCode: d,
|
|
2901
2944
|
loginRouteName: c,
|
|
2902
|
-
login:
|
|
2945
|
+
login: i,
|
|
2903
2946
|
keyboard: l,
|
|
2904
|
-
locale:
|
|
2905
|
-
env:
|
|
2906
|
-
dev:
|
|
2947
|
+
locale: u,
|
|
2948
|
+
env: h,
|
|
2949
|
+
dev: w,
|
|
2907
2950
|
auth: x
|
|
2908
2951
|
} = e;
|
|
2909
|
-
this.env =
|
|
2910
|
-
|
|
2911
|
-
), this._isRTL =
|
|
2952
|
+
this.env = h || "local", this.baseUrl = h === "dev" || w === !0 ? "https://test.ihotel.cn" : !h || h === "local" ? "" : "https://trans.ihotel.cn", this.baseToken = r || (d ? jr(d) : "") || (k.get("I18N_CONFIG") || {}).token || k.get("token"), this.token = this.baseToken, this.auth = x || null, this.manualAuthScope = d || (r ? Bt(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(
|
|
2953
|
+
u || k.get("I18N_LANGUAGE") || navigator.language || "zh-CN"
|
|
2954
|
+
), this._isRTL = Ce(this.locale), k.set("I18N_CONFIG", {
|
|
2912
2955
|
baseUrl: this.baseUrl,
|
|
2913
2956
|
appCode: this.appCode,
|
|
2914
2957
|
token: this.token,
|
|
2915
2958
|
locale: this.locale,
|
|
2916
2959
|
env: this.env
|
|
2917
|
-
}), this.name = "", this.messages = s || {}, this.translationKeys = [], this.translationKeySet = /* @__PURE__ */ new Set(), this.loginRouteName = c || "login", this.login =
|
|
2918
|
-
const
|
|
2960
|
+
}), this.name = "", this.messages = Tn(s || {}), this.translationKeys = [], this.translationKeySet = /* @__PURE__ */ new Set(), this.loginRouteName = c || "login", this.login = i, this.loginTranslationKeys = [], this.keyboard = l || "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(), ft.bind(this.keyboard, (A) => {
|
|
2961
|
+
const $ = {
|
|
2919
2962
|
name: this.name,
|
|
2920
2963
|
token: this.token,
|
|
2921
2964
|
appCode: this.appCode,
|
|
2922
2965
|
env: this.env,
|
|
2923
2966
|
translationKeys: this.translationKeys
|
|
2924
|
-
},
|
|
2967
|
+
}, B = this.encodeQueryParams($), E = `${this.baseUrl}/i18n-admin-front/#/config?data=${B}`;
|
|
2925
2968
|
this.swalInstance = N.fire({
|
|
2926
2969
|
titleText: "多语言管理",
|
|
2927
2970
|
padding: "0px",
|
|
@@ -2934,10 +2977,10 @@ class J {
|
|
|
2934
2977
|
closeButton: "gc_i18n_close_button",
|
|
2935
2978
|
htmlContainer: "gc_i18n_html_container"
|
|
2936
2979
|
},
|
|
2937
|
-
html: `<iframe src="${
|
|
2980
|
+
html: `<iframe src="${E}" style="width: 100%; height: 100%;border: none;min-height: 480px;"></iframe>`
|
|
2938
2981
|
});
|
|
2939
|
-
}),
|
|
2940
|
-
|
|
2982
|
+
}), ft.bind(this.editKeyboard, (A) => {
|
|
2983
|
+
A.preventDefault(), Pr.toggle();
|
|
2941
2984
|
}), this.setupLanguageChangeListener(), this.setupAuthListener(), this.setupMessageListener();
|
|
2942
2985
|
}
|
|
2943
2986
|
/**
|
|
@@ -2959,18 +3002,18 @@ class J {
|
|
|
2959
3002
|
});
|
|
2960
3003
|
}
|
|
2961
3004
|
resolveAuthState() {
|
|
2962
|
-
const e = this.auth || {}, n =
|
|
2963
|
-
o ||
|
|
3005
|
+
const e = this.auth || {}, n = Fe(e.getToken) ?? "", o = Fe(e.getScope) ?? Fe(e.getUserScope) ?? "", s = typeof e.isAuthenticated == "function" ? !!e.isAuthenticated() : !!n, r = s ? String(
|
|
3006
|
+
o || Bt(n) || this.manualAuthScope || "user"
|
|
2964
3007
|
) : "guest";
|
|
2965
3008
|
return {
|
|
2966
3009
|
token: n,
|
|
2967
|
-
scope:
|
|
3010
|
+
scope: r,
|
|
2968
3011
|
isAuthenticated: s
|
|
2969
3012
|
};
|
|
2970
3013
|
}
|
|
2971
3014
|
applyAuthState(e = {}, { silent: n = !1 } = {}) {
|
|
2972
|
-
const o = this.token, s = this.activeCacheScope,
|
|
2973
|
-
return this.userToken =
|
|
3015
|
+
const o = this.token, s = this.activeCacheScope, r = e.token ?? "", d = e.isAuthenticated ? e.scope || "user" : "guest";
|
|
3016
|
+
return this.userToken = r, this.token = e.isAuthenticated ? r || this.baseToken : this.baseToken, this.activeCacheScope = d, k.set("I18N_TOKEN", this.token), k.set("I18N_CONFIG", {
|
|
2974
3017
|
baseUrl: this.baseUrl,
|
|
2975
3018
|
appCode: this.appCode,
|
|
2976
3019
|
token: this.token,
|
|
@@ -3031,9 +3074,9 @@ class J {
|
|
|
3031
3074
|
// 初始化路由守卫
|
|
3032
3075
|
initRouterGuards() {
|
|
3033
3076
|
this.router && (J._routerGuardRegistered || (J._routerGuardRegistered = !0, this.router.beforeEach(async (e, n, o) => {
|
|
3034
|
-
var c,
|
|
3035
|
-
const { language: s, token:
|
|
3036
|
-
if (this.configInstance && this.configInstance.closeModal(), this.name = e.name, this.translationKeySet = /* @__PURE__ */ new Set(),
|
|
3077
|
+
var c, i;
|
|
3078
|
+
const { language: s, token: r } = e.query;
|
|
3079
|
+
if (this.configInstance && this.configInstance.closeModal(), this.name = e.name, this.translationKeySet = /* @__PURE__ */ new Set(), r && this.setToken(r), this.loadI18n)
|
|
3037
3080
|
try {
|
|
3038
3081
|
await this.setLanguage(s || this.locale, {
|
|
3039
3082
|
cacheScope: this.activeCacheScope
|
|
@@ -3042,27 +3085,27 @@ class J {
|
|
|
3042
3085
|
console.error("初始化语言失败,已跳过阻塞:", l);
|
|
3043
3086
|
}
|
|
3044
3087
|
this.loadI18n = !1;
|
|
3045
|
-
const
|
|
3046
|
-
if (
|
|
3047
|
-
let l = (c =
|
|
3088
|
+
const d = this.router.getRoutes().find((l) => l.name === this.loginRouteName || l.path === `/${this.loginRouteName}`);
|
|
3089
|
+
if (d && d.components) {
|
|
3090
|
+
let l = (c = d.components) == null ? void 0 : c.default;
|
|
3048
3091
|
if (typeof l == "function" && l.toString().includes("import("))
|
|
3049
3092
|
try {
|
|
3050
3093
|
l = await l(), l = l.default;
|
|
3051
|
-
} catch (
|
|
3052
|
-
console.error("加载异步组件时出错:",
|
|
3094
|
+
} catch (h) {
|
|
3095
|
+
console.error("加载异步组件时出错:", h), o();
|
|
3053
3096
|
return;
|
|
3054
3097
|
}
|
|
3055
|
-
const
|
|
3056
|
-
this.loginTranslationKeys =
|
|
3098
|
+
const u = Ye(l);
|
|
3099
|
+
this.loginTranslationKeys = u;
|
|
3057
3100
|
}
|
|
3058
3101
|
if (e.matched.length > 0)
|
|
3059
3102
|
try {
|
|
3060
3103
|
const l = [];
|
|
3061
|
-
for (const
|
|
3062
|
-
let
|
|
3063
|
-
if (typeof
|
|
3064
|
-
const
|
|
3065
|
-
l.push(...
|
|
3104
|
+
for (const u of e.matched) {
|
|
3105
|
+
let h = (i = u.components) == null ? void 0 : i.default;
|
|
3106
|
+
if (typeof h == "function" && h.toString().includes("import(") && (h = await h(), h = h.default), h) {
|
|
3107
|
+
const w = Ye(h);
|
|
3108
|
+
l.push(...w);
|
|
3066
3109
|
}
|
|
3067
3110
|
}
|
|
3068
3111
|
this.translationKeys = l;
|
|
@@ -3072,13 +3115,13 @@ class J {
|
|
|
3072
3115
|
}
|
|
3073
3116
|
o();
|
|
3074
3117
|
}), J._afterEachGuardRegistered || (J._afterEachGuardRegistered = !0, this.router.afterEach(async () => {
|
|
3075
|
-
var
|
|
3076
|
-
await
|
|
3118
|
+
var r, d;
|
|
3119
|
+
await pt();
|
|
3077
3120
|
const e = Array.from(this.translationKeySet), n = Array.from(
|
|
3078
3121
|
/* @__PURE__ */ new Set([...this.translationKeys || [], ...e])
|
|
3079
3122
|
);
|
|
3080
3123
|
this.translationKeys = n;
|
|
3081
|
-
const o = (
|
|
3124
|
+
const o = (r = this.router) == null ? void 0 : r.currentRoute, s = (d = (o == null ? void 0 : o.value) ?? o) == null ? void 0 : d.name;
|
|
3082
3125
|
if (s === this.loginRouteName && (this.loginTranslationKeys = n), s) {
|
|
3083
3126
|
this.name = s;
|
|
3084
3127
|
const c = k.get("I18N_CONFIG") || {};
|
|
@@ -3091,32 +3134,33 @@ class J {
|
|
|
3091
3134
|
}
|
|
3092
3135
|
// 初始化 i18n 实例
|
|
3093
3136
|
initI18n(e) {
|
|
3094
|
-
this.i18n =
|
|
3137
|
+
this.i18n = zr({
|
|
3095
3138
|
locale: this.locale,
|
|
3096
3139
|
messages: e.messages || {}
|
|
3097
3140
|
}), this.keyValueMap = {}, globalThis.__I18N_ALL_KEYS__ = /* @__PURE__ */ new Set();
|
|
3098
3141
|
const n = this;
|
|
3099
|
-
globalThis.$t = (o, s) => {
|
|
3100
|
-
var
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3142
|
+
globalThis.$t = (o, s, r) => {
|
|
3143
|
+
var h, w;
|
|
3144
|
+
const d = _n(s, r);
|
|
3145
|
+
if (s = d.defaultValue, r = d.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."))
|
|
3146
|
+
return ue(s || o, r);
|
|
3147
|
+
const i = (h = n.router) == null ? void 0 : h.currentRoute, l = (w = (i == null ? void 0 : i.value) ?? i) == null ? void 0 : w.name;
|
|
3148
|
+
let u;
|
|
3149
|
+
if (l) {
|
|
3150
|
+
const x = `${l}.${o}`, A = n.i18n.t(x, void 0, r);
|
|
3151
|
+
if (A !== x && !T.isEmpty(A))
|
|
3152
|
+
u = A;
|
|
3109
3153
|
else {
|
|
3110
|
-
const
|
|
3111
|
-
|
|
3154
|
+
const $ = `common.${o}`, B = n.i18n.t($, void 0, r);
|
|
3155
|
+
B !== $ ? u = B : u = n.i18n.t(o, void 0, r);
|
|
3112
3156
|
}
|
|
3113
3157
|
} else
|
|
3114
|
-
|
|
3115
|
-
return
|
|
3158
|
+
u = n.i18n.t(o, void 0, r);
|
|
3159
|
+
return u === o && typeof s == "string" && s && (u = s), u = ue(u, r), typeof o == "string" && typeof u == "string" && (n.keyValueMap[u] = o, globalThis.__I18N_KEY_VALUE_MAP__ || (globalThis.__I18N_KEY_VALUE_MAP__ = {}), globalThis.__I18N_KEY_VALUE_MAP__[u] = o), u;
|
|
3116
3160
|
}, this.t = globalThis.$t, globalThis.$deepScan = function(o) {
|
|
3117
3161
|
return o;
|
|
3118
3162
|
}, globalThis.$clearI18n = this.clearI18n = () => {
|
|
3119
|
-
|
|
3163
|
+
Hn({
|
|
3120
3164
|
appCode: this.appCode,
|
|
3121
3165
|
cacheScope: this.activeCacheScope
|
|
3122
3166
|
});
|
|
@@ -3139,7 +3183,7 @@ class J {
|
|
|
3139
3183
|
* @returns {boolean}
|
|
3140
3184
|
*/
|
|
3141
3185
|
static checkRTL(e) {
|
|
3142
|
-
return
|
|
3186
|
+
return Ce(e);
|
|
3143
3187
|
}
|
|
3144
3188
|
/**
|
|
3145
3189
|
* 压缩编码 translationKeys 数组为 URL 安全的字符串
|
|
@@ -3149,7 +3193,7 @@ class J {
|
|
|
3149
3193
|
encodeTranslationKeys(e) {
|
|
3150
3194
|
if (!e || e.length === 0) return "";
|
|
3151
3195
|
const n = JSON.stringify(e);
|
|
3152
|
-
return
|
|
3196
|
+
return Ae.compressToEncodedURIComponent(n);
|
|
3153
3197
|
}
|
|
3154
3198
|
/**
|
|
3155
3199
|
* 压缩整个 query 参数对象为 URL 安全的字符串
|
|
@@ -3159,7 +3203,7 @@ class J {
|
|
|
3159
3203
|
encodeQueryParams(e) {
|
|
3160
3204
|
if (!e) return "";
|
|
3161
3205
|
const n = JSON.stringify(e);
|
|
3162
|
-
return
|
|
3206
|
+
return Ae.compressToEncodedURIComponent(n);
|
|
3163
3207
|
}
|
|
3164
3208
|
/**
|
|
3165
3209
|
* 解码压缩的 translationKeys 字符串
|
|
@@ -3169,7 +3213,7 @@ class J {
|
|
|
3169
3213
|
static decodeTranslationKeys(e) {
|
|
3170
3214
|
if (!e) return [];
|
|
3171
3215
|
try {
|
|
3172
|
-
const n =
|
|
3216
|
+
const n = Ae.decompressFromEncodedURIComponent(e);
|
|
3173
3217
|
return n ? JSON.parse(n) : [];
|
|
3174
3218
|
} catch (n) {
|
|
3175
3219
|
return console.error("解码 translationKeys 失败:", n), [];
|
|
@@ -3183,7 +3227,7 @@ class J {
|
|
|
3183
3227
|
static decodeQueryParams(e) {
|
|
3184
3228
|
if (!e) return {};
|
|
3185
3229
|
try {
|
|
3186
|
-
const n =
|
|
3230
|
+
const n = Ae.decompressFromEncodedURIComponent(e);
|
|
3187
3231
|
return n ? JSON.parse(n) : {};
|
|
3188
3232
|
} catch (n) {
|
|
3189
3233
|
return console.error("解码 query 参数失败:", n), {};
|
|
@@ -3196,9 +3240,9 @@ class J {
|
|
|
3196
3240
|
typeof document < "u" && (document.documentElement.dir = this._isRTL ? "rtl" : "ltr", document.documentElement.lang = this.locale);
|
|
3197
3241
|
}
|
|
3198
3242
|
notifyLanguageChanged(e, n) {
|
|
3199
|
-
|
|
3243
|
+
Ze() && this.vueInstances && this.vueInstances.size > 0 && pt(() => {
|
|
3200
3244
|
this.vueInstances.forEach((o) => {
|
|
3201
|
-
|
|
3245
|
+
Bn(o);
|
|
3202
3246
|
});
|
|
3203
3247
|
}), typeof window < "u" && typeof CustomEvent == "function" && window.dispatchEvent(
|
|
3204
3248
|
new CustomEvent("gc-i18n-language-changed", {
|
|
@@ -3221,7 +3265,7 @@ class J {
|
|
|
3221
3265
|
});
|
|
3222
3266
|
}
|
|
3223
3267
|
async getLanguages(e = !1) {
|
|
3224
|
-
return await
|
|
3268
|
+
return await It({
|
|
3225
3269
|
baseUrl: this.baseUrl,
|
|
3226
3270
|
token: this.token,
|
|
3227
3271
|
appCode: this.appCode,
|
|
@@ -3230,25 +3274,25 @@ class J {
|
|
|
3230
3274
|
}
|
|
3231
3275
|
async setLanguage(e = "zh-CN", n = {}) {
|
|
3232
3276
|
e = this.normalizeLocale(e);
|
|
3233
|
-
const o = n.cacheScope || this.activeCacheScope || "guest", s = n.authVersion || this.authVersion,
|
|
3234
|
-
let c = k.get(
|
|
3235
|
-
if (
|
|
3277
|
+
const o = n.cacheScope || this.activeCacheScope || "guest", s = n.authVersion || this.authVersion, r = ++this.languageVersion, d = "I18N_MESSAGES_COMMON_" + e;
|
|
3278
|
+
let c = k.get(d);
|
|
3279
|
+
if (T.isEmpty(c))
|
|
3236
3280
|
try {
|
|
3237
|
-
const
|
|
3281
|
+
const i = await $n.get(
|
|
3238
3282
|
`https://cdn.ihotel.cn/i18n_messages/${e}.json`
|
|
3239
3283
|
);
|
|
3240
|
-
if (
|
|
3241
|
-
const { data: l } =
|
|
3242
|
-
c = l, k.set(
|
|
3284
|
+
if (i) {
|
|
3285
|
+
const { data: l } = i;
|
|
3286
|
+
c = l, k.set(d, l);
|
|
3243
3287
|
}
|
|
3244
|
-
} catch (
|
|
3288
|
+
} catch (i) {
|
|
3245
3289
|
console.warn(
|
|
3246
3290
|
`公共语言包 ${e} 加载失败,继续使用业务语言数据`,
|
|
3247
|
-
|
|
3291
|
+
i
|
|
3248
3292
|
), c = {};
|
|
3249
3293
|
}
|
|
3250
3294
|
try {
|
|
3251
|
-
const
|
|
3295
|
+
const i = await Un({
|
|
3252
3296
|
baseUrl: this.baseUrl,
|
|
3253
3297
|
appCode: this.appCode,
|
|
3254
3298
|
language: e || this.locale,
|
|
@@ -3256,39 +3300,39 @@ class J {
|
|
|
3256
3300
|
routerName: this.name,
|
|
3257
3301
|
cacheScope: o
|
|
3258
3302
|
});
|
|
3259
|
-
if (s !== this.authVersion ||
|
|
3303
|
+
if (s !== this.authVersion || r !== this.languageVersion)
|
|
3260
3304
|
return !1;
|
|
3261
|
-
if (
|
|
3262
|
-
const l =
|
|
3305
|
+
if (i && Array.isArray(i)) {
|
|
3306
|
+
const l = Nn(i), u = T.assign(
|
|
3263
3307
|
{},
|
|
3264
3308
|
c,
|
|
3265
|
-
|
|
3309
|
+
T.get(this.messages, e),
|
|
3266
3310
|
l
|
|
3267
3311
|
);
|
|
3268
|
-
this.i18n.global.setLocaleMessage(e,
|
|
3312
|
+
this.i18n.global.setLocaleMessage(e, u);
|
|
3269
3313
|
} else {
|
|
3270
|
-
const l =
|
|
3314
|
+
const l = T.assign(
|
|
3271
3315
|
{},
|
|
3272
3316
|
c,
|
|
3273
|
-
|
|
3317
|
+
T.get(this.messages, e)
|
|
3274
3318
|
);
|
|
3275
3319
|
this.i18n.global.setLocaleMessage(e, l);
|
|
3276
3320
|
}
|
|
3277
|
-
return this.locale = e, this._isRTL =
|
|
3278
|
-
} catch (
|
|
3279
|
-
if (console.error(`设置语言 ${e} 失败,使用本地消息继续运行:`,
|
|
3321
|
+
return this.locale = e, this._isRTL = Ce(e), this.i18n.global.locale.value = e, k.set("I18N_LANGUAGE", e), this.updateDocumentDir(), this.notifyLanguageChanged(e, !0), !0;
|
|
3322
|
+
} catch (i) {
|
|
3323
|
+
if (console.error(`设置语言 ${e} 失败,使用本地消息继续运行:`, i), s !== this.authVersion || r !== this.languageVersion)
|
|
3280
3324
|
return !1;
|
|
3281
|
-
const l =
|
|
3325
|
+
const l = T.assign(
|
|
3282
3326
|
{},
|
|
3283
3327
|
c,
|
|
3284
|
-
|
|
3328
|
+
T.get(this.messages, e)
|
|
3285
3329
|
);
|
|
3286
|
-
return this.i18n.global.setLocaleMessage(e, l), this.locale = e, this._isRTL =
|
|
3330
|
+
return this.i18n.global.setLocaleMessage(e, l), this.locale = e, this._isRTL = Ce(e), this.i18n.global.locale.value = e, k.set("I18N_LANGUAGE", e), this.updateDocumentDir(), this.notifyLanguageChanged(e, !1), !1;
|
|
3287
3331
|
}
|
|
3288
3332
|
}
|
|
3289
3333
|
install(e, n = {}) {
|
|
3290
|
-
if (
|
|
3291
|
-
const o =
|
|
3334
|
+
if (Ze(e)) {
|
|
3335
|
+
const o = wt(e);
|
|
3292
3336
|
if (o.prototype.$t = this.t || globalThis.$t, o.prototype.$i18n = this.i18n, !J._vue2UpdateMixinRegistered && o.mixin) {
|
|
3293
3337
|
J._vue2UpdateMixinRegistered = !0;
|
|
3294
3338
|
const s = this;
|
|
@@ -3304,9 +3348,9 @@ class J {
|
|
|
3304
3348
|
} else
|
|
3305
3349
|
e.config.globalProperties.$t = this.t || globalThis.$t, e.config.globalProperties.$i18n = this.i18n;
|
|
3306
3350
|
e.component("i18n-earth", {
|
|
3307
|
-
...
|
|
3351
|
+
..._t,
|
|
3308
3352
|
props: {
|
|
3309
|
-
...
|
|
3353
|
+
..._t.props,
|
|
3310
3354
|
baseUrl: {
|
|
3311
3355
|
type: String,
|
|
3312
3356
|
default: this.baseUrl
|