@open-xamu-co/ui-components-vue 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE +7 -0
- package/README.md +3 -0
- package/dist/_virtual/chunk_h.cjs.js +1 -0
- package/dist/_virtual/chunk_h.es.js +4372 -0
- package/dist/_virtual/index.cjs.js +1 -0
- package/dist/_virtual/index.es.js +39 -0
- package/dist/_virtual/lodash.cjs.js +27 -0
- package/dist/_virtual/lodash.es.js +3686 -0
- package/dist/_virtual/nanoid.cjs.js +1 -0
- package/dist/_virtual/nanoid.es.js +4 -0
- package/dist/_virtual/sweetalert2.cjs.js +65 -0
- package/dist/_virtual/sweetalert2.es.js +1415 -0
- package/dist/_virtual/validator.cjs.js +7 -0
- package/dist/_virtual/validator.es.js +4508 -0
- package/dist/components/Dropdown.vue.cjs +1 -0
- package/dist/components/Dropdown.vue.d.ts +64 -0
- package/dist/components/Dropdown.vue.mjs +9 -0
- package/dist/components/Modal.vue.cjs +1 -0
- package/dist/components/Modal.vue.d.ts +112 -0
- package/dist/components/Modal.vue.mjs +9 -0
- package/dist/components/Slider.vue.cjs +1 -0
- package/dist/components/Slider.vue.d.ts +110 -0
- package/dist/components/Slider.vue.mjs +9 -0
- package/dist/components/Table.vue.cjs +1 -0
- package/dist/components/Table.vue.d.ts +98 -0
- package/dist/components/Table.vue.mjs +9 -0
- package/dist/components/action/Button.vue.cjs +1 -0
- package/dist/components/action/Button.vue.d.ts +149 -0
- package/dist/components/action/Button.vue.mjs +9 -0
- package/dist/components/action/ButtonLink.vue.cjs +1 -0
- package/dist/components/action/ButtonLink.vue.d.ts +155 -0
- package/dist/components/action/ButtonLink.vue.mjs +9 -0
- package/dist/components/action/ButtonToggle.vue.cjs +1 -0
- package/dist/components/action/ButtonToggle.vue.d.ts +155 -0
- package/dist/components/action/ButtonToggle.vue.mjs +9 -0
- package/dist/components/action/Link.vue.cjs +1 -0
- package/dist/components/action/Link.vue.d.ts +155 -0
- package/dist/components/action/Link.vue.mjs +9 -0
- package/dist/components/base/Action.vue.cjs +1 -0
- package/dist/components/base/Action.vue.d.ts +95 -0
- package/dist/components/base/Action.vue.mjs +9 -0
- package/dist/components/base/Img.vue.cjs +1 -0
- package/dist/components/base/Img.vue.d.ts +48 -0
- package/dist/components/base/Img.vue.mjs +9 -0
- package/dist/components/base/Input.vue.cjs +1 -0
- package/dist/components/base/Input.vue.d.ts +71 -0
- package/dist/components/base/Input.vue.mjs +9 -0
- package/dist/components/base/Select.vue.cjs +1 -0
- package/dist/components/base/Select.vue.d.ts +61 -0
- package/dist/components/base/Select.vue.mjs +9 -0
- package/dist/components/base/Wrapper.vue.cjs +1 -0
- package/dist/components/base/Wrapper.vue.d.ts +42 -0
- package/dist/components/base/Wrapper.vue.mjs +9 -0
- package/dist/components/box/Action.vue.cjs +1 -0
- package/dist/components/box/Action.vue.d.ts +170 -0
- package/dist/components/box/Action.vue.mjs +9 -0
- package/dist/components/box/Message.vue.cjs +1 -0
- package/dist/components/box/Message.vue.d.ts +143 -0
- package/dist/components/box/Message.vue.mjs +9 -0
- package/dist/components/form/Input.vue.cjs +1 -0
- package/dist/components/form/Input.vue.d.ts +49 -0
- package/dist/components/form/Input.vue.mjs +9 -0
- package/dist/components/form/InputCountriesAPI.vue.d.ts +45 -0
- package/dist/components/form/InputLoop.vue.d.ts +44 -0
- package/dist/components/form/InputNValues.vue.d.ts +34 -0
- package/dist/components/form/InputOptions.vue.d.ts +22 -0
- package/dist/components/form/Simple.vue.cjs +1 -0
- package/dist/components/form/Simple.vue.d.ts +45 -0
- package/dist/components/form/Simple.vue.mjs +9 -0
- package/dist/components/form/Stages.vue.cjs +1 -0
- package/dist/components/form/Stages.vue.d.ts +77 -0
- package/dist/components/form/Stages.vue.mjs +9 -0
- package/dist/components/icon/Fa.vue.cjs +1 -0
- package/dist/components/icon/Fa.vue.d.ts +47 -0
- package/dist/components/icon/Fa.vue.mjs +9 -0
- package/dist/components/icon/Simple.vue.cjs +1 -0
- package/dist/components/icon/Simple.vue.d.ts +29 -0
- package/dist/components/icon/Simple.vue.mjs +9 -0
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.ts +32 -0
- package/dist/components/index.mjs +40 -0
- package/dist/components/input/Color.vue.d.ts +88 -0
- package/dist/components/input/File.vue.cjs +1 -0
- package/dist/components/input/File.vue.d.ts +135 -0
- package/dist/components/input/File.vue.mjs +9 -0
- package/dist/components/input/Text.vue.cjs +1 -0
- package/dist/components/input/Text.vue.d.ts +128 -0
- package/dist/components/input/Text.vue.mjs +9 -0
- package/dist/components/input/Toggle.vue.cjs +1 -0
- package/dist/components/input/Toggle.vue.d.ts +113 -0
- package/dist/components/input/Toggle.vue.mjs +9 -0
- package/dist/components/loader/Content.vue.cjs +1 -0
- package/dist/components/loader/Content.vue.d.ts +73 -0
- package/dist/components/loader/Content.vue.mjs +9 -0
- package/dist/components/loader/ContentFetch.vue.cjs +1 -0
- package/dist/components/loader/ContentFetch.vue.d.ts +60 -0
- package/dist/components/loader/ContentFetch.vue.mjs +9 -0
- package/dist/components/loader/Simple.vue.cjs +1 -0
- package/dist/components/loader/Simple.vue.d.ts +47 -0
- package/dist/components/loader/Simple.vue.mjs +9 -0
- package/dist/components/pagination/Content.vue.cjs +1 -0
- package/dist/components/pagination/Content.vue.d.ts +66 -0
- package/dist/components/pagination/Content.vue.mjs +9 -0
- package/dist/components/pagination/Simple.vue.cjs +1 -0
- package/dist/components/pagination/Simple.vue.d.ts +41 -0
- package/dist/components/pagination/Simple.vue.mjs +9 -0
- package/dist/components/select/Filter.vue.cjs +1 -0
- package/dist/components/select/Filter.vue.d.ts +110 -0
- package/dist/components/select/Filter.vue.mjs +9 -0
- package/dist/components/select/Simple.vue.cjs +1 -0
- package/dist/components/select/Simple.vue.d.ts +88 -0
- package/dist/components/select/Simple.vue.mjs +9 -0
- package/dist/components/value/Complex.vue.cjs +1 -0
- package/dist/components/value/Complex.vue.d.ts +80 -0
- package/dist/components/value/Complex.vue.mjs +9 -0
- package/dist/components/value/Simple.vue.cjs +1 -0
- package/dist/components/value/Simple.vue.d.ts +50 -0
- package/dist/components/value/Simple.vue.mjs +9 -0
- package/dist/composables/browser.d.ts +11 -0
- package/dist/composables/countries.d.ts +21 -0
- package/dist/composables/fetch.d.ts +10 -0
- package/dist/composables/helpers.d.ts +2 -0
- package/dist/composables/input.d.ts +9 -0
- package/dist/composables/modifiers.d.ts +9 -0
- package/dist/composables/state.d.ts +9 -0
- package/dist/composables/theme.d.ts +28 -0
- package/dist/composables/uuid.d.ts +9 -0
- package/dist/plugin.cjs +1 -0
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.mjs +36 -0
- package/dist/types/countries.d.ts +12 -0
- package/dist/types/props.d.ts +77 -0
- package/dist/vite.svg +22 -0
- package/package.json +162 -0
|
@@ -0,0 +1,1415 @@
|
|
|
1
|
+
import { g as hi, c as I } from "./lodash.es.js";
|
|
2
|
+
var Se = { exports: {} };
|
|
3
|
+
/*!
|
|
4
|
+
* sweetalert2 v11.7.28
|
|
5
|
+
* Released under the MIT License.
|
|
6
|
+
*/
|
|
7
|
+
(function(Ie, bi) {
|
|
8
|
+
(function(ut, dt) {
|
|
9
|
+
Ie.exports = dt();
|
|
10
|
+
})(I, function() {
|
|
11
|
+
function ut(t, e) {
|
|
12
|
+
var n = It(t, e, "get");
|
|
13
|
+
return Le(t, n);
|
|
14
|
+
}
|
|
15
|
+
function dt(t, e, n) {
|
|
16
|
+
var o = It(t, e, "set");
|
|
17
|
+
return Oe(t, o, n), n;
|
|
18
|
+
}
|
|
19
|
+
function It(t, e, n) {
|
|
20
|
+
if (!e.has(t))
|
|
21
|
+
throw new TypeError("attempted to " + n + " private field on non-instance");
|
|
22
|
+
return e.get(t);
|
|
23
|
+
}
|
|
24
|
+
function Le(t, e) {
|
|
25
|
+
return e.get ? e.get.call(t) : e.value;
|
|
26
|
+
}
|
|
27
|
+
function Oe(t, e, n) {
|
|
28
|
+
if (e.set)
|
|
29
|
+
e.set.call(t, n);
|
|
30
|
+
else {
|
|
31
|
+
if (!e.writable)
|
|
32
|
+
throw new TypeError("attempted to set read only private field");
|
|
33
|
+
e.value = n;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function Me(t, e) {
|
|
37
|
+
if (e.has(t))
|
|
38
|
+
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
39
|
+
}
|
|
40
|
+
function De(t, e, n) {
|
|
41
|
+
Me(t, e), e.set(t, n);
|
|
42
|
+
}
|
|
43
|
+
const He = 100, c = {}, je = () => {
|
|
44
|
+
c.previousActiveElement instanceof HTMLElement ? (c.previousActiveElement.focus(), c.previousActiveElement = null) : document.body && document.body.focus();
|
|
45
|
+
}, Fe = (t) => new Promise((e) => {
|
|
46
|
+
if (!t)
|
|
47
|
+
return e();
|
|
48
|
+
const n = window.scrollX, o = window.scrollY;
|
|
49
|
+
c.restoreFocusTimeout = setTimeout(() => {
|
|
50
|
+
je(), e();
|
|
51
|
+
}, He), window.scrollTo(n, o);
|
|
52
|
+
}), Lt = "swal2-", i = ["container", "shown", "height-auto", "iosfix", "popup", "modal", "no-backdrop", "no-transition", "toast", "toast-shown", "show", "hide", "close", "title", "html-container", "actions", "confirm", "deny", "cancel", "default-outline", "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"].reduce(
|
|
53
|
+
(t, e) => (t[e] = Lt + e, t),
|
|
54
|
+
/** @type {SwalClasses} */
|
|
55
|
+
{}
|
|
56
|
+
), J = ["success", "warning", "info", "question", "error"].reduce(
|
|
57
|
+
(t, e) => (t[e] = Lt + e, t),
|
|
58
|
+
/** @type {SwalIcons} */
|
|
59
|
+
{}
|
|
60
|
+
), Ot = "SweetAlert2:", ft = (t) => t.charAt(0).toUpperCase() + t.slice(1), y = (t) => {
|
|
61
|
+
console.warn("".concat(Ot, " ").concat(typeof t == "object" ? t.join(" ") : t));
|
|
62
|
+
}, L = (t) => {
|
|
63
|
+
console.error("".concat(Ot, " ").concat(t));
|
|
64
|
+
}, Mt = [], Ve = (t) => {
|
|
65
|
+
Mt.includes(t) || (Mt.push(t), y(t));
|
|
66
|
+
}, qe = (t, e) => {
|
|
67
|
+
Ve('"'.concat(t, '" is deprecated and will be removed in the next major release. Please use "').concat(e, '" instead.'));
|
|
68
|
+
}, X = (t) => typeof t == "function" ? t() : t, pt = (t) => t && typeof t.toPromise == "function", N = (t) => pt(t) ? t.toPromise() : Promise.resolve(t), gt = (t) => t && Promise.resolve(t) === t, b = () => document.body.querySelector(".".concat(i.container)), z = (t) => {
|
|
69
|
+
const e = b();
|
|
70
|
+
return e ? e.querySelector(t) : null;
|
|
71
|
+
}, C = (t) => z(".".concat(t)), u = () => C(i.popup), K = () => C(i.icon), Re = () => C(i["icon-content"]), Dt = () => C(i.title), ht = () => C(i["html-container"]), Ht = () => C(i.image), mt = () => C(i["progress-steps"]), Q = () => C(i["validation-message"]), B = () => (
|
|
72
|
+
/** @type {HTMLButtonElement} */
|
|
73
|
+
z(".".concat(i.actions, " .").concat(i.confirm))
|
|
74
|
+
), F = () => (
|
|
75
|
+
/** @type {HTMLButtonElement} */
|
|
76
|
+
z(".".concat(i.actions, " .").concat(i.cancel))
|
|
77
|
+
), O = () => (
|
|
78
|
+
/** @type {HTMLButtonElement} */
|
|
79
|
+
z(".".concat(i.actions, " .").concat(i.deny))
|
|
80
|
+
), We = () => C(i["input-label"]), V = () => z(".".concat(i.loader)), $ = () => C(i.actions), jt = () => C(i.footer), tt = () => C(i["timer-progress-bar"]), bt = () => C(i.close), _e = `
|
|
81
|
+
a[href],
|
|
82
|
+
area[href],
|
|
83
|
+
input:not([disabled]),
|
|
84
|
+
select:not([disabled]),
|
|
85
|
+
textarea:not([disabled]),
|
|
86
|
+
button:not([disabled]),
|
|
87
|
+
iframe,
|
|
88
|
+
object,
|
|
89
|
+
embed,
|
|
90
|
+
[tabindex="0"],
|
|
91
|
+
[contenteditable],
|
|
92
|
+
audio[controls],
|
|
93
|
+
video[controls],
|
|
94
|
+
summary
|
|
95
|
+
`, yt = () => {
|
|
96
|
+
const t = u();
|
|
97
|
+
if (!t)
|
|
98
|
+
return [];
|
|
99
|
+
const e = t.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'), n = Array.from(e).sort((r, a) => {
|
|
100
|
+
const f = parseInt(r.getAttribute("tabindex") || "0"), p = parseInt(a.getAttribute("tabindex") || "0");
|
|
101
|
+
return f > p ? 1 : f < p ? -1 : 0;
|
|
102
|
+
}), o = t.querySelectorAll(_e), s = Array.from(o).filter((r) => r.getAttribute("tabindex") !== "-1");
|
|
103
|
+
return [...new Set(n.concat(s))].filter((r) => A(r));
|
|
104
|
+
}, wt = () => T(document.body, i.shown) && !T(document.body, i["toast-shown"]) && !T(document.body, i["no-backdrop"]), et = () => {
|
|
105
|
+
const t = u();
|
|
106
|
+
return t ? T(t, i.toast) : !1;
|
|
107
|
+
}, Ue = () => {
|
|
108
|
+
const t = u();
|
|
109
|
+
return t ? t.hasAttribute("data-loading") : !1;
|
|
110
|
+
}, v = (t, e) => {
|
|
111
|
+
if (t.textContent = "", e) {
|
|
112
|
+
const o = new DOMParser().parseFromString(e, "text/html"), s = o.querySelector("head");
|
|
113
|
+
s && Array.from(s.childNodes).forEach((a) => {
|
|
114
|
+
t.appendChild(a);
|
|
115
|
+
});
|
|
116
|
+
const r = o.querySelector("body");
|
|
117
|
+
r && Array.from(r.childNodes).forEach((a) => {
|
|
118
|
+
a instanceof HTMLVideoElement || a instanceof HTMLAudioElement ? t.appendChild(a.cloneNode(!0)) : t.appendChild(a);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}, T = (t, e) => {
|
|
122
|
+
if (!e)
|
|
123
|
+
return !1;
|
|
124
|
+
const n = e.split(/\s+/);
|
|
125
|
+
for (let o = 0; o < n.length; o++)
|
|
126
|
+
if (!t.classList.contains(n[o]))
|
|
127
|
+
return !1;
|
|
128
|
+
return !0;
|
|
129
|
+
}, Ne = (t, e) => {
|
|
130
|
+
Array.from(t.classList).forEach((n) => {
|
|
131
|
+
!Object.values(i).includes(n) && !Object.values(J).includes(n) && !Object.values(e.showClass || {}).includes(n) && t.classList.remove(n);
|
|
132
|
+
});
|
|
133
|
+
}, P = (t, e, n) => {
|
|
134
|
+
if (Ne(t, e), e.customClass && e.customClass[n]) {
|
|
135
|
+
if (typeof e.customClass[n] != "string" && !e.customClass[n].forEach) {
|
|
136
|
+
y("Invalid type of customClass.".concat(n, '! Expected string or iterable object, got "').concat(typeof e.customClass[n], '"'));
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
l(t, e.customClass[n]);
|
|
140
|
+
}
|
|
141
|
+
}, nt = (t, e) => {
|
|
142
|
+
if (!e)
|
|
143
|
+
return null;
|
|
144
|
+
switch (e) {
|
|
145
|
+
case "select":
|
|
146
|
+
case "textarea":
|
|
147
|
+
case "file":
|
|
148
|
+
return t.querySelector(".".concat(i.popup, " > .").concat(i[e]));
|
|
149
|
+
case "checkbox":
|
|
150
|
+
return t.querySelector(".".concat(i.popup, " > .").concat(i.checkbox, " input"));
|
|
151
|
+
case "radio":
|
|
152
|
+
return t.querySelector(".".concat(i.popup, " > .").concat(i.radio, " input:checked")) || t.querySelector(".".concat(i.popup, " > .").concat(i.radio, " input:first-child"));
|
|
153
|
+
case "range":
|
|
154
|
+
return t.querySelector(".".concat(i.popup, " > .").concat(i.range, " input"));
|
|
155
|
+
default:
|
|
156
|
+
return t.querySelector(".".concat(i.popup, " > .").concat(i.input));
|
|
157
|
+
}
|
|
158
|
+
}, Ft = (t) => {
|
|
159
|
+
if (t.focus(), t.type !== "file") {
|
|
160
|
+
const e = t.value;
|
|
161
|
+
t.value = "", t.value = e;
|
|
162
|
+
}
|
|
163
|
+
}, Vt = (t, e, n) => {
|
|
164
|
+
!t || !e || (typeof e == "string" && (e = e.split(/\s+/).filter(Boolean)), e.forEach((o) => {
|
|
165
|
+
Array.isArray(t) ? t.forEach((s) => {
|
|
166
|
+
n ? s.classList.add(o) : s.classList.remove(o);
|
|
167
|
+
}) : n ? t.classList.add(o) : t.classList.remove(o);
|
|
168
|
+
}));
|
|
169
|
+
}, l = (t, e) => {
|
|
170
|
+
Vt(t, e, !0);
|
|
171
|
+
}, k = (t, e) => {
|
|
172
|
+
Vt(t, e, !1);
|
|
173
|
+
}, x = (t, e) => {
|
|
174
|
+
const n = Array.from(t.children);
|
|
175
|
+
for (let o = 0; o < n.length; o++) {
|
|
176
|
+
const s = n[o];
|
|
177
|
+
if (s instanceof HTMLElement && T(s, e))
|
|
178
|
+
return s;
|
|
179
|
+
}
|
|
180
|
+
}, M = (t, e, n) => {
|
|
181
|
+
n === "".concat(parseInt(n)) && (n = parseInt(n)), n || parseInt(n) === 0 ? t.style[e] = typeof n == "number" ? "".concat(n, "px") : n : t.style.removeProperty(e);
|
|
182
|
+
}, h = function(t) {
|
|
183
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "flex";
|
|
184
|
+
t && (t.style.display = e);
|
|
185
|
+
}, m = (t) => {
|
|
186
|
+
t && (t.style.display = "none");
|
|
187
|
+
}, qt = (t, e, n, o) => {
|
|
188
|
+
const s = t.querySelector(e);
|
|
189
|
+
s && (s.style[n] = o);
|
|
190
|
+
}, ot = function(t, e) {
|
|
191
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "flex";
|
|
192
|
+
e ? h(t, n) : m(t);
|
|
193
|
+
}, A = (t) => !!(t && (t.offsetWidth || t.offsetHeight || t.getClientRects().length)), ze = () => !A(B()) && !A(O()) && !A(F()), Rt = (t) => t.scrollHeight > t.clientHeight, Wt = (t) => {
|
|
194
|
+
const e = window.getComputedStyle(t), n = parseFloat(e.getPropertyValue("animation-duration") || "0"), o = parseFloat(e.getPropertyValue("transition-duration") || "0");
|
|
195
|
+
return n > 0 || o > 0;
|
|
196
|
+
}, Ct = function(t) {
|
|
197
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
198
|
+
const n = tt();
|
|
199
|
+
n && A(n) && (e && (n.style.transition = "none", n.style.width = "100%"), setTimeout(() => {
|
|
200
|
+
n.style.transition = "width ".concat(t / 1e3, "s linear"), n.style.width = "0%";
|
|
201
|
+
}, 10));
|
|
202
|
+
}, Ke = () => {
|
|
203
|
+
const t = tt();
|
|
204
|
+
if (!t)
|
|
205
|
+
return;
|
|
206
|
+
const e = parseInt(window.getComputedStyle(t).width);
|
|
207
|
+
t.style.removeProperty("transition"), t.style.width = "100%";
|
|
208
|
+
const n = parseInt(window.getComputedStyle(t).width), o = e / n * 100;
|
|
209
|
+
t.style.width = "".concat(o, "%");
|
|
210
|
+
}, _t = () => typeof window > "u" || typeof document > "u", $e = `
|
|
211
|
+
<div aria-labelledby="`.concat(i.title, '" aria-describedby="').concat(i["html-container"], '" class="').concat(i.popup, `" tabindex="-1">
|
|
212
|
+
<button type="button" class="`).concat(i.close, `"></button>
|
|
213
|
+
<ul class="`).concat(i["progress-steps"], `"></ul>
|
|
214
|
+
<div class="`).concat(i.icon, `"></div>
|
|
215
|
+
<img class="`).concat(i.image, `" />
|
|
216
|
+
<h2 class="`).concat(i.title, '" id="').concat(i.title, `"></h2>
|
|
217
|
+
<div class="`).concat(i["html-container"], '" id="').concat(i["html-container"], `"></div>
|
|
218
|
+
<input class="`).concat(i.input, '" id="').concat(i.input, `" />
|
|
219
|
+
<input type="file" class="`).concat(i.file, `" />
|
|
220
|
+
<div class="`).concat(i.range, `">
|
|
221
|
+
<input type="range" />
|
|
222
|
+
<output></output>
|
|
223
|
+
</div>
|
|
224
|
+
<select class="`).concat(i.select, '" id="').concat(i.select, `"></select>
|
|
225
|
+
<div class="`).concat(i.radio, `"></div>
|
|
226
|
+
<label class="`).concat(i.checkbox, `">
|
|
227
|
+
<input type="checkbox" id="`).concat(i.checkbox, `" />
|
|
228
|
+
<span class="`).concat(i.label, `"></span>
|
|
229
|
+
</label>
|
|
230
|
+
<textarea class="`).concat(i.textarea, '" id="').concat(i.textarea, `"></textarea>
|
|
231
|
+
<div class="`).concat(i["validation-message"], '" id="').concat(i["validation-message"], `"></div>
|
|
232
|
+
<div class="`).concat(i.actions, `">
|
|
233
|
+
<div class="`).concat(i.loader, `"></div>
|
|
234
|
+
<button type="button" class="`).concat(i.confirm, `"></button>
|
|
235
|
+
<button type="button" class="`).concat(i.deny, `"></button>
|
|
236
|
+
<button type="button" class="`).concat(i.cancel, `"></button>
|
|
237
|
+
</div>
|
|
238
|
+
<div class="`).concat(i.footer, `"></div>
|
|
239
|
+
<div class="`).concat(i["timer-progress-bar-container"], `">
|
|
240
|
+
<div class="`).concat(i["timer-progress-bar"], `"></div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
`).replace(/(^|\n)\s*/g, ""), Ye = () => {
|
|
244
|
+
const t = b();
|
|
245
|
+
return t ? (t.remove(), k([document.documentElement, document.body], [i["no-backdrop"], i["toast-shown"], i["has-column"]]), !0) : !1;
|
|
246
|
+
}, D = () => {
|
|
247
|
+
c.currentInstance.resetValidationMessage();
|
|
248
|
+
}, Ze = () => {
|
|
249
|
+
const t = u(), e = x(t, i.input), n = x(t, i.file), o = t.querySelector(".".concat(i.range, " input")), s = t.querySelector(".".concat(i.range, " output")), r = x(t, i.select), a = t.querySelector(".".concat(i.checkbox, " input")), f = x(t, i.textarea);
|
|
250
|
+
e.oninput = D, n.onchange = D, r.onchange = D, a.onchange = D, f.oninput = D, o.oninput = () => {
|
|
251
|
+
D(), s.value = o.value;
|
|
252
|
+
}, o.onchange = () => {
|
|
253
|
+
D(), s.value = o.value;
|
|
254
|
+
};
|
|
255
|
+
}, Ge = (t) => typeof t == "string" ? document.querySelector(t) : t, Je = (t) => {
|
|
256
|
+
const e = u();
|
|
257
|
+
e.setAttribute("role", t.toast ? "alert" : "dialog"), e.setAttribute("aria-live", t.toast ? "polite" : "assertive"), t.toast || e.setAttribute("aria-modal", "true");
|
|
258
|
+
}, Xe = (t) => {
|
|
259
|
+
window.getComputedStyle(t).direction === "rtl" && l(b(), i.rtl);
|
|
260
|
+
}, Qe = (t) => {
|
|
261
|
+
const e = Ye();
|
|
262
|
+
if (_t()) {
|
|
263
|
+
L("SweetAlert2 requires document to initialize");
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const n = document.createElement("div");
|
|
267
|
+
n.className = i.container, e && l(n, i["no-transition"]), v(n, $e);
|
|
268
|
+
const o = Ge(t.target);
|
|
269
|
+
o.appendChild(n), Je(t), Xe(o), Ze();
|
|
270
|
+
}, vt = (t, e) => {
|
|
271
|
+
t instanceof HTMLElement ? e.appendChild(t) : typeof t == "object" ? tn(t, e) : t && v(e, t);
|
|
272
|
+
}, tn = (t, e) => {
|
|
273
|
+
t.jquery ? en(e, t) : v(e, t.toString());
|
|
274
|
+
}, en = (t, e) => {
|
|
275
|
+
if (t.textContent = "", 0 in e)
|
|
276
|
+
for (let n = 0; n in e; n++)
|
|
277
|
+
t.appendChild(e[n].cloneNode(!0));
|
|
278
|
+
else
|
|
279
|
+
t.appendChild(e.cloneNode(!0));
|
|
280
|
+
}, H = (() => {
|
|
281
|
+
if (_t())
|
|
282
|
+
return !1;
|
|
283
|
+
const t = document.createElement("div");
|
|
284
|
+
return typeof t.style.webkitAnimation < "u" ? "webkitAnimationEnd" : typeof t.style.animation < "u" ? "animationend" : !1;
|
|
285
|
+
})(), nn = (t, e) => {
|
|
286
|
+
const n = $(), o = V();
|
|
287
|
+
!n || !o || (!e.showConfirmButton && !e.showDenyButton && !e.showCancelButton ? m(n) : h(n), P(n, e, "actions"), on(n, o, e), v(o, e.loaderHtml || ""), P(o, e, "loader"));
|
|
288
|
+
};
|
|
289
|
+
function on(t, e, n) {
|
|
290
|
+
const o = B(), s = O(), r = F();
|
|
291
|
+
!o || !s || !r || (At(o, "confirm", n), At(s, "deny", n), At(r, "cancel", n), sn(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))));
|
|
292
|
+
}
|
|
293
|
+
function sn(t, e, n, o) {
|
|
294
|
+
if (!o.buttonsStyling) {
|
|
295
|
+
k([t, e, n], i.styled);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
l([t, e, n], i.styled), o.confirmButtonColor && (t.style.backgroundColor = o.confirmButtonColor, l(t, i["default-outline"])), o.denyButtonColor && (e.style.backgroundColor = o.denyButtonColor, l(e, i["default-outline"])), o.cancelButtonColor && (n.style.backgroundColor = o.cancelButtonColor, l(n, i["default-outline"]));
|
|
299
|
+
}
|
|
300
|
+
function At(t, e, n) {
|
|
301
|
+
const o = (
|
|
302
|
+
/** @type {'Confirm' | 'Deny' | 'Cancel'} */
|
|
303
|
+
ft(e)
|
|
304
|
+
);
|
|
305
|
+
ot(t, n["show".concat(o, "Button")], "inline-block"), v(t, n["".concat(e, "ButtonText")] || ""), t.setAttribute("aria-label", n["".concat(e, "ButtonAriaLabel")] || ""), t.className = i[e], P(t, n, "".concat(e, "Button"));
|
|
306
|
+
}
|
|
307
|
+
const rn = (t, e) => {
|
|
308
|
+
const n = bt();
|
|
309
|
+
n && (v(n, e.closeButtonHtml || ""), P(n, e, "closeButton"), ot(n, e.showCloseButton), n.setAttribute("aria-label", e.closeButtonAriaLabel || ""));
|
|
310
|
+
}, cn = (t, e) => {
|
|
311
|
+
const n = b();
|
|
312
|
+
n && (ln(n, e.backdrop), an(n, e.position), un(n, e.grow), P(n, e, "container"));
|
|
313
|
+
};
|
|
314
|
+
function ln(t, e) {
|
|
315
|
+
typeof e == "string" ? t.style.background = e : e || l([document.documentElement, document.body], i["no-backdrop"]);
|
|
316
|
+
}
|
|
317
|
+
function an(t, e) {
|
|
318
|
+
e && (e in i ? l(t, i[e]) : (y('The "position" parameter is not valid, defaulting to "center"'), l(t, i.center)));
|
|
319
|
+
}
|
|
320
|
+
function un(t, e) {
|
|
321
|
+
e && l(t, i["grow-".concat(e)]);
|
|
322
|
+
}
|
|
323
|
+
var d = {
|
|
324
|
+
innerParams: /* @__PURE__ */ new WeakMap(),
|
|
325
|
+
domCache: /* @__PURE__ */ new WeakMap()
|
|
326
|
+
};
|
|
327
|
+
const dn = ["input", "file", "range", "select", "radio", "checkbox", "textarea"], fn = (t, e) => {
|
|
328
|
+
const n = u();
|
|
329
|
+
if (!n)
|
|
330
|
+
return;
|
|
331
|
+
const o = d.innerParams.get(t), s = !o || e.input !== o.input;
|
|
332
|
+
dn.forEach((r) => {
|
|
333
|
+
const a = x(n, i[r]);
|
|
334
|
+
a && (hn(r, e.inputAttributes), a.className = i[r], s && m(a));
|
|
335
|
+
}), e.input && (s && pn(e), mn(e));
|
|
336
|
+
}, pn = (t) => {
|
|
337
|
+
if (!t.input)
|
|
338
|
+
return;
|
|
339
|
+
if (!w[t.input]) {
|
|
340
|
+
L('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(t.input, '"'));
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const e = Ut(t.input), n = w[t.input](e, t);
|
|
344
|
+
h(e), t.inputAutoFocus && setTimeout(() => {
|
|
345
|
+
Ft(n);
|
|
346
|
+
});
|
|
347
|
+
}, gn = (t) => {
|
|
348
|
+
for (let e = 0; e < t.attributes.length; e++) {
|
|
349
|
+
const n = t.attributes[e].name;
|
|
350
|
+
["id", "type", "value", "style"].includes(n) || t.removeAttribute(n);
|
|
351
|
+
}
|
|
352
|
+
}, hn = (t, e) => {
|
|
353
|
+
const n = nt(u(), t);
|
|
354
|
+
if (n) {
|
|
355
|
+
gn(n);
|
|
356
|
+
for (const o in e)
|
|
357
|
+
n.setAttribute(o, e[o]);
|
|
358
|
+
}
|
|
359
|
+
}, mn = (t) => {
|
|
360
|
+
const e = Ut(t.input);
|
|
361
|
+
typeof t.customClass == "object" && l(e, t.customClass.input);
|
|
362
|
+
}, Pt = (t, e) => {
|
|
363
|
+
(!t.placeholder || e.inputPlaceholder) && (t.placeholder = e.inputPlaceholder);
|
|
364
|
+
}, Y = (t, e, n) => {
|
|
365
|
+
if (n.inputLabel) {
|
|
366
|
+
const o = document.createElement("label"), s = i["input-label"];
|
|
367
|
+
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);
|
|
368
|
+
}
|
|
369
|
+
}, Ut = (t) => x(u(), i[t] || i.input), it = (t, e) => {
|
|
370
|
+
["string", "number"].includes(typeof e) ? t.value = "".concat(e) : gt(e) || y('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof e, '"'));
|
|
371
|
+
}, w = {};
|
|
372
|
+
w.text = w.email = w.password = w.number = w.tel = w.url = (t, e) => (it(t, e.inputValue), Y(t, t, e), Pt(t, e), t.type = e.input, t), w.file = (t, e) => (Y(t, t, e), Pt(t, e), t), w.range = (t, e) => {
|
|
373
|
+
const n = t.querySelector("input"), o = t.querySelector("output");
|
|
374
|
+
return it(n, e.inputValue), n.type = e.input, it(o, e.inputValue), Y(n, t, e), t;
|
|
375
|
+
}, w.select = (t, e) => {
|
|
376
|
+
if (t.textContent = "", e.inputPlaceholder) {
|
|
377
|
+
const n = document.createElement("option");
|
|
378
|
+
v(n, e.inputPlaceholder), n.value = "", n.disabled = !0, n.selected = !0, t.appendChild(n);
|
|
379
|
+
}
|
|
380
|
+
return Y(t, t, e), t;
|
|
381
|
+
}, w.radio = (t) => (t.textContent = "", t), w.checkbox = (t, e) => {
|
|
382
|
+
const n = nt(u(), "checkbox");
|
|
383
|
+
n.value = "1", n.checked = !!e.inputValue;
|
|
384
|
+
const o = t.querySelector("span");
|
|
385
|
+
return v(o, e.inputPlaceholder), n;
|
|
386
|
+
}, w.textarea = (t, e) => {
|
|
387
|
+
it(t, e.inputValue), Pt(t, e), Y(t, t, e);
|
|
388
|
+
const n = (o) => parseInt(window.getComputedStyle(o).marginLeft) + parseInt(window.getComputedStyle(o).marginRight);
|
|
389
|
+
return setTimeout(() => {
|
|
390
|
+
if ("MutationObserver" in window) {
|
|
391
|
+
const o = parseInt(window.getComputedStyle(u()).width), s = () => {
|
|
392
|
+
if (!document.body.contains(t))
|
|
393
|
+
return;
|
|
394
|
+
const r = t.offsetWidth + n(t);
|
|
395
|
+
r > o ? u().style.width = "".concat(r, "px") : M(u(), "width", e.width);
|
|
396
|
+
};
|
|
397
|
+
new MutationObserver(s).observe(t, {
|
|
398
|
+
attributes: !0,
|
|
399
|
+
attributeFilter: ["style"]
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
}), t;
|
|
403
|
+
};
|
|
404
|
+
const bn = (t, e) => {
|
|
405
|
+
const n = ht();
|
|
406
|
+
n && (P(n, e, "htmlContainer"), e.html ? (vt(e.html, n), h(n, "block")) : e.text ? (n.textContent = e.text, h(n, "block")) : m(n), fn(t, e));
|
|
407
|
+
}, yn = (t, e) => {
|
|
408
|
+
const n = jt();
|
|
409
|
+
n && (ot(n, e.footer, "block"), e.footer && vt(e.footer, n), P(n, e, "footer"));
|
|
410
|
+
}, wn = (t, e) => {
|
|
411
|
+
const n = d.innerParams.get(t), o = K();
|
|
412
|
+
if (o) {
|
|
413
|
+
if (n && e.icon === n.icon) {
|
|
414
|
+
zt(o, e), Nt(o, e);
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
if (!e.icon && !e.iconHtml) {
|
|
418
|
+
m(o);
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
if (e.icon && Object.keys(J).indexOf(e.icon) === -1) {
|
|
422
|
+
L('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(e.icon, '"')), m(o);
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
h(o), zt(o, e), Nt(o, e), l(o, e.showClass && e.showClass.icon);
|
|
426
|
+
}
|
|
427
|
+
}, Nt = (t, e) => {
|
|
428
|
+
for (const [n, o] of Object.entries(J))
|
|
429
|
+
e.icon !== n && k(t, o);
|
|
430
|
+
l(t, e.icon && J[e.icon]), Pn(t, e), Cn(), P(t, e, "icon");
|
|
431
|
+
}, Cn = () => {
|
|
432
|
+
const t = u();
|
|
433
|
+
if (!t)
|
|
434
|
+
return;
|
|
435
|
+
const e = window.getComputedStyle(t).getPropertyValue("background-color"), n = t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");
|
|
436
|
+
for (let o = 0; o < n.length; o++)
|
|
437
|
+
n[o].style.backgroundColor = e;
|
|
438
|
+
}, vn = `
|
|
439
|
+
<div class="swal2-success-circular-line-left"></div>
|
|
440
|
+
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
441
|
+
<div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
|
|
442
|
+
<div class="swal2-success-circular-line-right"></div>
|
|
443
|
+
`, An = `
|
|
444
|
+
<span class="swal2-x-mark">
|
|
445
|
+
<span class="swal2-x-mark-line-left"></span>
|
|
446
|
+
<span class="swal2-x-mark-line-right"></span>
|
|
447
|
+
</span>
|
|
448
|
+
`, zt = (t, e) => {
|
|
449
|
+
if (!e.icon && !e.iconHtml)
|
|
450
|
+
return;
|
|
451
|
+
let n = t.innerHTML, o = "";
|
|
452
|
+
e.iconHtml ? o = Kt(e.iconHtml) : e.icon === "success" ? (o = vn, n = n.replace(/ style=".*?"/g, "")) : e.icon === "error" ? o = An : e.icon && (o = Kt({
|
|
453
|
+
question: "?",
|
|
454
|
+
warning: "!",
|
|
455
|
+
info: "i"
|
|
456
|
+
}[e.icon])), n.trim() !== o.trim() && v(t, o);
|
|
457
|
+
}, Pn = (t, e) => {
|
|
458
|
+
if (e.iconColor) {
|
|
459
|
+
t.style.color = e.iconColor, t.style.borderColor = e.iconColor;
|
|
460
|
+
for (const n of [".swal2-success-line-tip", ".swal2-success-line-long", ".swal2-x-mark-line-left", ".swal2-x-mark-line-right"])
|
|
461
|
+
qt(t, n, "backgroundColor", e.iconColor);
|
|
462
|
+
qt(t, ".swal2-success-ring", "borderColor", e.iconColor);
|
|
463
|
+
}
|
|
464
|
+
}, Kt = (t) => '<div class="'.concat(i["icon-content"], '">').concat(t, "</div>"), Bn = (t, e) => {
|
|
465
|
+
const n = Ht();
|
|
466
|
+
if (n) {
|
|
467
|
+
if (!e.imageUrl) {
|
|
468
|
+
m(n);
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
h(n, ""), n.setAttribute("src", e.imageUrl), n.setAttribute("alt", e.imageAlt || ""), M(n, "width", e.imageWidth), M(n, "height", e.imageHeight), n.className = i.image, P(n, e, "image");
|
|
472
|
+
}
|
|
473
|
+
}, kn = (t, e) => {
|
|
474
|
+
const n = b(), o = u();
|
|
475
|
+
if (!(!n || !o)) {
|
|
476
|
+
if (e.toast) {
|
|
477
|
+
M(n, "width", e.width), o.style.width = "100%";
|
|
478
|
+
const s = V();
|
|
479
|
+
s && o.insertBefore(s, K());
|
|
480
|
+
} else
|
|
481
|
+
M(o, "width", e.width);
|
|
482
|
+
M(o, "padding", e.padding), e.color && (o.style.color = e.color), e.background && (o.style.background = e.background), m(Q()), En(o, e);
|
|
483
|
+
}
|
|
484
|
+
}, En = (t, e) => {
|
|
485
|
+
const n = e.showClass || {};
|
|
486
|
+
t.className = "".concat(i.popup, " ").concat(A(t) ? n.popup : ""), e.toast ? (l([document.documentElement, document.body], i["toast-shown"]), l(t, i.toast)) : l(t, i.modal), P(t, e, "popup"), typeof e.customClass == "string" && l(t, e.customClass), e.icon && l(t, i["icon-".concat(e.icon)]);
|
|
487
|
+
}, Tn = (t, e) => {
|
|
488
|
+
const n = mt();
|
|
489
|
+
if (!n)
|
|
490
|
+
return;
|
|
491
|
+
const {
|
|
492
|
+
progressSteps: o,
|
|
493
|
+
currentProgressStep: s
|
|
494
|
+
} = e;
|
|
495
|
+
if (!o || o.length === 0 || s === void 0) {
|
|
496
|
+
m(n);
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
h(n), n.textContent = "", s >= o.length && y("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"), o.forEach((r, a) => {
|
|
500
|
+
const f = xn(r);
|
|
501
|
+
if (n.appendChild(f), a === s && l(f, i["active-progress-step"]), a !== o.length - 1) {
|
|
502
|
+
const p = Sn(e);
|
|
503
|
+
n.appendChild(p);
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
}, xn = (t) => {
|
|
507
|
+
const e = document.createElement("li");
|
|
508
|
+
return l(e, i["progress-step"]), v(e, t), e;
|
|
509
|
+
}, Sn = (t) => {
|
|
510
|
+
const e = document.createElement("li");
|
|
511
|
+
return l(e, i["progress-step-line"]), t.progressStepsDistance && M(e, "width", t.progressStepsDistance), e;
|
|
512
|
+
}, In = (t, e) => {
|
|
513
|
+
const n = Dt();
|
|
514
|
+
n && (ot(n, e.title || e.titleText, "block"), e.title && vt(e.title, n), e.titleText && (n.innerText = e.titleText), P(n, e, "title"));
|
|
515
|
+
}, $t = (t, e) => {
|
|
516
|
+
kn(t, e), cn(t, e), Tn(t, e), wn(t, e), Bn(t, e), In(t, e), rn(t, e), bn(t, e), nn(t, e), yn(t, e);
|
|
517
|
+
const n = u();
|
|
518
|
+
typeof e.didRender == "function" && n && e.didRender(n);
|
|
519
|
+
}, Ln = () => A(u()), Yt = () => {
|
|
520
|
+
var t;
|
|
521
|
+
return (t = B()) === null || t === void 0 ? void 0 : t.click();
|
|
522
|
+
}, On = () => {
|
|
523
|
+
var t;
|
|
524
|
+
return (t = O()) === null || t === void 0 ? void 0 : t.click();
|
|
525
|
+
}, Mn = () => {
|
|
526
|
+
var t;
|
|
527
|
+
return (t = F()) === null || t === void 0 ? void 0 : t.click();
|
|
528
|
+
}, q = Object.freeze({
|
|
529
|
+
cancel: "cancel",
|
|
530
|
+
backdrop: "backdrop",
|
|
531
|
+
close: "close",
|
|
532
|
+
esc: "esc",
|
|
533
|
+
timer: "timer"
|
|
534
|
+
}), Zt = (t) => {
|
|
535
|
+
t.keydownTarget && t.keydownHandlerAdded && (t.keydownTarget.removeEventListener("keydown", t.keydownHandler, {
|
|
536
|
+
capture: t.keydownListenerCapture
|
|
537
|
+
}), t.keydownHandlerAdded = !1);
|
|
538
|
+
}, Dn = (t, e, n) => {
|
|
539
|
+
Zt(t), e.toast || (t.keydownHandler = (o) => jn(e, o, n), t.keydownTarget = e.keydownListenerCapture ? window : u(), t.keydownListenerCapture = e.keydownListenerCapture, t.keydownTarget.addEventListener("keydown", t.keydownHandler, {
|
|
540
|
+
capture: t.keydownListenerCapture
|
|
541
|
+
}), t.keydownHandlerAdded = !0);
|
|
542
|
+
}, Bt = (t, e) => {
|
|
543
|
+
var n;
|
|
544
|
+
const o = yt();
|
|
545
|
+
if (o.length) {
|
|
546
|
+
t = t + e, t === o.length ? t = 0 : t === -1 && (t = o.length - 1), o[t].focus();
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
(n = u()) === null || n === void 0 || n.focus();
|
|
550
|
+
}, Gt = ["ArrowRight", "ArrowDown"], Hn = ["ArrowLeft", "ArrowUp"], jn = (t, e, n) => {
|
|
551
|
+
t && (e.isComposing || e.keyCode === 229 || (t.stopKeydownPropagation && e.stopPropagation(), e.key === "Enter" ? Fn(e, t) : e.key === "Tab" ? Vn(e) : [...Gt, ...Hn].includes(e.key) ? qn(e.key) : e.key === "Escape" && Rn(e, t, n)));
|
|
552
|
+
}, Fn = (t, e) => {
|
|
553
|
+
if (!X(e.allowEnterKey))
|
|
554
|
+
return;
|
|
555
|
+
const n = nt(u(), e.input);
|
|
556
|
+
if (t.target && n && t.target instanceof HTMLElement && t.target.outerHTML === n.outerHTML) {
|
|
557
|
+
if (["textarea", "file"].includes(e.input))
|
|
558
|
+
return;
|
|
559
|
+
Yt(), t.preventDefault();
|
|
560
|
+
}
|
|
561
|
+
}, Vn = (t) => {
|
|
562
|
+
const e = t.target, n = yt();
|
|
563
|
+
let o = -1;
|
|
564
|
+
for (let s = 0; s < n.length; s++)
|
|
565
|
+
if (e === n[s]) {
|
|
566
|
+
o = s;
|
|
567
|
+
break;
|
|
568
|
+
}
|
|
569
|
+
t.shiftKey ? Bt(o, -1) : Bt(o, 1), t.stopPropagation(), t.preventDefault();
|
|
570
|
+
}, qn = (t) => {
|
|
571
|
+
const e = $(), n = B(), o = O(), s = F();
|
|
572
|
+
if (!e || !n || !o || !s)
|
|
573
|
+
return;
|
|
574
|
+
const r = [n, o, s];
|
|
575
|
+
if (document.activeElement instanceof HTMLElement && !r.includes(document.activeElement))
|
|
576
|
+
return;
|
|
577
|
+
const a = Gt.includes(t) ? "nextElementSibling" : "previousElementSibling";
|
|
578
|
+
let f = document.activeElement;
|
|
579
|
+
if (f) {
|
|
580
|
+
for (let p = 0; p < e.children.length; p++) {
|
|
581
|
+
if (f = f[a], !f)
|
|
582
|
+
return;
|
|
583
|
+
if (f instanceof HTMLButtonElement && A(f))
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
f instanceof HTMLButtonElement && f.focus();
|
|
587
|
+
}
|
|
588
|
+
}, Rn = (t, e, n) => {
|
|
589
|
+
X(e.allowEscapeKey) && (t.preventDefault(), n(q.esc));
|
|
590
|
+
};
|
|
591
|
+
var Z = {
|
|
592
|
+
swalPromiseResolve: /* @__PURE__ */ new WeakMap(),
|
|
593
|
+
swalPromiseReject: /* @__PURE__ */ new WeakMap()
|
|
594
|
+
};
|
|
595
|
+
const Wn = () => {
|
|
596
|
+
Array.from(document.body.children).forEach((e) => {
|
|
597
|
+
e === b() || e.contains(b()) || (e.hasAttribute("aria-hidden") && e.setAttribute("data-previous-aria-hidden", e.getAttribute("aria-hidden") || ""), e.setAttribute("aria-hidden", "true"));
|
|
598
|
+
});
|
|
599
|
+
}, Jt = () => {
|
|
600
|
+
Array.from(document.body.children).forEach((e) => {
|
|
601
|
+
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");
|
|
602
|
+
});
|
|
603
|
+
}, Xt = typeof window < "u" && !!window.GestureEvent, _n = () => {
|
|
604
|
+
if (Xt && !T(document.body, i.iosfix)) {
|
|
605
|
+
const t = document.body.scrollTop;
|
|
606
|
+
document.body.style.top = "".concat(t * -1, "px"), l(document.body, i.iosfix), Un();
|
|
607
|
+
}
|
|
608
|
+
}, Un = () => {
|
|
609
|
+
const t = b();
|
|
610
|
+
if (!t)
|
|
611
|
+
return;
|
|
612
|
+
let e;
|
|
613
|
+
t.ontouchstart = (n) => {
|
|
614
|
+
e = Nn(n);
|
|
615
|
+
}, t.ontouchmove = (n) => {
|
|
616
|
+
e && (n.preventDefault(), n.stopPropagation());
|
|
617
|
+
};
|
|
618
|
+
}, Nn = (t) => {
|
|
619
|
+
const e = t.target, n = b(), o = ht();
|
|
620
|
+
return !n || !o || zn(t) || Kn(t) ? !1 : e === n || !Rt(n) && e instanceof HTMLElement && e.tagName !== "INPUT" && // #1603
|
|
621
|
+
e.tagName !== "TEXTAREA" && // #2266
|
|
622
|
+
!(Rt(o) && // #1944
|
|
623
|
+
o.contains(e));
|
|
624
|
+
}, zn = (t) => t.touches && t.touches.length && t.touches[0].touchType === "stylus", Kn = (t) => t.touches && t.touches.length > 1, $n = () => {
|
|
625
|
+
if (T(document.body, i.iosfix)) {
|
|
626
|
+
const t = parseInt(document.body.style.top, 10);
|
|
627
|
+
k(document.body, i.iosfix), document.body.style.top = "", document.body.scrollTop = t * -1;
|
|
628
|
+
}
|
|
629
|
+
}, Yn = () => {
|
|
630
|
+
const t = document.createElement("div");
|
|
631
|
+
t.className = i["scrollbar-measure"], document.body.appendChild(t);
|
|
632
|
+
const e = t.getBoundingClientRect().width - t.clientWidth;
|
|
633
|
+
return document.body.removeChild(t), e;
|
|
634
|
+
};
|
|
635
|
+
let R = null;
|
|
636
|
+
const Zn = (t) => {
|
|
637
|
+
R === null && (document.body.scrollHeight > window.innerHeight || t === "scroll") && (R = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = "".concat(R + Yn(), "px"));
|
|
638
|
+
}, Gn = () => {
|
|
639
|
+
R !== null && (document.body.style.paddingRight = "".concat(R, "px"), R = null);
|
|
640
|
+
};
|
|
641
|
+
function Qt(t, e, n, o) {
|
|
642
|
+
et() ? ee(t, o) : (Fe(n).then(() => ee(t, o)), Zt(c)), Xt ? (e.setAttribute("style", "display:none !important"), e.removeAttribute("class"), e.innerHTML = "") : e.remove(), wt() && (Gn(), $n(), Jt()), Jn();
|
|
643
|
+
}
|
|
644
|
+
function Jn() {
|
|
645
|
+
k([document.documentElement, document.body], [i.shown, i["height-auto"], i["no-backdrop"], i["toast-shown"]]);
|
|
646
|
+
}
|
|
647
|
+
function S(t) {
|
|
648
|
+
t = Qn(t);
|
|
649
|
+
const e = Z.swalPromiseResolve.get(this), n = Xn(this);
|
|
650
|
+
this.isAwaitingPromise ? t.isDismissed || (G(this), e(t)) : n && e(t);
|
|
651
|
+
}
|
|
652
|
+
const Xn = (t) => {
|
|
653
|
+
const e = u();
|
|
654
|
+
if (!e)
|
|
655
|
+
return !1;
|
|
656
|
+
const n = d.innerParams.get(t);
|
|
657
|
+
if (!n || T(e, n.hideClass.popup))
|
|
658
|
+
return !1;
|
|
659
|
+
k(e, n.showClass.popup), l(e, n.hideClass.popup);
|
|
660
|
+
const o = b();
|
|
661
|
+
return k(o, n.showClass.backdrop), l(o, n.hideClass.backdrop), to(t, e, n), !0;
|
|
662
|
+
};
|
|
663
|
+
function te(t) {
|
|
664
|
+
const e = Z.swalPromiseReject.get(this);
|
|
665
|
+
G(this), e && e(t);
|
|
666
|
+
}
|
|
667
|
+
const G = (t) => {
|
|
668
|
+
t.isAwaitingPromise && (delete t.isAwaitingPromise, d.innerParams.get(t) || t._destroy());
|
|
669
|
+
}, Qn = (t) => typeof t > "u" ? {
|
|
670
|
+
isConfirmed: !1,
|
|
671
|
+
isDenied: !1,
|
|
672
|
+
isDismissed: !0
|
|
673
|
+
} : Object.assign({
|
|
674
|
+
isConfirmed: !1,
|
|
675
|
+
isDenied: !1,
|
|
676
|
+
isDismissed: !1
|
|
677
|
+
}, t), to = (t, e, n) => {
|
|
678
|
+
const o = b(), s = H && Wt(e);
|
|
679
|
+
typeof n.willClose == "function" && n.willClose(e), s ? eo(t, e, o, n.returnFocus, n.didClose) : Qt(t, o, n.returnFocus, n.didClose);
|
|
680
|
+
}, eo = (t, e, n, o, s) => {
|
|
681
|
+
H && (c.swalCloseEventFinishedCallback = Qt.bind(null, t, n, o, s), e.addEventListener(H, function(r) {
|
|
682
|
+
r.target === e && (c.swalCloseEventFinishedCallback(), delete c.swalCloseEventFinishedCallback);
|
|
683
|
+
}));
|
|
684
|
+
}, ee = (t, e) => {
|
|
685
|
+
setTimeout(() => {
|
|
686
|
+
typeof e == "function" && e.bind(t.params)(), t._destroy && t._destroy();
|
|
687
|
+
});
|
|
688
|
+
}, W = (t) => {
|
|
689
|
+
let e = u();
|
|
690
|
+
if (e || new at(), e = u(), !e)
|
|
691
|
+
return;
|
|
692
|
+
const n = V();
|
|
693
|
+
et() ? m(K()) : no(e, t), h(n), e.setAttribute("data-loading", "true"), e.setAttribute("aria-busy", "true"), e.focus();
|
|
694
|
+
}, no = (t, e) => {
|
|
695
|
+
const n = $(), o = V();
|
|
696
|
+
!n || !o || (!e && A(B()) && (e = B()), h(n), e && (m(e), o.setAttribute("data-button-to-replace", e.className), n.insertBefore(o, e)), l([t, n], i.loading));
|
|
697
|
+
}, oo = (t, e) => {
|
|
698
|
+
e.input === "select" || e.input === "radio" ? lo(t, e) : ["text", "email", "number", "tel", "textarea"].some((n) => n === e.input) && (pt(e.inputValue) || gt(e.inputValue)) && (W(B()), ao(t, e));
|
|
699
|
+
}, io = (t, e) => {
|
|
700
|
+
const n = t.getInput();
|
|
701
|
+
if (!n)
|
|
702
|
+
return null;
|
|
703
|
+
switch (e.input) {
|
|
704
|
+
case "checkbox":
|
|
705
|
+
return so(n);
|
|
706
|
+
case "radio":
|
|
707
|
+
return ro(n);
|
|
708
|
+
case "file":
|
|
709
|
+
return co(n);
|
|
710
|
+
default:
|
|
711
|
+
return e.inputAutoTrim ? n.value.trim() : n.value;
|
|
712
|
+
}
|
|
713
|
+
}, so = (t) => t.checked ? 1 : 0, ro = (t) => t.checked ? t.value : null, co = (t) => t.files && t.files.length ? t.getAttribute("multiple") !== null ? t.files : t.files[0] : null, lo = (t, e) => {
|
|
714
|
+
const n = u();
|
|
715
|
+
if (!n)
|
|
716
|
+
return;
|
|
717
|
+
const o = (s) => {
|
|
718
|
+
e.input === "select" ? uo(n, st(s), e) : e.input === "radio" && fo(n, st(s), e);
|
|
719
|
+
};
|
|
720
|
+
pt(e.inputOptions) || gt(e.inputOptions) ? (W(B()), N(e.inputOptions).then((s) => {
|
|
721
|
+
t.hideLoading(), o(s);
|
|
722
|
+
})) : typeof e.inputOptions == "object" ? o(e.inputOptions) : L("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof e.inputOptions));
|
|
723
|
+
}, ao = (t, e) => {
|
|
724
|
+
const n = t.getInput();
|
|
725
|
+
n && (m(n), N(e.inputValue).then((o) => {
|
|
726
|
+
n.value = e.input === "number" ? "".concat(parseFloat(o) || 0) : "".concat(o), h(n), n.focus(), t.hideLoading();
|
|
727
|
+
}).catch((o) => {
|
|
728
|
+
L("Error in inputValue promise: ".concat(o)), n.value = "", h(n), n.focus(), t.hideLoading();
|
|
729
|
+
}));
|
|
730
|
+
};
|
|
731
|
+
function uo(t, e, n) {
|
|
732
|
+
const o = x(t, i.select);
|
|
733
|
+
if (!o)
|
|
734
|
+
return;
|
|
735
|
+
const s = (r, a, f) => {
|
|
736
|
+
const p = document.createElement("option");
|
|
737
|
+
p.value = f, v(p, a), p.selected = ne(f, n.inputValue), r.appendChild(p);
|
|
738
|
+
};
|
|
739
|
+
e.forEach((r) => {
|
|
740
|
+
const a = r[0], f = r[1];
|
|
741
|
+
if (Array.isArray(f)) {
|
|
742
|
+
const p = document.createElement("optgroup");
|
|
743
|
+
p.label = a, p.disabled = !1, o.appendChild(p), f.forEach((U) => s(p, U[1], U[0]));
|
|
744
|
+
} else
|
|
745
|
+
s(o, f, a);
|
|
746
|
+
}), o.focus();
|
|
747
|
+
}
|
|
748
|
+
function fo(t, e, n) {
|
|
749
|
+
const o = x(t, i.radio);
|
|
750
|
+
if (!o)
|
|
751
|
+
return;
|
|
752
|
+
e.forEach((r) => {
|
|
753
|
+
const a = r[0], f = r[1], p = document.createElement("input"), U = document.createElement("label");
|
|
754
|
+
p.type = "radio", p.name = i.radio, p.value = a, ne(a, n.inputValue) && (p.checked = !0);
|
|
755
|
+
const St = document.createElement("span");
|
|
756
|
+
v(St, f), St.className = i.label, U.appendChild(p), U.appendChild(St), o.appendChild(U);
|
|
757
|
+
});
|
|
758
|
+
const s = o.querySelectorAll("input");
|
|
759
|
+
s.length && s[0].focus();
|
|
760
|
+
}
|
|
761
|
+
const st = (t) => {
|
|
762
|
+
const e = [];
|
|
763
|
+
return t instanceof Map ? t.forEach((n, o) => {
|
|
764
|
+
let s = n;
|
|
765
|
+
typeof s == "object" && (s = st(s)), e.push([o, s]);
|
|
766
|
+
}) : Object.keys(t).forEach((n) => {
|
|
767
|
+
let o = t[n];
|
|
768
|
+
typeof o == "object" && (o = st(o)), e.push([n, o]);
|
|
769
|
+
}), e;
|
|
770
|
+
}, ne = (t, e) => !!e && e.toString() === t.toString(), po = (t) => {
|
|
771
|
+
const e = d.innerParams.get(t);
|
|
772
|
+
t.disableButtons(), e.input ? oe(t, "confirm") : Et(t, !0);
|
|
773
|
+
}, go = (t) => {
|
|
774
|
+
const e = d.innerParams.get(t);
|
|
775
|
+
t.disableButtons(), e.returnInputValueOnDeny ? oe(t, "deny") : kt(t, !1);
|
|
776
|
+
}, ho = (t, e) => {
|
|
777
|
+
t.disableButtons(), e(q.cancel);
|
|
778
|
+
}, oe = (t, e) => {
|
|
779
|
+
const n = d.innerParams.get(t);
|
|
780
|
+
if (!n.input) {
|
|
781
|
+
L('The "input" parameter is needed to be set when using returnInputValueOn'.concat(ft(e)));
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
const o = t.getInput(), s = io(t, n);
|
|
785
|
+
n.inputValidator ? mo(t, s, e) : o && !o.checkValidity() ? (t.enableButtons(), t.showValidationMessage(n.validationMessage)) : e === "deny" ? kt(t, s) : Et(t, s);
|
|
786
|
+
}, mo = (t, e, n) => {
|
|
787
|
+
const o = d.innerParams.get(t);
|
|
788
|
+
t.disableInput(), Promise.resolve().then(() => N(o.inputValidator(e, o.validationMessage))).then((r) => {
|
|
789
|
+
t.enableButtons(), t.enableInput(), r ? t.showValidationMessage(r) : n === "deny" ? kt(t, e) : Et(t, e);
|
|
790
|
+
});
|
|
791
|
+
}, kt = (t, e) => {
|
|
792
|
+
const n = d.innerParams.get(t || void 0);
|
|
793
|
+
n.showLoaderOnDeny && W(O()), n.preDeny ? (t.isAwaitingPromise = !0, Promise.resolve().then(() => N(n.preDeny(e, n.validationMessage))).then((s) => {
|
|
794
|
+
s === !1 ? (t.hideLoading(), G(t)) : t.close({
|
|
795
|
+
isDenied: !0,
|
|
796
|
+
value: typeof s > "u" ? e : s
|
|
797
|
+
});
|
|
798
|
+
}).catch((s) => se(t || void 0, s))) : t.close({
|
|
799
|
+
isDenied: !0,
|
|
800
|
+
value: e
|
|
801
|
+
});
|
|
802
|
+
}, ie = (t, e) => {
|
|
803
|
+
t.close({
|
|
804
|
+
isConfirmed: !0,
|
|
805
|
+
value: e
|
|
806
|
+
});
|
|
807
|
+
}, se = (t, e) => {
|
|
808
|
+
t.rejectPromise(e);
|
|
809
|
+
}, Et = (t, e) => {
|
|
810
|
+
const n = d.innerParams.get(t || void 0);
|
|
811
|
+
n.showLoaderOnConfirm && W(), n.preConfirm ? (t.resetValidationMessage(), t.isAwaitingPromise = !0, Promise.resolve().then(() => N(n.preConfirm(e, n.validationMessage))).then((s) => {
|
|
812
|
+
A(Q()) || s === !1 ? (t.hideLoading(), G(t)) : ie(t, typeof s > "u" ? e : s);
|
|
813
|
+
}).catch((s) => se(t || void 0, s))) : ie(t, e);
|
|
814
|
+
};
|
|
815
|
+
function rt() {
|
|
816
|
+
const t = d.innerParams.get(this);
|
|
817
|
+
if (!t)
|
|
818
|
+
return;
|
|
819
|
+
const e = d.domCache.get(this);
|
|
820
|
+
m(e.loader), et() ? t.icon && h(K()) : bo(e), k([e.popup, e.actions], i.loading), e.popup.removeAttribute("aria-busy"), e.popup.removeAttribute("data-loading"), e.confirmButton.disabled = !1, e.denyButton.disabled = !1, e.cancelButton.disabled = !1;
|
|
821
|
+
}
|
|
822
|
+
const bo = (t) => {
|
|
823
|
+
const e = t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));
|
|
824
|
+
e.length ? h(e[0], "inline-block") : ze() && m(t.actions);
|
|
825
|
+
};
|
|
826
|
+
function re() {
|
|
827
|
+
const t = d.innerParams.get(this), e = d.domCache.get(this);
|
|
828
|
+
return e ? nt(e.popup, t.input) : null;
|
|
829
|
+
}
|
|
830
|
+
function ce(t, e, n) {
|
|
831
|
+
const o = d.domCache.get(t);
|
|
832
|
+
e.forEach((s) => {
|
|
833
|
+
o[s].disabled = n;
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
function le(t, e) {
|
|
837
|
+
const n = u();
|
|
838
|
+
if (!(!n || !t))
|
|
839
|
+
if (t.type === "radio") {
|
|
840
|
+
const o = n.querySelectorAll('[name="'.concat(i.radio, '"]'));
|
|
841
|
+
for (let s = 0; s < o.length; s++)
|
|
842
|
+
o[s].disabled = e;
|
|
843
|
+
} else
|
|
844
|
+
t.disabled = e;
|
|
845
|
+
}
|
|
846
|
+
function ae() {
|
|
847
|
+
ce(this, ["confirmButton", "denyButton", "cancelButton"], !1);
|
|
848
|
+
}
|
|
849
|
+
function ue() {
|
|
850
|
+
ce(this, ["confirmButton", "denyButton", "cancelButton"], !0);
|
|
851
|
+
}
|
|
852
|
+
function de() {
|
|
853
|
+
le(this.getInput(), !1);
|
|
854
|
+
}
|
|
855
|
+
function fe() {
|
|
856
|
+
le(this.getInput(), !0);
|
|
857
|
+
}
|
|
858
|
+
function pe(t) {
|
|
859
|
+
const e = d.domCache.get(this), n = d.innerParams.get(this);
|
|
860
|
+
v(e.validationMessage, t), e.validationMessage.className = i["validation-message"], n.customClass && n.customClass.validationMessage && l(e.validationMessage, n.customClass.validationMessage), h(e.validationMessage);
|
|
861
|
+
const o = this.getInput();
|
|
862
|
+
o && (o.setAttribute("aria-invalid", "true"), o.setAttribute("aria-describedby", i["validation-message"]), Ft(o), l(o, i.inputerror));
|
|
863
|
+
}
|
|
864
|
+
function ge() {
|
|
865
|
+
const t = d.domCache.get(this);
|
|
866
|
+
t.validationMessage && m(t.validationMessage);
|
|
867
|
+
const e = this.getInput();
|
|
868
|
+
e && (e.removeAttribute("aria-invalid"), e.removeAttribute("aria-describedby"), k(e, i.inputerror));
|
|
869
|
+
}
|
|
870
|
+
const _ = {
|
|
871
|
+
title: "",
|
|
872
|
+
titleText: "",
|
|
873
|
+
text: "",
|
|
874
|
+
html: "",
|
|
875
|
+
footer: "",
|
|
876
|
+
icon: void 0,
|
|
877
|
+
iconColor: void 0,
|
|
878
|
+
iconHtml: void 0,
|
|
879
|
+
template: void 0,
|
|
880
|
+
toast: !1,
|
|
881
|
+
showClass: {
|
|
882
|
+
popup: "swal2-show",
|
|
883
|
+
backdrop: "swal2-backdrop-show",
|
|
884
|
+
icon: "swal2-icon-show"
|
|
885
|
+
},
|
|
886
|
+
hideClass: {
|
|
887
|
+
popup: "swal2-hide",
|
|
888
|
+
backdrop: "swal2-backdrop-hide",
|
|
889
|
+
icon: "swal2-icon-hide"
|
|
890
|
+
},
|
|
891
|
+
customClass: {},
|
|
892
|
+
target: "body",
|
|
893
|
+
color: void 0,
|
|
894
|
+
backdrop: !0,
|
|
895
|
+
heightAuto: !0,
|
|
896
|
+
allowOutsideClick: !0,
|
|
897
|
+
allowEscapeKey: !0,
|
|
898
|
+
allowEnterKey: !0,
|
|
899
|
+
stopKeydownPropagation: !0,
|
|
900
|
+
keydownListenerCapture: !1,
|
|
901
|
+
showConfirmButton: !0,
|
|
902
|
+
showDenyButton: !1,
|
|
903
|
+
showCancelButton: !1,
|
|
904
|
+
preConfirm: void 0,
|
|
905
|
+
preDeny: void 0,
|
|
906
|
+
confirmButtonText: "OK",
|
|
907
|
+
confirmButtonAriaLabel: "",
|
|
908
|
+
confirmButtonColor: void 0,
|
|
909
|
+
denyButtonText: "No",
|
|
910
|
+
denyButtonAriaLabel: "",
|
|
911
|
+
denyButtonColor: void 0,
|
|
912
|
+
cancelButtonText: "Cancel",
|
|
913
|
+
cancelButtonAriaLabel: "",
|
|
914
|
+
cancelButtonColor: void 0,
|
|
915
|
+
buttonsStyling: !0,
|
|
916
|
+
reverseButtons: !1,
|
|
917
|
+
focusConfirm: !0,
|
|
918
|
+
focusDeny: !1,
|
|
919
|
+
focusCancel: !1,
|
|
920
|
+
returnFocus: !0,
|
|
921
|
+
showCloseButton: !1,
|
|
922
|
+
closeButtonHtml: "×",
|
|
923
|
+
closeButtonAriaLabel: "Close this dialog",
|
|
924
|
+
loaderHtml: "",
|
|
925
|
+
showLoaderOnConfirm: !1,
|
|
926
|
+
showLoaderOnDeny: !1,
|
|
927
|
+
imageUrl: void 0,
|
|
928
|
+
imageWidth: void 0,
|
|
929
|
+
imageHeight: void 0,
|
|
930
|
+
imageAlt: "",
|
|
931
|
+
timer: void 0,
|
|
932
|
+
timerProgressBar: !1,
|
|
933
|
+
width: void 0,
|
|
934
|
+
padding: void 0,
|
|
935
|
+
background: void 0,
|
|
936
|
+
input: void 0,
|
|
937
|
+
inputPlaceholder: "",
|
|
938
|
+
inputLabel: "",
|
|
939
|
+
inputValue: "",
|
|
940
|
+
inputOptions: {},
|
|
941
|
+
inputAutoFocus: !0,
|
|
942
|
+
inputAutoTrim: !0,
|
|
943
|
+
inputAttributes: {},
|
|
944
|
+
inputValidator: void 0,
|
|
945
|
+
returnInputValueOnDeny: !1,
|
|
946
|
+
validationMessage: void 0,
|
|
947
|
+
grow: !1,
|
|
948
|
+
position: "center",
|
|
949
|
+
progressSteps: [],
|
|
950
|
+
currentProgressStep: void 0,
|
|
951
|
+
progressStepsDistance: void 0,
|
|
952
|
+
willOpen: void 0,
|
|
953
|
+
didOpen: void 0,
|
|
954
|
+
didRender: void 0,
|
|
955
|
+
willClose: void 0,
|
|
956
|
+
didClose: void 0,
|
|
957
|
+
didDestroy: void 0,
|
|
958
|
+
scrollbarPadding: !0
|
|
959
|
+
}, yo = ["allowEscapeKey", "allowOutsideClick", "background", "buttonsStyling", "cancelButtonAriaLabel", "cancelButtonColor", "cancelButtonText", "closeButtonAriaLabel", "closeButtonHtml", "color", "confirmButtonAriaLabel", "confirmButtonColor", "confirmButtonText", "currentProgressStep", "customClass", "denyButtonAriaLabel", "denyButtonColor", "denyButtonText", "didClose", "didDestroy", "footer", "hideClass", "html", "icon", "iconColor", "iconHtml", "imageAlt", "imageHeight", "imageUrl", "imageWidth", "preConfirm", "preDeny", "progressSteps", "returnFocus", "reverseButtons", "showCancelButton", "showCloseButton", "showConfirmButton", "showDenyButton", "text", "title", "titleText", "willClose"], wo = {}, Co = ["allowOutsideClick", "allowEnterKey", "backdrop", "focusConfirm", "focusDeny", "focusCancel", "returnFocus", "heightAuto", "keydownListenerCapture"], he = (t) => Object.prototype.hasOwnProperty.call(_, t), me = (t) => yo.indexOf(t) !== -1, be = (t) => wo[t], vo = (t) => {
|
|
960
|
+
he(t) || y('Unknown parameter "'.concat(t, '"'));
|
|
961
|
+
}, Ao = (t) => {
|
|
962
|
+
Co.includes(t) && y('The parameter "'.concat(t, '" is incompatible with toasts'));
|
|
963
|
+
}, Po = (t) => {
|
|
964
|
+
const e = be(t);
|
|
965
|
+
e && qe(t, e);
|
|
966
|
+
}, Bo = (t) => {
|
|
967
|
+
t.backdrop === !1 && t.allowOutsideClick && y('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');
|
|
968
|
+
for (const e in t)
|
|
969
|
+
vo(e), t.toast && Ao(e), Po(e);
|
|
970
|
+
};
|
|
971
|
+
function ye(t) {
|
|
972
|
+
const e = u(), n = d.innerParams.get(this);
|
|
973
|
+
if (!e || T(e, n.hideClass.popup)) {
|
|
974
|
+
y("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.");
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
const o = ko(t), s = Object.assign({}, n, o);
|
|
978
|
+
$t(this, s), d.innerParams.set(this, s), Object.defineProperties(this, {
|
|
979
|
+
params: {
|
|
980
|
+
value: Object.assign({}, this.params, t),
|
|
981
|
+
writable: !1,
|
|
982
|
+
enumerable: !0
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
const ko = (t) => {
|
|
987
|
+
const e = {};
|
|
988
|
+
return Object.keys(t).forEach((n) => {
|
|
989
|
+
me(n) ? e[n] = t[n] : y("Invalid parameter to update: ".concat(n));
|
|
990
|
+
}), e;
|
|
991
|
+
};
|
|
992
|
+
function we() {
|
|
993
|
+
const t = d.domCache.get(this), e = d.innerParams.get(this);
|
|
994
|
+
if (!e) {
|
|
995
|
+
Ce(this);
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
998
|
+
t.popup && c.swalCloseEventFinishedCallback && (c.swalCloseEventFinishedCallback(), delete c.swalCloseEventFinishedCallback), typeof e.didDestroy == "function" && e.didDestroy(), Eo(this);
|
|
999
|
+
}
|
|
1000
|
+
const Eo = (t) => {
|
|
1001
|
+
Ce(t), delete t.params, delete c.keydownHandler, delete c.keydownTarget, delete c.currentInstance;
|
|
1002
|
+
}, Ce = (t) => {
|
|
1003
|
+
t.isAwaitingPromise ? (Tt(d, t), t.isAwaitingPromise = !0) : (Tt(Z, t), Tt(d, 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);
|
|
1004
|
+
}, Tt = (t, e) => {
|
|
1005
|
+
for (const n in t)
|
|
1006
|
+
t[n].delete(e);
|
|
1007
|
+
};
|
|
1008
|
+
var To = /* @__PURE__ */ Object.freeze({
|
|
1009
|
+
__proto__: null,
|
|
1010
|
+
_destroy: we,
|
|
1011
|
+
close: S,
|
|
1012
|
+
closeModal: S,
|
|
1013
|
+
closePopup: S,
|
|
1014
|
+
closeToast: S,
|
|
1015
|
+
disableButtons: ue,
|
|
1016
|
+
disableInput: fe,
|
|
1017
|
+
disableLoading: rt,
|
|
1018
|
+
enableButtons: ae,
|
|
1019
|
+
enableInput: de,
|
|
1020
|
+
getInput: re,
|
|
1021
|
+
handleAwaitingPromise: G,
|
|
1022
|
+
hideLoading: rt,
|
|
1023
|
+
rejectPromise: te,
|
|
1024
|
+
resetValidationMessage: ge,
|
|
1025
|
+
showValidationMessage: pe,
|
|
1026
|
+
update: ye
|
|
1027
|
+
});
|
|
1028
|
+
const xo = (t, e, n) => {
|
|
1029
|
+
t.toast ? So(t, e, n) : (Lo(e), Oo(e), Mo(t, e, n));
|
|
1030
|
+
}, So = (t, e, n) => {
|
|
1031
|
+
e.popup.onclick = () => {
|
|
1032
|
+
t && (Io(t) || t.timer || t.input) || n(q.close);
|
|
1033
|
+
};
|
|
1034
|
+
}, Io = (t) => t.showConfirmButton || t.showDenyButton || t.showCancelButton || t.showCloseButton;
|
|
1035
|
+
let ct = !1;
|
|
1036
|
+
const Lo = (t) => {
|
|
1037
|
+
t.popup.onmousedown = () => {
|
|
1038
|
+
t.container.onmouseup = function(e) {
|
|
1039
|
+
t.container.onmouseup = void 0, e.target === t.container && (ct = !0);
|
|
1040
|
+
};
|
|
1041
|
+
};
|
|
1042
|
+
}, Oo = (t) => {
|
|
1043
|
+
t.container.onmousedown = () => {
|
|
1044
|
+
t.popup.onmouseup = function(e) {
|
|
1045
|
+
t.popup.onmouseup = void 0, (e.target === t.popup || e.target instanceof HTMLElement && t.popup.contains(e.target)) && (ct = !0);
|
|
1046
|
+
};
|
|
1047
|
+
};
|
|
1048
|
+
}, Mo = (t, e, n) => {
|
|
1049
|
+
e.container.onclick = (o) => {
|
|
1050
|
+
if (ct) {
|
|
1051
|
+
ct = !1;
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
o.target === e.container && X(t.allowOutsideClick) && n(q.backdrop);
|
|
1055
|
+
};
|
|
1056
|
+
}, Do = (t) => typeof t == "object" && t.jquery, ve = (t) => t instanceof Element || Do(t), Ho = (t) => {
|
|
1057
|
+
const e = {};
|
|
1058
|
+
return typeof t[0] == "object" && !ve(t[0]) ? Object.assign(e, t[0]) : ["title", "html", "icon"].forEach((n, o) => {
|
|
1059
|
+
const s = t[o];
|
|
1060
|
+
typeof s == "string" || ve(s) ? e[n] = s : s !== void 0 && L("Unexpected type of ".concat(n, '! Expected "string" or "Element", got ').concat(typeof s));
|
|
1061
|
+
}), e;
|
|
1062
|
+
};
|
|
1063
|
+
function jo() {
|
|
1064
|
+
const t = this;
|
|
1065
|
+
for (var e = arguments.length, n = new Array(e), o = 0; o < e; o++)
|
|
1066
|
+
n[o] = arguments[o];
|
|
1067
|
+
return new t(...n);
|
|
1068
|
+
}
|
|
1069
|
+
function Fo(t) {
|
|
1070
|
+
class e extends this {
|
|
1071
|
+
_main(o, s) {
|
|
1072
|
+
return super._main(o, Object.assign({}, t, s));
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
return e;
|
|
1076
|
+
}
|
|
1077
|
+
const Vo = () => c.timeout && c.timeout.getTimerLeft(), Ae = () => {
|
|
1078
|
+
if (c.timeout)
|
|
1079
|
+
return Ke(), c.timeout.stop();
|
|
1080
|
+
}, Pe = () => {
|
|
1081
|
+
if (c.timeout) {
|
|
1082
|
+
const t = c.timeout.start();
|
|
1083
|
+
return Ct(t), t;
|
|
1084
|
+
}
|
|
1085
|
+
}, qo = () => {
|
|
1086
|
+
const t = c.timeout;
|
|
1087
|
+
return t && (t.running ? Ae() : Pe());
|
|
1088
|
+
}, Ro = (t) => {
|
|
1089
|
+
if (c.timeout) {
|
|
1090
|
+
const e = c.timeout.increase(t);
|
|
1091
|
+
return Ct(e, !0), e;
|
|
1092
|
+
}
|
|
1093
|
+
}, Wo = () => !!(c.timeout && c.timeout.isRunning());
|
|
1094
|
+
let Be = !1;
|
|
1095
|
+
const xt = {};
|
|
1096
|
+
function _o() {
|
|
1097
|
+
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "data-swal-template";
|
|
1098
|
+
xt[t] = this, Be || (document.body.addEventListener("click", Uo), Be = !0);
|
|
1099
|
+
}
|
|
1100
|
+
const Uo = (t) => {
|
|
1101
|
+
for (let e = t.target; e && e !== document; e = e.parentNode)
|
|
1102
|
+
for (const n in xt) {
|
|
1103
|
+
const o = e.getAttribute(n);
|
|
1104
|
+
if (o) {
|
|
1105
|
+
xt[n].fire({
|
|
1106
|
+
template: o
|
|
1107
|
+
});
|
|
1108
|
+
return;
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
};
|
|
1112
|
+
var No = /* @__PURE__ */ Object.freeze({
|
|
1113
|
+
__proto__: null,
|
|
1114
|
+
argsToParams: Ho,
|
|
1115
|
+
bindClickHandler: _o,
|
|
1116
|
+
clickCancel: Mn,
|
|
1117
|
+
clickConfirm: Yt,
|
|
1118
|
+
clickDeny: On,
|
|
1119
|
+
enableLoading: W,
|
|
1120
|
+
fire: jo,
|
|
1121
|
+
getActions: $,
|
|
1122
|
+
getCancelButton: F,
|
|
1123
|
+
getCloseButton: bt,
|
|
1124
|
+
getConfirmButton: B,
|
|
1125
|
+
getContainer: b,
|
|
1126
|
+
getDenyButton: O,
|
|
1127
|
+
getFocusableElements: yt,
|
|
1128
|
+
getFooter: jt,
|
|
1129
|
+
getHtmlContainer: ht,
|
|
1130
|
+
getIcon: K,
|
|
1131
|
+
getIconContent: Re,
|
|
1132
|
+
getImage: Ht,
|
|
1133
|
+
getInputLabel: We,
|
|
1134
|
+
getLoader: V,
|
|
1135
|
+
getPopup: u,
|
|
1136
|
+
getProgressSteps: mt,
|
|
1137
|
+
getTimerLeft: Vo,
|
|
1138
|
+
getTimerProgressBar: tt,
|
|
1139
|
+
getTitle: Dt,
|
|
1140
|
+
getValidationMessage: Q,
|
|
1141
|
+
increaseTimer: Ro,
|
|
1142
|
+
isDeprecatedParameter: be,
|
|
1143
|
+
isLoading: Ue,
|
|
1144
|
+
isTimerRunning: Wo,
|
|
1145
|
+
isUpdatableParameter: me,
|
|
1146
|
+
isValidParameter: he,
|
|
1147
|
+
isVisible: Ln,
|
|
1148
|
+
mixin: Fo,
|
|
1149
|
+
resumeTimer: Pe,
|
|
1150
|
+
showLoading: W,
|
|
1151
|
+
stopTimer: Ae,
|
|
1152
|
+
toggleTimer: qo
|
|
1153
|
+
});
|
|
1154
|
+
class zo {
|
|
1155
|
+
/**
|
|
1156
|
+
* @param {Function} callback
|
|
1157
|
+
* @param {number} delay
|
|
1158
|
+
*/
|
|
1159
|
+
constructor(e, n) {
|
|
1160
|
+
this.callback = e, this.remaining = n, this.running = !1, this.start();
|
|
1161
|
+
}
|
|
1162
|
+
/**
|
|
1163
|
+
* @returns {number}
|
|
1164
|
+
*/
|
|
1165
|
+
start() {
|
|
1166
|
+
return this.running || (this.running = !0, this.started = /* @__PURE__ */ new Date(), this.id = setTimeout(this.callback, this.remaining)), this.remaining;
|
|
1167
|
+
}
|
|
1168
|
+
/**
|
|
1169
|
+
* @returns {number}
|
|
1170
|
+
*/
|
|
1171
|
+
stop() {
|
|
1172
|
+
return this.started && this.running && (this.running = !1, clearTimeout(this.id), this.remaining -= (/* @__PURE__ */ new Date()).getTime() - this.started.getTime()), this.remaining;
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* @param {number} n
|
|
1176
|
+
* @returns {number}
|
|
1177
|
+
*/
|
|
1178
|
+
increase(e) {
|
|
1179
|
+
const n = this.running;
|
|
1180
|
+
return n && this.stop(), this.remaining += e, n && this.start(), this.remaining;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* @returns {number}
|
|
1184
|
+
*/
|
|
1185
|
+
getTimerLeft() {
|
|
1186
|
+
return this.running && (this.stop(), this.start()), this.remaining;
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* @returns {boolean}
|
|
1190
|
+
*/
|
|
1191
|
+
isRunning() {
|
|
1192
|
+
return this.running;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
const ke = ["swal-title", "swal-html", "swal-footer"], Ko = (t) => {
|
|
1196
|
+
const e = typeof t.template == "string" ? document.querySelector(t.template) : t.template;
|
|
1197
|
+
if (!e)
|
|
1198
|
+
return {};
|
|
1199
|
+
const n = e.content;
|
|
1200
|
+
return ti(n), Object.assign($o(n), Yo(n), Zo(n), Go(n), Jo(n), Xo(n), Qo(n, ke));
|
|
1201
|
+
}, $o = (t) => {
|
|
1202
|
+
const e = {};
|
|
1203
|
+
return Array.from(t.querySelectorAll("swal-param")).forEach((o) => {
|
|
1204
|
+
j(o, ["name", "value"]);
|
|
1205
|
+
const s = o.getAttribute("name"), r = o.getAttribute("value");
|
|
1206
|
+
typeof _[s] == "boolean" ? e[s] = r !== "false" : typeof _[s] == "object" ? e[s] = JSON.parse(r) : e[s] = r;
|
|
1207
|
+
}), e;
|
|
1208
|
+
}, Yo = (t) => {
|
|
1209
|
+
const e = {};
|
|
1210
|
+
return Array.from(t.querySelectorAll("swal-function-param")).forEach((o) => {
|
|
1211
|
+
const s = o.getAttribute("name"), r = o.getAttribute("value");
|
|
1212
|
+
e[s] = new Function("return ".concat(r))();
|
|
1213
|
+
}), e;
|
|
1214
|
+
}, Zo = (t) => {
|
|
1215
|
+
const e = {};
|
|
1216
|
+
return Array.from(t.querySelectorAll("swal-button")).forEach((o) => {
|
|
1217
|
+
j(o, ["type", "color", "aria-label"]);
|
|
1218
|
+
const s = o.getAttribute("type");
|
|
1219
|
+
e["".concat(s, "ButtonText")] = o.innerHTML, e["show".concat(ft(s), "Button")] = !0, o.hasAttribute("color") && (e["".concat(s, "ButtonColor")] = o.getAttribute("color")), o.hasAttribute("aria-label") && (e["".concat(s, "ButtonAriaLabel")] = o.getAttribute("aria-label"));
|
|
1220
|
+
}), e;
|
|
1221
|
+
}, Go = (t) => {
|
|
1222
|
+
const e = {}, n = t.querySelector("swal-image");
|
|
1223
|
+
return n && (j(n, ["src", "width", "height", "alt"]), n.hasAttribute("src") && (e.imageUrl = n.getAttribute("src")), n.hasAttribute("width") && (e.imageWidth = n.getAttribute("width")), n.hasAttribute("height") && (e.imageHeight = n.getAttribute("height")), n.hasAttribute("alt") && (e.imageAlt = n.getAttribute("alt"))), e;
|
|
1224
|
+
}, Jo = (t) => {
|
|
1225
|
+
const e = {}, n = t.querySelector("swal-icon");
|
|
1226
|
+
return n && (j(n, ["type", "color"]), n.hasAttribute("type") && (e.icon = n.getAttribute("type")), n.hasAttribute("color") && (e.iconColor = n.getAttribute("color")), e.iconHtml = n.innerHTML), e;
|
|
1227
|
+
}, Xo = (t) => {
|
|
1228
|
+
const e = {}, n = t.querySelector("swal-input");
|
|
1229
|
+
n && (j(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")));
|
|
1230
|
+
const o = Array.from(t.querySelectorAll("swal-input-option"));
|
|
1231
|
+
return o.length && (e.inputOptions = {}, o.forEach((s) => {
|
|
1232
|
+
j(s, ["value"]);
|
|
1233
|
+
const r = s.getAttribute("value"), a = s.innerHTML;
|
|
1234
|
+
e.inputOptions[r] = a;
|
|
1235
|
+
})), e;
|
|
1236
|
+
}, Qo = (t, e) => {
|
|
1237
|
+
const n = {};
|
|
1238
|
+
for (const o in e) {
|
|
1239
|
+
const s = e[o], r = t.querySelector(s);
|
|
1240
|
+
r && (j(r, []), n[s.replace(/^swal-/, "")] = r.innerHTML.trim());
|
|
1241
|
+
}
|
|
1242
|
+
return n;
|
|
1243
|
+
}, ti = (t) => {
|
|
1244
|
+
const e = ke.concat(["swal-param", "swal-function-param", "swal-button", "swal-image", "swal-icon", "swal-input", "swal-input-option"]);
|
|
1245
|
+
Array.from(t.children).forEach((n) => {
|
|
1246
|
+
const o = n.tagName.toLowerCase();
|
|
1247
|
+
e.includes(o) || y("Unrecognized element <".concat(o, ">"));
|
|
1248
|
+
});
|
|
1249
|
+
}, j = (t, e) => {
|
|
1250
|
+
Array.from(t.attributes).forEach((n) => {
|
|
1251
|
+
e.indexOf(n.name) === -1 && y(['Unrecognized attribute "'.concat(n.name, '" on <').concat(t.tagName.toLowerCase(), ">."), "".concat(e.length ? "Allowed attributes are: ".concat(e.join(", ")) : "To set the value, use HTML within the element.")]);
|
|
1252
|
+
});
|
|
1253
|
+
}, Ee = 10, ei = (t) => {
|
|
1254
|
+
const e = b(), n = u();
|
|
1255
|
+
typeof t.willOpen == "function" && t.willOpen(n);
|
|
1256
|
+
const s = window.getComputedStyle(document.body).overflowY;
|
|
1257
|
+
ii(e, n, t), setTimeout(() => {
|
|
1258
|
+
ni(e, n);
|
|
1259
|
+
}, Ee), wt() && (oi(e, t.scrollbarPadding, s), Wn()), !et() && !c.previousActiveElement && (c.previousActiveElement = document.activeElement), typeof t.didOpen == "function" && setTimeout(() => t.didOpen(n)), k(e, i["no-transition"]);
|
|
1260
|
+
}, Te = (t) => {
|
|
1261
|
+
const e = u();
|
|
1262
|
+
if (t.target !== e || !H)
|
|
1263
|
+
return;
|
|
1264
|
+
const n = b();
|
|
1265
|
+
e.removeEventListener(H, Te), n.style.overflowY = "auto";
|
|
1266
|
+
}, ni = (t, e) => {
|
|
1267
|
+
H && Wt(e) ? (t.style.overflowY = "hidden", e.addEventListener(H, Te)) : t.style.overflowY = "auto";
|
|
1268
|
+
}, oi = (t, e, n) => {
|
|
1269
|
+
_n(), e && n !== "hidden" && Zn(n), setTimeout(() => {
|
|
1270
|
+
t.scrollTop = 0;
|
|
1271
|
+
});
|
|
1272
|
+
}, ii = (t, e, n) => {
|
|
1273
|
+
l(t, n.showClass.backdrop), e.style.setProperty("opacity", "0", "important"), h(e, "grid"), setTimeout(() => {
|
|
1274
|
+
l(e, n.showClass.popup), e.style.removeProperty("opacity");
|
|
1275
|
+
}, Ee), l([document.documentElement, document.body], i.shown), n.heightAuto && n.backdrop && !n.toast && l([document.documentElement, document.body], i["height-auto"]);
|
|
1276
|
+
};
|
|
1277
|
+
var xe = {
|
|
1278
|
+
/**
|
|
1279
|
+
* @param {string} string
|
|
1280
|
+
* @param {string} [validationMessage]
|
|
1281
|
+
* @returns {Promise<string | void>}
|
|
1282
|
+
*/
|
|
1283
|
+
email: (t, e) => /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(t) ? Promise.resolve() : Promise.resolve(e || "Invalid email address"),
|
|
1284
|
+
/**
|
|
1285
|
+
* @param {string} string
|
|
1286
|
+
* @param {string} [validationMessage]
|
|
1287
|
+
* @returns {Promise<string | void>}
|
|
1288
|
+
*/
|
|
1289
|
+
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")
|
|
1290
|
+
};
|
|
1291
|
+
function si(t) {
|
|
1292
|
+
t.inputValidator || (t.input === "email" && (t.inputValidator = xe.email), t.input === "url" && (t.inputValidator = xe.url));
|
|
1293
|
+
}
|
|
1294
|
+
function ri(t) {
|
|
1295
|
+
(!t.target || typeof t.target == "string" && !document.querySelector(t.target) || typeof t.target != "string" && !t.target.appendChild) && (y('Target parameter is not valid, defaulting to "body"'), t.target = "body");
|
|
1296
|
+
}
|
|
1297
|
+
function ci(t) {
|
|
1298
|
+
si(t), t.showLoaderOnConfirm && !t.preConfirm && y(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
|
1299
|
+
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
1300
|
+
https://sweetalert2.github.io/#ajax-request`), ri(t), typeof t.title == "string" && (t.title = t.title.split(`
|
|
1301
|
+
`).join("<br />")), Qe(t);
|
|
1302
|
+
}
|
|
1303
|
+
let E;
|
|
1304
|
+
var lt = /* @__PURE__ */ new WeakMap();
|
|
1305
|
+
class g {
|
|
1306
|
+
/**
|
|
1307
|
+
* @param {...any} args
|
|
1308
|
+
* @this {SweetAlert}
|
|
1309
|
+
*/
|
|
1310
|
+
constructor() {
|
|
1311
|
+
if (De(this, lt, {
|
|
1312
|
+
writable: !0,
|
|
1313
|
+
value: void 0
|
|
1314
|
+
}), typeof window > "u")
|
|
1315
|
+
return;
|
|
1316
|
+
E = this;
|
|
1317
|
+
for (var e = arguments.length, n = new Array(e), o = 0; o < e; o++)
|
|
1318
|
+
n[o] = arguments[o];
|
|
1319
|
+
const s = Object.freeze(this.constructor.argsToParams(n));
|
|
1320
|
+
this.params = s, this.isAwaitingPromise = !1, dt(this, lt, this._main(E.params));
|
|
1321
|
+
}
|
|
1322
|
+
_main(e) {
|
|
1323
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1324
|
+
Bo(Object.assign({}, n, e)), c.currentInstance && (c.currentInstance._destroy(), wt() && Jt()), c.currentInstance = E;
|
|
1325
|
+
const o = ai(e, n);
|
|
1326
|
+
ci(o), Object.freeze(o), c.timeout && (c.timeout.stop(), delete c.timeout), clearTimeout(c.restoreFocusTimeout);
|
|
1327
|
+
const s = ui(E);
|
|
1328
|
+
return $t(E, o), d.innerParams.set(E, o), li(E, s, o);
|
|
1329
|
+
}
|
|
1330
|
+
// `catch` cannot be the name of a module export, so we define our thenable methods here instead
|
|
1331
|
+
then(e) {
|
|
1332
|
+
return ut(this, lt).then(e);
|
|
1333
|
+
}
|
|
1334
|
+
finally(e) {
|
|
1335
|
+
return ut(this, lt).finally(e);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
const li = (t, e, n) => new Promise((o, s) => {
|
|
1339
|
+
const r = (a) => {
|
|
1340
|
+
t.close({
|
|
1341
|
+
isDismissed: !0,
|
|
1342
|
+
dismiss: a
|
|
1343
|
+
});
|
|
1344
|
+
};
|
|
1345
|
+
Z.swalPromiseResolve.set(t, o), Z.swalPromiseReject.set(t, s), e.confirmButton.onclick = () => {
|
|
1346
|
+
po(t);
|
|
1347
|
+
}, e.denyButton.onclick = () => {
|
|
1348
|
+
go(t);
|
|
1349
|
+
}, e.cancelButton.onclick = () => {
|
|
1350
|
+
ho(t, r);
|
|
1351
|
+
}, e.closeButton.onclick = () => {
|
|
1352
|
+
r(q.close);
|
|
1353
|
+
}, xo(n, e, r), Dn(c, n, r), oo(t, n), ei(n), di(c, n, r), fi(e, n), setTimeout(() => {
|
|
1354
|
+
e.container.scrollTop = 0;
|
|
1355
|
+
});
|
|
1356
|
+
}), ai = (t, e) => {
|
|
1357
|
+
const n = Ko(t), o = Object.assign({}, _, e, n, t);
|
|
1358
|
+
return o.showClass = Object.assign({}, _.showClass, o.showClass), o.hideClass = Object.assign({}, _.hideClass, o.hideClass), o;
|
|
1359
|
+
}, ui = (t) => {
|
|
1360
|
+
const e = {
|
|
1361
|
+
popup: u(),
|
|
1362
|
+
container: b(),
|
|
1363
|
+
actions: $(),
|
|
1364
|
+
confirmButton: B(),
|
|
1365
|
+
denyButton: O(),
|
|
1366
|
+
cancelButton: F(),
|
|
1367
|
+
loader: V(),
|
|
1368
|
+
closeButton: bt(),
|
|
1369
|
+
validationMessage: Q(),
|
|
1370
|
+
progressSteps: mt()
|
|
1371
|
+
};
|
|
1372
|
+
return d.domCache.set(t, e), e;
|
|
1373
|
+
}, di = (t, e, n) => {
|
|
1374
|
+
const o = tt();
|
|
1375
|
+
m(o), e.timer && (t.timeout = new zo(() => {
|
|
1376
|
+
n("timer"), delete t.timeout;
|
|
1377
|
+
}, e.timer), e.timerProgressBar && (h(o), P(o, e, "timerProgressBar"), setTimeout(() => {
|
|
1378
|
+
t.timeout && t.timeout.running && Ct(e.timer);
|
|
1379
|
+
})));
|
|
1380
|
+
}, fi = (t, e) => {
|
|
1381
|
+
if (!e.toast) {
|
|
1382
|
+
if (!X(e.allowEnterKey)) {
|
|
1383
|
+
gi();
|
|
1384
|
+
return;
|
|
1385
|
+
}
|
|
1386
|
+
pi(t, e) || Bt(-1, 1);
|
|
1387
|
+
}
|
|
1388
|
+
}, pi = (t, e) => e.focusDeny && A(t.denyButton) ? (t.denyButton.focus(), !0) : e.focusCancel && A(t.cancelButton) ? (t.cancelButton.focus(), !0) : e.focusConfirm && A(t.confirmButton) ? (t.confirmButton.focus(), !0) : !1, gi = () => {
|
|
1389
|
+
document.activeElement instanceof HTMLElement && typeof document.activeElement.blur == "function" && document.activeElement.blur();
|
|
1390
|
+
};
|
|
1391
|
+
if (typeof window < "u" && /^ru\b/.test(navigator.language) && location.host.match(/\.(ru|su|by|xn--p1ai)$/)) {
|
|
1392
|
+
const t = /* @__PURE__ */ new Date(), e = localStorage.getItem("swal-initiation");
|
|
1393
|
+
e ? (t.getTime() - Date.parse(e)) / (1e3 * 60 * 60 * 24) > 3 && setTimeout(() => {
|
|
1394
|
+
document.body.style.pointerEvents = "none";
|
|
1395
|
+
const n = document.createElement("audio");
|
|
1396
|
+
n.src = "https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3", n.loop = !0, document.body.appendChild(n), setTimeout(() => {
|
|
1397
|
+
n.play().catch(() => {
|
|
1398
|
+
});
|
|
1399
|
+
}, 2500);
|
|
1400
|
+
}, 500) : localStorage.setItem("swal-initiation", "".concat(t));
|
|
1401
|
+
}
|
|
1402
|
+
g.prototype.disableButtons = ue, g.prototype.enableButtons = ae, g.prototype.getInput = re, g.prototype.disableInput = fe, g.prototype.enableInput = de, g.prototype.hideLoading = rt, g.prototype.disableLoading = rt, g.prototype.showValidationMessage = pe, g.prototype.resetValidationMessage = ge, g.prototype.close = S, g.prototype.closePopup = S, g.prototype.closeModal = S, g.prototype.closeToast = S, g.prototype.rejectPromise = te, g.prototype.update = ye, g.prototype._destroy = we, Object.assign(g, No), Object.keys(To).forEach((t) => {
|
|
1403
|
+
g[t] = function() {
|
|
1404
|
+
return E && E[t] ? E[t](...arguments) : null;
|
|
1405
|
+
};
|
|
1406
|
+
}), g.DismissReason = q, g.version = "11.7.28";
|
|
1407
|
+
const at = g;
|
|
1408
|
+
return at.default = at, at;
|
|
1409
|
+
}), typeof I < "u" && I.Sweetalert2 && (I.swal = I.sweetAlert = I.Swal = I.SweetAlert = I.Sweetalert2);
|
|
1410
|
+
})(Se);
|
|
1411
|
+
var mi = Se.exports;
|
|
1412
|
+
const vi = /* @__PURE__ */ hi(mi);
|
|
1413
|
+
export {
|
|
1414
|
+
vi as D
|
|
1415
|
+
};
|