intl-tel-input 25.14.1 → 25.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -19
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +1 -1
- package/angular/build/IntlTelInputWithUtils.js +125 -186
- package/build/css/intlTelInput-no-assets.css +1259 -0
- package/build/css/intlTelInput-no-assets.min.css +1 -0
- package/build/css/intlTelInput.css +6 -4
- package/build/css/intlTelInput.min.css +1 -1
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/i18n/zh-hk/countries.js +245 -0
- package/build/js/i18n/zh-hk/index.js +5 -0
- package/build/js/i18n/zh-hk/interface.js +14 -0
- package/build/js/intlTelInput.js +2 -2
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +126 -187
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/build/js/utils.js +53 -54
- package/package.json +2 -2
- package/react/README.md +4 -2
- package/react/build/IntlTelInput.cjs +1 -1
- package/react/build/IntlTelInput.js +1 -1
- package/react/build/IntlTelInputWithUtils.cjs +125 -186
- package/react/build/IntlTelInputWithUtils.js +125 -186
- package/svelte/README.md +7 -9
- package/svelte/build/IntlTelInput.mjs +1329 -1329
- package/svelte/build/IntlTelInputWithUtils.mjs +1829 -1890
- package/vue/README.md +7 -9
- package/vue/build/IntlTelInput.mjs +1 -1
- package/vue/build/IntlTelInput.vue.d.ts +34 -0
- package/vue/build/IntlTelInputWithUtils.mjs +125 -186
- package/vue/build/IntlTelInputWithUtils.vue.d.ts +34 -0
- package/vue/build/exports/IntlTelInput.d.ts +3 -0
- package/vue/build/exports/IntlTelInput.mjs +66 -0
- package/vue/build/exports/IntlTelInputWithUtils.d.ts +3 -0
- package/vue/build/exports/IntlTelInputWithUtils.mjs +6207 -0
- package/vue/build/intl-tel-input/data.d.ts +18 -0
- package/vue/build/intl-tel-input/i18n/ar/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/bg/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/bn/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/bs/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/ca/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/cs/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/da/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/de/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/ee/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/el/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/en/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/es/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/fa/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/fi/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/fr/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/hi/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/hr/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/hu/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/id/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/index.d.ts +43 -0
- package/vue/build/intl-tel-input/i18n/it/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/ja/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/ko/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/lt/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/mr/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/nl/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/no/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/pl/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/pt/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/ro/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/ru/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/sk/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/sl/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/sq/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/sr/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/sv/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/te/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/th/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/tr/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/types.d.ts +10 -0
- package/vue/build/intl-tel-input/i18n/uk/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/ur/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/uz/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/vi/index.d.ts +3 -0
- package/vue/build/intl-tel-input/i18n/zh/index.d.ts +3 -0
- package/vue/build/intl-tel-input/intlTelInputWithUtils.d.ts +2 -0
- package/vue/build/intl-tel-input-f0-6rrpA.mjs +3081 -0
- package/vue/build/intl-tel-input.d.ts +97 -0
- package/vue/build/modules/constants.d.ts +85 -0
- package/vue/build/modules/core/countrySearch.d.ts +17 -0
- package/vue/build/modules/core/icons.d.ts +9 -0
- package/vue/build/modules/core/options.d.ts +3 -0
- package/vue/build/modules/core/ui.d.ts +45 -0
- package/vue/build/modules/data/country-data.d.ts +12 -0
- package/vue/build/modules/data/nanp-regionless.d.ts +2 -0
- package/vue/build/modules/format/caret.d.ts +1 -0
- package/vue/build/modules/format/formatting.d.ts +3 -0
- package/vue/build/modules/types/events.d.ts +9 -0
- package/vue/build/modules/types/public-api.d.ts +79 -0
- package/vue/build/modules/utils/dom.d.ts +6 -0
- package/vue/build/modules/utils/string.d.ts +2 -0
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Fn = Object.defineProperty;
|
|
2
2
|
var Te = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
import { onMount as
|
|
9
|
-
const
|
|
5
|
+
var Hn = (e, t, n) => t in e ? Fn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
6
|
+
var tt = (e, t, n) => Hn(e, typeof t != "symbol" ? t + "" : t, n), te = (e, t, n) => t.has(e) || Te("Cannot " + n);
|
|
7
|
+
var A = (e, t, n) => (te(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Z = (e, t, n) => t.has(e) ? Te("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), bt = (e, t, n, i) => (te(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n), lt = (e, t, n) => (te(e, t, "access private method"), n);
|
|
8
|
+
import { onMount as Vn, onDestroy as Wn } from "svelte";
|
|
9
|
+
const jn = "5";
|
|
10
10
|
var qe;
|
|
11
|
-
typeof window < "u" && ((qe = window.__svelte ?? (window.__svelte = {})).v ?? (qe.v = /* @__PURE__ */ new Set())).add(
|
|
12
|
-
const
|
|
13
|
-
var $e = Array.isArray,
|
|
14
|
-
function
|
|
11
|
+
typeof window < "u" && ((qe = window.__svelte ?? (window.__svelte = {})).v ?? (qe.v = /* @__PURE__ */ new Set())).add(jn);
|
|
12
|
+
const Gn = 1, zn = 4, Kn = 8, Yn = 16, qn = 2, P = Symbol(), $n = "http://www.w3.org/1999/xhtml", Xn = "@attach", ce = !1;
|
|
13
|
+
var $e = Array.isArray, Qn = Array.prototype.indexOf, Zn = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, Jn = Object.getOwnPropertyDescriptors, ti = Object.prototype, ei = Array.prototype, Xe = Object.getPrototypeOf;
|
|
14
|
+
function ni(e) {
|
|
15
15
|
for (var t = 0; t < e.length; t++)
|
|
16
16
|
e[t]();
|
|
17
17
|
}
|
|
18
18
|
function Qe() {
|
|
19
|
-
var e, t,
|
|
20
|
-
e =
|
|
19
|
+
var e, t, n = new Promise((i, s) => {
|
|
20
|
+
e = i, t = s;
|
|
21
21
|
});
|
|
22
|
-
return { promise:
|
|
22
|
+
return { promise: n, resolve: e, reject: t };
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const k = 2, Gt = 4, ye = 8, ve = 1 << 24, mt = 16, yt = 32, Pt = 64, Ze = 128, z = 512, U = 1024, W = 2048, rt = 4096, Nt = 8192, J = 16384, be = 32768, Pe = 65536, Oe = 1 << 17, Je = 1 << 18, Zt = 1 << 19, ii = 1 << 20, Ct = 32768, de = 1 << 21, we = 1 << 22, et = 1 << 23, ft = Symbol("$state"), si = Symbol("legacy props"), ri = Symbol(""), wt = new class extends Error {
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
tt(this, "name", "StaleReactionError");
|
|
28
|
+
tt(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
29
29
|
}
|
|
30
30
|
}();
|
|
31
|
-
function
|
|
31
|
+
function oi() {
|
|
32
32
|
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function li(e) {
|
|
35
35
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function ai() {
|
|
38
38
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ui(e) {
|
|
41
41
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function ci() {
|
|
44
44
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function di(e) {
|
|
47
47
|
throw new Error("https://svelte.dev/e/props_invalid_value");
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function fi() {
|
|
50
50
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function hi() {
|
|
53
53
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function pi() {
|
|
56
56
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function _i() {
|
|
59
59
|
console.warn("https://svelte.dev/e/select_multiple_invalid_value");
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function tn(e) {
|
|
62
62
|
return e === this.v;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Ci(e, t) {
|
|
65
65
|
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return !
|
|
67
|
+
function gi(e) {
|
|
68
|
+
return !Ci(e, this.v);
|
|
69
69
|
}
|
|
70
|
-
let
|
|
70
|
+
let mi = !1, X = null;
|
|
71
71
|
function zt(e) {
|
|
72
|
-
|
|
72
|
+
X = e;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
p:
|
|
74
|
+
function yi(e, t = !1, n) {
|
|
75
|
+
X = {
|
|
76
|
+
p: X,
|
|
77
77
|
i: !1,
|
|
78
78
|
c: null,
|
|
79
79
|
e: null,
|
|
@@ -82,42 +82,42 @@ function mn(e, t = !1, i) {
|
|
|
82
82
|
l: null
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function vi(e) {
|
|
86
86
|
var t = (
|
|
87
87
|
/** @type {ComponentContext} */
|
|
88
|
-
|
|
89
|
-
),
|
|
90
|
-
if (
|
|
88
|
+
X
|
|
89
|
+
), n = t.e;
|
|
90
|
+
if (n !== null) {
|
|
91
91
|
t.e = null;
|
|
92
|
-
for (var
|
|
93
|
-
|
|
92
|
+
for (var i of n)
|
|
93
|
+
_n(i);
|
|
94
94
|
}
|
|
95
|
-
return e !== void 0 && (t.x = e), t.i = !0,
|
|
95
|
+
return e !== void 0 && (t.x = e), t.i = !0, X = t.p, e ?? /** @type {T} */
|
|
96
96
|
{};
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function en() {
|
|
99
99
|
return !0;
|
|
100
100
|
}
|
|
101
|
-
let
|
|
102
|
-
function
|
|
103
|
-
var e =
|
|
104
|
-
|
|
101
|
+
let It = [];
|
|
102
|
+
function bi() {
|
|
103
|
+
var e = It;
|
|
104
|
+
It = [], ni(e);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
if (
|
|
108
|
-
var t =
|
|
106
|
+
function Jt(e) {
|
|
107
|
+
if (It.length === 0) {
|
|
108
|
+
var t = It;
|
|
109
109
|
queueMicrotask(() => {
|
|
110
|
-
t ===
|
|
110
|
+
t === It && bi();
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
It.push(e);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
var t =
|
|
115
|
+
function wi(e) {
|
|
116
|
+
var t = N;
|
|
117
117
|
if (t === null)
|
|
118
|
-
return w.f |=
|
|
119
|
-
if ((t.f &
|
|
120
|
-
if ((t.f &
|
|
118
|
+
return w.f |= et, e;
|
|
119
|
+
if ((t.f & be) === 0) {
|
|
120
|
+
if ((t.f & Ze) === 0)
|
|
121
121
|
throw e;
|
|
122
122
|
t.b.error(e);
|
|
123
123
|
} else
|
|
@@ -125,98 +125,111 @@ function bn(e) {
|
|
|
125
125
|
}
|
|
126
126
|
function Kt(e, t) {
|
|
127
127
|
for (; t !== null; ) {
|
|
128
|
-
if ((t.f &
|
|
128
|
+
if ((t.f & Ze) !== 0)
|
|
129
129
|
try {
|
|
130
130
|
t.b.error(e);
|
|
131
131
|
return;
|
|
132
|
-
} catch (
|
|
133
|
-
e =
|
|
132
|
+
} catch (n) {
|
|
133
|
+
e = n;
|
|
134
134
|
}
|
|
135
135
|
t = t.parent;
|
|
136
136
|
}
|
|
137
137
|
throw e;
|
|
138
138
|
}
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
const Ii = -7169;
|
|
140
|
+
function B(e, t) {
|
|
141
|
+
e.f = e.f & Ii | t;
|
|
142
|
+
}
|
|
143
|
+
function Ie(e) {
|
|
144
|
+
(e.f & z) !== 0 || e.deps === null ? B(e, U) : B(e, rt);
|
|
145
|
+
}
|
|
146
|
+
function nn(e) {
|
|
147
|
+
if (e !== null)
|
|
148
|
+
for (const t of e)
|
|
149
|
+
(t.f & k) === 0 || (t.f & Ct) === 0 || (t.f ^= Ct, nn(
|
|
150
|
+
/** @type {Derived} */
|
|
151
|
+
t.deps
|
|
152
|
+
));
|
|
153
|
+
}
|
|
154
|
+
function Ei(e, t, n) {
|
|
155
|
+
(e.f & W) !== 0 ? t.add(e) : (e.f & rt) !== 0 && n.add(e), nn(e.deps), B(e, U);
|
|
156
|
+
}
|
|
157
|
+
const Bt = /* @__PURE__ */ new Set();
|
|
158
|
+
let S = null, R = null, $ = [], Ee = null, fe = !1;
|
|
159
|
+
var Dt, At, ct, dt, Ut, Lt, St, K, he, pe, sn, rn;
|
|
160
|
+
const Qt = class Qt {
|
|
143
161
|
constructor() {
|
|
144
|
-
|
|
145
|
-
|
|
162
|
+
Z(this, K);
|
|
163
|
+
tt(this, "committed", !1);
|
|
146
164
|
/**
|
|
147
165
|
* The current values of any sources that are updated in this batch
|
|
148
166
|
* They keys of this map are identical to `this.#previous`
|
|
149
167
|
* @type {Map<Source, any>}
|
|
150
168
|
*/
|
|
151
|
-
|
|
169
|
+
tt(this, "current", /* @__PURE__ */ new Map());
|
|
152
170
|
/**
|
|
153
171
|
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
154
172
|
* They keys of this map are identical to `this.#current`
|
|
155
173
|
* @type {Map<Source, any>}
|
|
156
174
|
*/
|
|
157
|
-
|
|
175
|
+
tt(this, "previous", /* @__PURE__ */ new Map());
|
|
158
176
|
/**
|
|
159
177
|
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
160
178
|
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
161
179
|
* @type {Set<() => void>}
|
|
162
180
|
*/
|
|
163
|
-
|
|
181
|
+
Z(this, Dt, /* @__PURE__ */ new Set());
|
|
164
182
|
/**
|
|
165
183
|
* If a fork is discarded, we need to destroy any effects that are no longer needed
|
|
166
184
|
* @type {Set<(batch: Batch) => void>}
|
|
167
185
|
*/
|
|
168
|
-
|
|
186
|
+
Z(this, At, /* @__PURE__ */ new Set());
|
|
169
187
|
/**
|
|
170
188
|
* The number of async effects that are currently in flight
|
|
171
189
|
*/
|
|
172
|
-
|
|
190
|
+
Z(this, ct, 0);
|
|
173
191
|
/**
|
|
174
192
|
* The number of async effects that are currently in flight, _not_ inside a pending boundary
|
|
175
193
|
*/
|
|
176
|
-
|
|
194
|
+
Z(this, dt, 0);
|
|
177
195
|
/**
|
|
178
196
|
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
179
197
|
* TODO replace with Promise.withResolvers once supported widely enough
|
|
180
198
|
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
181
199
|
*/
|
|
182
|
-
|
|
200
|
+
Z(this, Ut, null);
|
|
183
201
|
/**
|
|
184
202
|
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
185
203
|
* @type {Set<Effect>}
|
|
186
204
|
*/
|
|
187
|
-
|
|
205
|
+
Z(this, Lt, /* @__PURE__ */ new Set());
|
|
188
206
|
/**
|
|
189
207
|
* Deferred effects that are MAYBE_DIRTY
|
|
190
208
|
* @type {Set<Effect>}
|
|
191
209
|
*/
|
|
192
|
-
|
|
210
|
+
Z(this, St, /* @__PURE__ */ new Set());
|
|
193
211
|
/**
|
|
194
212
|
* A set of branches that still exist, but will be destroyed when this batch
|
|
195
213
|
* is committed — we skip over these during `process`
|
|
196
214
|
* @type {Set<Effect>}
|
|
197
215
|
*/
|
|
198
|
-
|
|
199
|
-
|
|
216
|
+
tt(this, "skipped_effects", /* @__PURE__ */ new Set());
|
|
217
|
+
tt(this, "is_fork", !1);
|
|
200
218
|
}
|
|
201
219
|
is_deferred() {
|
|
202
|
-
return this.is_fork ||
|
|
220
|
+
return this.is_fork || A(this, dt) > 0;
|
|
203
221
|
}
|
|
204
222
|
/**
|
|
205
223
|
*
|
|
206
224
|
* @param {Effect[]} root_effects
|
|
207
225
|
*/
|
|
208
226
|
process(t) {
|
|
209
|
-
var
|
|
227
|
+
var s;
|
|
210
228
|
$ = [], this.apply();
|
|
211
|
-
var i =
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
render_effects: []
|
|
216
|
-
};
|
|
217
|
-
for (const s of t)
|
|
218
|
-
K(this, k, pe).call(this, s, i);
|
|
219
|
-
this.is_fork || K(this, k, ni).call(this), this.is_deferred() ? (K(this, k, Rt).call(this, i.effects), K(this, k, Rt).call(this, i.render_effects)) : (N = null, Re(i.render_effects), Re(i.effects), (n = L(this, xt)) == null || n.resolve()), P = null;
|
|
229
|
+
var n = [], i = [];
|
|
230
|
+
for (const r of t)
|
|
231
|
+
lt(this, K, he).call(this, r, n, i);
|
|
232
|
+
this.is_fork || lt(this, K, sn).call(this), this.is_deferred() ? (lt(this, K, pe).call(this, i), lt(this, K, pe).call(this, n)) : (S = null, Re(i), Re(n), (s = A(this, Ut)) == null || s.resolve()), R = null;
|
|
220
233
|
}
|
|
221
234
|
/**
|
|
222
235
|
* Associate a change to a given source with the current
|
|
@@ -224,194 +237,172 @@ const Zt = class Zt {
|
|
|
224
237
|
* @param {Source} source
|
|
225
238
|
* @param {any} value
|
|
226
239
|
*/
|
|
227
|
-
capture(t,
|
|
228
|
-
this.previous.has(t)
|
|
240
|
+
capture(t, n) {
|
|
241
|
+
n !== P && !this.previous.has(t) && this.previous.set(t, n), (t.f & et) === 0 && (this.current.set(t, t.v), R == null || R.set(t, t.v));
|
|
229
242
|
}
|
|
230
243
|
activate() {
|
|
231
|
-
|
|
244
|
+
S = this, this.apply();
|
|
232
245
|
}
|
|
233
246
|
deactivate() {
|
|
234
|
-
|
|
247
|
+
S === this && (S = null, R = null);
|
|
235
248
|
}
|
|
236
249
|
flush() {
|
|
237
250
|
if (this.activate(), $.length > 0) {
|
|
238
|
-
if (
|
|
251
|
+
if (Ni(), S !== null && S !== this)
|
|
239
252
|
return;
|
|
240
|
-
} else
|
|
253
|
+
} else A(this, ct) === 0 && this.process([]);
|
|
241
254
|
this.deactivate();
|
|
242
255
|
}
|
|
243
256
|
discard() {
|
|
244
|
-
for (const t of
|
|
245
|
-
|
|
257
|
+
for (const t of A(this, At)) t(this);
|
|
258
|
+
A(this, At).clear();
|
|
246
259
|
}
|
|
247
260
|
/**
|
|
248
261
|
*
|
|
249
262
|
* @param {boolean} blocking
|
|
250
263
|
*/
|
|
251
264
|
increment(t) {
|
|
252
|
-
|
|
265
|
+
bt(this, ct, A(this, ct) + 1), t && bt(this, dt, A(this, dt) + 1);
|
|
253
266
|
}
|
|
254
267
|
/**
|
|
255
268
|
*
|
|
256
269
|
* @param {boolean} blocking
|
|
257
270
|
*/
|
|
258
271
|
decrement(t) {
|
|
259
|
-
|
|
272
|
+
bt(this, ct, A(this, ct) - 1), t && bt(this, dt, A(this, dt) - 1), this.revive();
|
|
260
273
|
}
|
|
261
274
|
revive() {
|
|
262
|
-
for (const t of
|
|
263
|
-
|
|
264
|
-
for (const t of
|
|
265
|
-
|
|
275
|
+
for (const t of A(this, Lt))
|
|
276
|
+
A(this, St).delete(t), B(t, W), Tt(t);
|
|
277
|
+
for (const t of A(this, St))
|
|
278
|
+
B(t, rt), Tt(t);
|
|
266
279
|
this.flush();
|
|
267
280
|
}
|
|
268
281
|
/** @param {() => void} fn */
|
|
269
282
|
oncommit(t) {
|
|
270
|
-
|
|
283
|
+
A(this, Dt).add(t);
|
|
271
284
|
}
|
|
272
285
|
/** @param {(batch: Batch) => void} fn */
|
|
273
286
|
ondiscard(t) {
|
|
274
|
-
|
|
287
|
+
A(this, At).add(t);
|
|
275
288
|
}
|
|
276
289
|
settled() {
|
|
277
|
-
return (
|
|
290
|
+
return (A(this, Ut) ?? bt(this, Ut, Qe())).promise;
|
|
278
291
|
}
|
|
279
292
|
static ensure() {
|
|
280
|
-
if (
|
|
281
|
-
const t =
|
|
282
|
-
|
|
283
|
-
|
|
293
|
+
if (S === null) {
|
|
294
|
+
const t = S = new Qt();
|
|
295
|
+
Bt.add(S), Qt.enqueue(() => {
|
|
296
|
+
S === t && t.flush();
|
|
284
297
|
});
|
|
285
298
|
}
|
|
286
|
-
return
|
|
299
|
+
return S;
|
|
287
300
|
}
|
|
288
301
|
/** @param {() => void} task */
|
|
289
302
|
static enqueue(t) {
|
|
290
|
-
|
|
303
|
+
Jt(t);
|
|
291
304
|
}
|
|
292
305
|
apply() {
|
|
293
306
|
}
|
|
294
307
|
};
|
|
295
|
-
|
|
308
|
+
Dt = new WeakMap(), At = new WeakMap(), ct = new WeakMap(), dt = new WeakMap(), Ut = new WeakMap(), Lt = new WeakMap(), St = new WeakMap(), K = new WeakSet(), /**
|
|
296
309
|
* Traverse the effect tree, executing effects or stashing
|
|
297
310
|
* them for later execution as appropriate
|
|
298
311
|
* @param {Effect} root
|
|
299
|
-
* @param {
|
|
312
|
+
* @param {Effect[]} effects
|
|
313
|
+
* @param {Effect[]} render_effects
|
|
300
314
|
*/
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
t.
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
render_effects: []
|
|
311
|
-
}), !l && n.fn !== null) {
|
|
312
|
-
r ? n.f ^= B : (s & ve) !== 0 ? i.effects.push(n) : Bt(n) && ((n.f & Ct) !== 0 && L(this, At).add(n), Ut(n));
|
|
313
|
-
var u = n.first;
|
|
314
|
-
if (u !== null) {
|
|
315
|
-
n = u;
|
|
315
|
+
he = function(t, n, i) {
|
|
316
|
+
t.f ^= U;
|
|
317
|
+
for (var s = t.first, r = null; s !== null; ) {
|
|
318
|
+
var o = s.f, l = (o & (yt | Pt)) !== 0, a = l && (o & U) !== 0, u = a || (o & Nt) !== 0 || this.skipped_effects.has(s);
|
|
319
|
+
if (!u && s.fn !== null) {
|
|
320
|
+
l ? s.f ^= U : r !== null && (o & (Gt | ye | ve)) !== 0 ? r.b.defer_effect(s) : (o & Gt) !== 0 ? n.push(s) : xt(s) && ((o & mt) !== 0 && A(this, Lt).add(s), Mt(s));
|
|
321
|
+
var c = s.first;
|
|
322
|
+
if (c !== null) {
|
|
323
|
+
s = c;
|
|
316
324
|
continue;
|
|
317
325
|
}
|
|
318
326
|
}
|
|
319
|
-
var
|
|
320
|
-
for (
|
|
321
|
-
|
|
322
|
-
i.parent), n = a.next, a = a.parent;
|
|
327
|
+
var d = s.parent;
|
|
328
|
+
for (s = s.next; s === null && d !== null; )
|
|
329
|
+
d === r && (r = null), s = d.next, d = d.parent;
|
|
323
330
|
}
|
|
324
331
|
}, /**
|
|
325
332
|
* @param {Effect[]} effects
|
|
326
333
|
*/
|
|
327
|
-
|
|
328
|
-
for (
|
|
329
|
-
(
|
|
330
|
-
},
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
i.deps
|
|
340
|
-
));
|
|
341
|
-
}, ni = function() {
|
|
342
|
-
if (L(this, ut) === 0) {
|
|
343
|
-
for (const t of L(this, Nt)) t();
|
|
344
|
-
L(this, Nt).clear();
|
|
345
|
-
}
|
|
346
|
-
L(this, at) === 0 && K(this, k, si).call(this);
|
|
347
|
-
}, si = function() {
|
|
348
|
-
var r;
|
|
349
|
-
if (Ft.size > 1) {
|
|
334
|
+
pe = function(t) {
|
|
335
|
+
for (var n = 0; n < t.length; n += 1)
|
|
336
|
+
Ei(t[n], A(this, Lt), A(this, St));
|
|
337
|
+
}, sn = function() {
|
|
338
|
+
if (A(this, dt) === 0) {
|
|
339
|
+
for (const t of A(this, Dt)) t();
|
|
340
|
+
A(this, Dt).clear();
|
|
341
|
+
}
|
|
342
|
+
A(this, ct) === 0 && lt(this, K, rn).call(this);
|
|
343
|
+
}, rn = function() {
|
|
344
|
+
var s;
|
|
345
|
+
if (Bt.size > 1) {
|
|
350
346
|
this.previous.clear();
|
|
351
|
-
var t =
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
render_effects: []
|
|
356
|
-
};
|
|
357
|
-
for (const o of Ft) {
|
|
358
|
-
if (o === this) {
|
|
359
|
-
i = !1;
|
|
347
|
+
var t = R, n = !0;
|
|
348
|
+
for (const r of Bt) {
|
|
349
|
+
if (r === this) {
|
|
350
|
+
n = !1;
|
|
360
351
|
continue;
|
|
361
352
|
}
|
|
362
|
-
const
|
|
363
|
-
for (const [a,
|
|
364
|
-
if (
|
|
365
|
-
if (
|
|
366
|
-
|
|
353
|
+
const o = [];
|
|
354
|
+
for (const [a, u] of this.current) {
|
|
355
|
+
if (r.current.has(a))
|
|
356
|
+
if (n && u !== r.current.get(a))
|
|
357
|
+
r.current.set(a, u);
|
|
367
358
|
else
|
|
368
359
|
continue;
|
|
369
|
-
|
|
360
|
+
o.push(a);
|
|
370
361
|
}
|
|
371
|
-
if (
|
|
362
|
+
if (o.length === 0)
|
|
372
363
|
continue;
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
375
|
-
var
|
|
364
|
+
const l = [...r.current.keys()].filter((a) => !this.current.has(a));
|
|
365
|
+
if (l.length > 0) {
|
|
366
|
+
var i = $;
|
|
376
367
|
$ = [];
|
|
377
|
-
const a = /* @__PURE__ */ new Set(),
|
|
378
|
-
for (const
|
|
379
|
-
|
|
368
|
+
const a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
|
|
369
|
+
for (const c of o)
|
|
370
|
+
on(c, l, a, u);
|
|
380
371
|
if ($.length > 0) {
|
|
381
|
-
|
|
382
|
-
for (const
|
|
383
|
-
|
|
384
|
-
|
|
372
|
+
S = r, r.apply();
|
|
373
|
+
for (const c of $)
|
|
374
|
+
lt(s = r, K, he).call(s, c, [], []);
|
|
375
|
+
r.deactivate();
|
|
385
376
|
}
|
|
386
|
-
$ =
|
|
377
|
+
$ = i;
|
|
387
378
|
}
|
|
388
379
|
}
|
|
389
|
-
|
|
380
|
+
S = null, R = t;
|
|
390
381
|
}
|
|
391
|
-
this.committed = !0,
|
|
382
|
+
this.committed = !0, Bt.delete(this);
|
|
392
383
|
};
|
|
393
|
-
let Yt =
|
|
394
|
-
function
|
|
395
|
-
var e =
|
|
396
|
-
|
|
384
|
+
let Yt = Qt;
|
|
385
|
+
function Ni() {
|
|
386
|
+
var e = ht;
|
|
387
|
+
fe = !0;
|
|
397
388
|
var t = null;
|
|
398
389
|
try {
|
|
399
|
-
var
|
|
400
|
-
for (
|
|
401
|
-
var
|
|
402
|
-
if (
|
|
390
|
+
var n = 0;
|
|
391
|
+
for ($t(!0); $.length > 0; ) {
|
|
392
|
+
var i = Yt.ensure();
|
|
393
|
+
if (n++ > 1e3) {
|
|
403
394
|
var s, r;
|
|
404
|
-
|
|
395
|
+
Di();
|
|
405
396
|
}
|
|
406
|
-
|
|
397
|
+
i.process($), nt.clear();
|
|
407
398
|
}
|
|
408
399
|
} finally {
|
|
409
|
-
|
|
400
|
+
fe = !1, $t(e), Ee = null;
|
|
410
401
|
}
|
|
411
402
|
}
|
|
412
|
-
function
|
|
403
|
+
function Di() {
|
|
413
404
|
try {
|
|
414
|
-
|
|
405
|
+
ci();
|
|
415
406
|
} catch (e) {
|
|
416
407
|
Kt(e, Ee);
|
|
417
408
|
}
|
|
@@ -420,19 +411,19 @@ let Y = null;
|
|
|
420
411
|
function Re(e) {
|
|
421
412
|
var t = e.length;
|
|
422
413
|
if (t !== 0) {
|
|
423
|
-
for (var
|
|
424
|
-
var
|
|
425
|
-
if ((
|
|
426
|
-
|
|
414
|
+
for (var n = 0; n < t; ) {
|
|
415
|
+
var i = e[n++];
|
|
416
|
+
if ((i.f & (J | Nt)) === 0 && xt(i) && (Y = /* @__PURE__ */ new Set(), Mt(i), i.deps === null && i.first === null && i.nodes === null && (i.teardown === null && i.ac === null ? vn(i) : i.fn = null), (Y == null ? void 0 : Y.size) > 0)) {
|
|
417
|
+
nt.clear();
|
|
427
418
|
for (const s of Y) {
|
|
428
|
-
if ((s.f & (
|
|
419
|
+
if ((s.f & (J | Nt)) !== 0) continue;
|
|
429
420
|
const r = [s];
|
|
430
421
|
let o = s.parent;
|
|
431
422
|
for (; o !== null; )
|
|
432
423
|
Y.has(o) && (Y.delete(o), r.push(o)), o = o.parent;
|
|
433
424
|
for (let l = r.length - 1; l >= 0; l--) {
|
|
434
|
-
const
|
|
435
|
-
(
|
|
425
|
+
const a = r[l];
|
|
426
|
+
(a.f & (J | Nt)) === 0 && Mt(a);
|
|
436
427
|
}
|
|
437
428
|
}
|
|
438
429
|
Y.clear();
|
|
@@ -441,204 +432,204 @@ function Re(e) {
|
|
|
441
432
|
Y = null;
|
|
442
433
|
}
|
|
443
434
|
}
|
|
444
|
-
function
|
|
445
|
-
if (!
|
|
435
|
+
function on(e, t, n, i) {
|
|
436
|
+
if (!n.has(e) && (n.add(e), e.reactions !== null))
|
|
446
437
|
for (const s of e.reactions) {
|
|
447
438
|
const r = s.f;
|
|
448
|
-
(r &
|
|
439
|
+
(r & k) !== 0 ? on(
|
|
449
440
|
/** @type {Derived} */
|
|
450
441
|
s,
|
|
451
442
|
t,
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
) : (r & (
|
|
443
|
+
n,
|
|
444
|
+
i
|
|
445
|
+
) : (r & (we | mt)) !== 0 && (r & W) === 0 && ln(s, t, i) && (B(s, W), Tt(
|
|
455
446
|
/** @type {Effect} */
|
|
456
447
|
s
|
|
457
448
|
));
|
|
458
449
|
}
|
|
459
450
|
}
|
|
460
|
-
function
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
451
|
+
function ln(e, t, n) {
|
|
452
|
+
const i = n.get(e);
|
|
453
|
+
if (i !== void 0) return i;
|
|
463
454
|
if (e.deps !== null)
|
|
464
455
|
for (const s of e.deps) {
|
|
465
456
|
if (t.includes(s))
|
|
466
457
|
return !0;
|
|
467
|
-
if ((s.f &
|
|
458
|
+
if ((s.f & k) !== 0 && ln(
|
|
468
459
|
/** @type {Derived} */
|
|
469
460
|
s,
|
|
470
461
|
t,
|
|
471
|
-
|
|
462
|
+
n
|
|
472
463
|
))
|
|
473
|
-
return
|
|
464
|
+
return n.set(
|
|
474
465
|
/** @type {Derived} */
|
|
475
466
|
s,
|
|
476
467
|
!0
|
|
477
468
|
), !0;
|
|
478
469
|
}
|
|
479
|
-
return
|
|
470
|
+
return n.set(e, !1), !1;
|
|
480
471
|
}
|
|
481
|
-
function
|
|
472
|
+
function Tt(e) {
|
|
482
473
|
for (var t = Ee = e; t.parent !== null; ) {
|
|
483
474
|
t = t.parent;
|
|
484
|
-
var
|
|
485
|
-
if (
|
|
475
|
+
var n = t.f;
|
|
476
|
+
if (fe && t === N && (n & mt) !== 0 && (n & Je) === 0)
|
|
486
477
|
return;
|
|
487
|
-
if ((
|
|
488
|
-
if ((
|
|
489
|
-
t.f ^=
|
|
478
|
+
if ((n & (Pt | yt)) !== 0) {
|
|
479
|
+
if ((n & U) === 0) return;
|
|
480
|
+
t.f ^= U;
|
|
490
481
|
}
|
|
491
482
|
}
|
|
492
483
|
$.push(t);
|
|
493
484
|
}
|
|
494
|
-
function
|
|
485
|
+
function Ai(e, t, n, i) {
|
|
495
486
|
const s = Ne;
|
|
496
|
-
if (
|
|
497
|
-
|
|
487
|
+
if (n.length === 0 && e.length === 0) {
|
|
488
|
+
i(t.map(s));
|
|
498
489
|
return;
|
|
499
490
|
}
|
|
500
|
-
var r =
|
|
491
|
+
var r = S, o = (
|
|
501
492
|
/** @type {Effect} */
|
|
502
|
-
|
|
503
|
-
), l =
|
|
504
|
-
function
|
|
505
|
-
Promise.all(
|
|
493
|
+
N
|
|
494
|
+
), l = Li();
|
|
495
|
+
function a() {
|
|
496
|
+
Promise.all(n.map((u) => /* @__PURE__ */ Si(u))).then((u) => {
|
|
506
497
|
l();
|
|
507
498
|
try {
|
|
508
|
-
|
|
499
|
+
i([...t.map(s), ...u]);
|
|
509
500
|
} catch (c) {
|
|
510
|
-
(o.f &
|
|
501
|
+
(o.f & J) === 0 && Kt(c, o);
|
|
511
502
|
}
|
|
512
503
|
r == null || r.deactivate(), qt();
|
|
513
|
-
}).catch((
|
|
514
|
-
Kt(
|
|
504
|
+
}).catch((u) => {
|
|
505
|
+
Kt(u, o);
|
|
515
506
|
});
|
|
516
507
|
}
|
|
517
508
|
e.length > 0 ? Promise.all(e).then(() => {
|
|
518
509
|
l();
|
|
519
510
|
try {
|
|
520
|
-
return
|
|
511
|
+
return a();
|
|
521
512
|
} finally {
|
|
522
513
|
r == null || r.deactivate(), qt();
|
|
523
514
|
}
|
|
524
|
-
}) :
|
|
515
|
+
}) : a();
|
|
525
516
|
}
|
|
526
|
-
function
|
|
527
|
-
var e =
|
|
517
|
+
function Li() {
|
|
518
|
+
var e = N, t = w, n = X, i = S;
|
|
528
519
|
return function(r = !0) {
|
|
529
|
-
|
|
520
|
+
st(e), Q(t), zt(n), r && (i == null || i.activate());
|
|
530
521
|
};
|
|
531
522
|
}
|
|
532
523
|
function qt() {
|
|
533
|
-
|
|
524
|
+
st(null), Q(null), zt(null);
|
|
534
525
|
}
|
|
535
526
|
// @__NO_SIDE_EFFECTS__
|
|
536
527
|
function Ne(e) {
|
|
537
|
-
var t =
|
|
528
|
+
var t = k | W, n = w !== null && (w.f & k) !== 0 ? (
|
|
538
529
|
/** @type {Derived} */
|
|
539
530
|
w
|
|
540
531
|
) : null;
|
|
541
|
-
return
|
|
542
|
-
ctx:
|
|
532
|
+
return N !== null && (N.f |= Zt), {
|
|
533
|
+
ctx: X,
|
|
543
534
|
deps: null,
|
|
544
535
|
effects: null,
|
|
545
|
-
equals:
|
|
536
|
+
equals: tn,
|
|
546
537
|
f: t,
|
|
547
538
|
fn: e,
|
|
548
539
|
reactions: null,
|
|
549
540
|
rv: 0,
|
|
550
541
|
v: (
|
|
551
542
|
/** @type {V} */
|
|
552
|
-
|
|
543
|
+
P
|
|
553
544
|
),
|
|
554
545
|
wv: 0,
|
|
555
|
-
parent:
|
|
546
|
+
parent: n ?? N,
|
|
556
547
|
ac: null
|
|
557
548
|
};
|
|
558
549
|
}
|
|
559
550
|
// @__NO_SIDE_EFFECTS__
|
|
560
|
-
function
|
|
551
|
+
function Si(e, t, n) {
|
|
561
552
|
let i = (
|
|
562
553
|
/** @type {Effect | null} */
|
|
563
|
-
|
|
554
|
+
N
|
|
564
555
|
);
|
|
565
|
-
i === null &&
|
|
566
|
-
var
|
|
556
|
+
i === null && oi();
|
|
557
|
+
var s = (
|
|
567
558
|
/** @type {Boundary} */
|
|
568
559
|
i.b
|
|
569
|
-
),
|
|
560
|
+
), r = (
|
|
570
561
|
/** @type {Promise<V>} */
|
|
571
562
|
/** @type {unknown} */
|
|
572
563
|
void 0
|
|
573
|
-
),
|
|
564
|
+
), o = dn(
|
|
574
565
|
/** @type {V} */
|
|
575
|
-
|
|
576
|
-
),
|
|
577
|
-
return
|
|
578
|
-
var
|
|
566
|
+
P
|
|
567
|
+
), l = !w, a = /* @__PURE__ */ new Map();
|
|
568
|
+
return ji(() => {
|
|
569
|
+
var p;
|
|
579
570
|
var u = Qe();
|
|
580
|
-
|
|
571
|
+
r = u.promise;
|
|
581
572
|
try {
|
|
582
573
|
Promise.resolve(e()).then(u.resolve, u.reject).then(() => {
|
|
583
|
-
|
|
574
|
+
c === S && c.committed && c.deactivate(), qt();
|
|
584
575
|
});
|
|
585
|
-
} catch (
|
|
586
|
-
u.reject(
|
|
576
|
+
} catch (C) {
|
|
577
|
+
u.reject(C), qt();
|
|
587
578
|
}
|
|
588
|
-
var
|
|
579
|
+
var c = (
|
|
589
580
|
/** @type {Batch} */
|
|
590
|
-
|
|
581
|
+
S
|
|
591
582
|
);
|
|
592
|
-
if (
|
|
593
|
-
var
|
|
594
|
-
|
|
583
|
+
if (l) {
|
|
584
|
+
var d = s.is_rendered();
|
|
585
|
+
s.update_pending_count(1), c.increment(d), (p = a.get(c)) == null || p.reject(wt), a.delete(c), a.set(c, u);
|
|
595
586
|
}
|
|
596
|
-
const
|
|
597
|
-
if (
|
|
598
|
-
|
|
587
|
+
const f = (C, y = void 0) => {
|
|
588
|
+
if (c.activate(), y)
|
|
589
|
+
y !== wt && (o.f |= et, Ce(o, y));
|
|
599
590
|
else {
|
|
600
|
-
(
|
|
601
|
-
for (const [b,
|
|
602
|
-
if (
|
|
603
|
-
|
|
591
|
+
(o.f & et) !== 0 && (o.f ^= et), Ce(o, C);
|
|
592
|
+
for (const [b, g] of a) {
|
|
593
|
+
if (a.delete(b), b === c) break;
|
|
594
|
+
g.reject(wt);
|
|
604
595
|
}
|
|
605
596
|
}
|
|
606
|
-
|
|
597
|
+
l && (s.update_pending_count(-1), c.decrement(d));
|
|
607
598
|
};
|
|
608
|
-
u.promise.then(
|
|
609
|
-
}),
|
|
610
|
-
for (const u of
|
|
611
|
-
u.reject(
|
|
599
|
+
u.promise.then(f, (C) => f(null, C || "unknown"));
|
|
600
|
+
}), pn(() => {
|
|
601
|
+
for (const u of a.values())
|
|
602
|
+
u.reject(wt);
|
|
612
603
|
}), new Promise((u) => {
|
|
613
|
-
function
|
|
614
|
-
function
|
|
615
|
-
|
|
604
|
+
function c(d) {
|
|
605
|
+
function f() {
|
|
606
|
+
d === r ? u(o) : c(r);
|
|
616
607
|
}
|
|
617
|
-
|
|
608
|
+
d.then(f, f);
|
|
618
609
|
}
|
|
619
|
-
|
|
610
|
+
c(r);
|
|
620
611
|
});
|
|
621
612
|
}
|
|
622
613
|
// @__NO_SIDE_EFFECTS__
|
|
623
|
-
function
|
|
614
|
+
function Ti(e) {
|
|
624
615
|
const t = /* @__PURE__ */ Ne(e);
|
|
625
|
-
return t.equals =
|
|
616
|
+
return t.equals = gi, t;
|
|
626
617
|
}
|
|
627
|
-
function
|
|
618
|
+
function an(e) {
|
|
628
619
|
var t = e.effects;
|
|
629
620
|
if (t !== null) {
|
|
630
621
|
e.effects = null;
|
|
631
|
-
for (var
|
|
632
|
-
|
|
622
|
+
for (var n = 0; n < t.length; n += 1)
|
|
623
|
+
gt(
|
|
633
624
|
/** @type {Effect} */
|
|
634
|
-
t[
|
|
625
|
+
t[n]
|
|
635
626
|
);
|
|
636
627
|
}
|
|
637
628
|
}
|
|
638
|
-
function
|
|
629
|
+
function Pi(e) {
|
|
639
630
|
for (var t = e.parent; t !== null; ) {
|
|
640
|
-
if ((t.f &
|
|
641
|
-
return (t.f &
|
|
631
|
+
if ((t.f & k) === 0)
|
|
632
|
+
return (t.f & J) === 0 ? (
|
|
642
633
|
/** @type {Effect} */
|
|
643
634
|
t
|
|
644
635
|
) : null;
|
|
@@ -647,162 +638,164 @@ function Ln(e) {
|
|
|
647
638
|
return null;
|
|
648
639
|
}
|
|
649
640
|
function De(e) {
|
|
650
|
-
var t,
|
|
651
|
-
|
|
641
|
+
var t, n = N;
|
|
642
|
+
st(Pi(e));
|
|
652
643
|
try {
|
|
653
|
-
e.f &= ~
|
|
644
|
+
e.f &= ~Ct, an(e), t = En(e);
|
|
654
645
|
} finally {
|
|
655
|
-
|
|
646
|
+
st(n);
|
|
656
647
|
}
|
|
657
648
|
return t;
|
|
658
649
|
}
|
|
659
|
-
function
|
|
650
|
+
function un(e) {
|
|
660
651
|
var t = De(e);
|
|
661
|
-
if (e.equals(t)
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
H(e, i);
|
|
667
|
-
}
|
|
652
|
+
if (!e.equals(t) && (e.wv = wn(), (!(S != null && S.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) {
|
|
653
|
+
B(e, U);
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
it || (R !== null ? (hn() || S != null && S.is_fork) && R.set(e, t) : Ie(e));
|
|
668
657
|
}
|
|
669
|
-
let
|
|
670
|
-
const
|
|
671
|
-
let
|
|
672
|
-
function
|
|
673
|
-
var
|
|
658
|
+
let _e = /* @__PURE__ */ new Set();
|
|
659
|
+
const nt = /* @__PURE__ */ new Map();
|
|
660
|
+
let cn = !1;
|
|
661
|
+
function dn(e, t) {
|
|
662
|
+
var n = {
|
|
674
663
|
f: 0,
|
|
675
664
|
// TODO ideally we could skip this altogether, but it causes type errors
|
|
676
665
|
v: e,
|
|
677
666
|
reactions: null,
|
|
678
|
-
equals:
|
|
667
|
+
equals: tn,
|
|
679
668
|
rv: 0,
|
|
680
669
|
wv: 0
|
|
681
670
|
};
|
|
682
|
-
return
|
|
671
|
+
return n;
|
|
683
672
|
}
|
|
684
673
|
// @__NO_SIDE_EFFECTS__
|
|
685
|
-
function
|
|
686
|
-
const
|
|
687
|
-
return
|
|
674
|
+
function G(e, t) {
|
|
675
|
+
const n = dn(e);
|
|
676
|
+
return Yi(n), n;
|
|
688
677
|
}
|
|
689
|
-
function
|
|
678
|
+
function V(e, t, n = !1) {
|
|
690
679
|
w !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
691
680
|
// to ensure we error if state is set inside an inspect effect
|
|
692
|
-
(!
|
|
693
|
-
let
|
|
694
|
-
return
|
|
681
|
+
(!q || (w.f & Oe) !== 0) && en() && (w.f & (k | mt | we | Oe)) !== 0 && !(x != null && x.includes(e)) && pi();
|
|
682
|
+
let i = n ? Et(t) : t;
|
|
683
|
+
return Ce(e, i);
|
|
695
684
|
}
|
|
696
|
-
function
|
|
685
|
+
function Ce(e, t) {
|
|
697
686
|
if (!e.equals(t)) {
|
|
698
|
-
var
|
|
699
|
-
|
|
700
|
-
var
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
687
|
+
var n = e.v;
|
|
688
|
+
it ? nt.set(e, t) : nt.set(e, n), e.v = t;
|
|
689
|
+
var i = Yt.ensure();
|
|
690
|
+
if (i.capture(e, n), (e.f & k) !== 0) {
|
|
691
|
+
const s = (
|
|
692
|
+
/** @type {Derived} */
|
|
693
|
+
e
|
|
694
|
+
);
|
|
695
|
+
(e.f & W) !== 0 && De(s), Ie(s);
|
|
696
|
+
}
|
|
697
|
+
e.wv = wn(), fn(e, W), N !== null && (N.f & U) !== 0 && (N.f & (yt | Pt)) === 0 && (j === null ? qi([e]) : j.push(e)), !i.is_fork && _e.size > 0 && !cn && Oi();
|
|
705
698
|
}
|
|
706
699
|
return t;
|
|
707
700
|
}
|
|
708
|
-
function
|
|
709
|
-
|
|
710
|
-
var e =
|
|
711
|
-
|
|
712
|
-
const t = Array.from(
|
|
701
|
+
function Oi() {
|
|
702
|
+
cn = !1;
|
|
703
|
+
var e = ht;
|
|
704
|
+
$t(!0);
|
|
705
|
+
const t = Array.from(_e);
|
|
713
706
|
try {
|
|
714
|
-
for (const
|
|
715
|
-
(
|
|
707
|
+
for (const n of t)
|
|
708
|
+
(n.f & U) !== 0 && B(n, rt), xt(n) && Mt(n);
|
|
716
709
|
} finally {
|
|
717
|
-
|
|
710
|
+
$t(e);
|
|
718
711
|
}
|
|
719
|
-
|
|
712
|
+
_e.clear();
|
|
720
713
|
}
|
|
721
|
-
function
|
|
722
|
-
|
|
714
|
+
function ee(e) {
|
|
715
|
+
V(e, e.v + 1);
|
|
723
716
|
}
|
|
724
|
-
function
|
|
725
|
-
var
|
|
726
|
-
if (
|
|
727
|
-
for (var
|
|
728
|
-
var r =
|
|
729
|
-
if (l &&
|
|
730
|
-
var
|
|
717
|
+
function fn(e, t) {
|
|
718
|
+
var n = e.reactions;
|
|
719
|
+
if (n !== null)
|
|
720
|
+
for (var i = n.length, s = 0; s < i; s++) {
|
|
721
|
+
var r = n[s], o = r.f, l = (o & W) === 0;
|
|
722
|
+
if (l && B(r, t), (o & k) !== 0) {
|
|
723
|
+
var a = (
|
|
731
724
|
/** @type {Derived} */
|
|
732
725
|
r
|
|
733
726
|
);
|
|
734
|
-
|
|
735
|
-
} else l && ((o &
|
|
727
|
+
R == null || R.delete(a), (o & Ct) === 0 && (o & z && (r.f |= Ct), fn(a, rt));
|
|
728
|
+
} else l && ((o & mt) !== 0 && Y !== null && Y.add(
|
|
736
729
|
/** @type {Effect} */
|
|
737
730
|
r
|
|
738
|
-
),
|
|
731
|
+
), Tt(
|
|
739
732
|
/** @type {Effect} */
|
|
740
733
|
r
|
|
741
734
|
));
|
|
742
735
|
}
|
|
743
736
|
}
|
|
744
|
-
function
|
|
745
|
-
if (typeof e != "object" || e === null ||
|
|
737
|
+
function Et(e) {
|
|
738
|
+
if (typeof e != "object" || e === null || ft in e)
|
|
746
739
|
return e;
|
|
747
740
|
const t = Xe(e);
|
|
748
|
-
if (t !==
|
|
741
|
+
if (t !== ti && t !== ei)
|
|
749
742
|
return e;
|
|
750
|
-
var
|
|
751
|
-
if (
|
|
743
|
+
var n = /* @__PURE__ */ new Map(), i = $e(e), s = /* @__PURE__ */ G(0), r = pt, o = (l) => {
|
|
744
|
+
if (pt === r)
|
|
752
745
|
return l();
|
|
753
|
-
var
|
|
754
|
-
|
|
746
|
+
var a = w, u = pt;
|
|
747
|
+
Q(null), Ue(r);
|
|
755
748
|
var c = l();
|
|
756
|
-
return
|
|
749
|
+
return Q(a), Ue(u), c;
|
|
757
750
|
};
|
|
758
|
-
return
|
|
751
|
+
return i && n.set("length", /* @__PURE__ */ G(
|
|
759
752
|
/** @type {any[]} */
|
|
760
753
|
e.length
|
|
761
754
|
)), new Proxy(
|
|
762
755
|
/** @type {any} */
|
|
763
756
|
e,
|
|
764
757
|
{
|
|
765
|
-
defineProperty(l,
|
|
766
|
-
(!("value" in
|
|
767
|
-
var c =
|
|
758
|
+
defineProperty(l, a, u) {
|
|
759
|
+
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && fi();
|
|
760
|
+
var c = n.get(a);
|
|
768
761
|
return c === void 0 ? c = o(() => {
|
|
769
|
-
var d = /* @__PURE__ */
|
|
770
|
-
return
|
|
771
|
-
}) :
|
|
762
|
+
var d = /* @__PURE__ */ G(u.value);
|
|
763
|
+
return n.set(a, d), d;
|
|
764
|
+
}) : V(c, u.value, !0), !0;
|
|
772
765
|
},
|
|
773
|
-
deleteProperty(l,
|
|
774
|
-
var
|
|
775
|
-
if (
|
|
776
|
-
if (
|
|
777
|
-
const c = o(() => /* @__PURE__ */
|
|
778
|
-
|
|
766
|
+
deleteProperty(l, a) {
|
|
767
|
+
var u = n.get(a);
|
|
768
|
+
if (u === void 0) {
|
|
769
|
+
if (a in l) {
|
|
770
|
+
const c = o(() => /* @__PURE__ */ G(P));
|
|
771
|
+
n.set(a, c), ee(s);
|
|
779
772
|
}
|
|
780
773
|
} else
|
|
781
|
-
|
|
774
|
+
V(u, P), ee(s);
|
|
782
775
|
return !0;
|
|
783
776
|
},
|
|
784
|
-
get(l,
|
|
785
|
-
var
|
|
786
|
-
if (
|
|
777
|
+
get(l, a, u) {
|
|
778
|
+
var p;
|
|
779
|
+
if (a === ft)
|
|
787
780
|
return e;
|
|
788
|
-
var c =
|
|
789
|
-
if (c === void 0 && (!d || (
|
|
790
|
-
var C =
|
|
791
|
-
return
|
|
792
|
-
}),
|
|
781
|
+
var c = n.get(a), d = a in l;
|
|
782
|
+
if (c === void 0 && (!d || (p = Wt(l, a)) != null && p.writable) && (c = o(() => {
|
|
783
|
+
var C = Et(d ? l[a] : P), y = /* @__PURE__ */ G(C);
|
|
784
|
+
return y;
|
|
785
|
+
}), n.set(a, c)), c !== void 0) {
|
|
793
786
|
var f = I(c);
|
|
794
|
-
return f ===
|
|
787
|
+
return f === P ? void 0 : f;
|
|
795
788
|
}
|
|
796
|
-
return Reflect.get(l,
|
|
789
|
+
return Reflect.get(l, a, u);
|
|
797
790
|
},
|
|
798
|
-
getOwnPropertyDescriptor(l,
|
|
799
|
-
var
|
|
800
|
-
if (
|
|
801
|
-
var c =
|
|
802
|
-
c && (
|
|
803
|
-
} else if (
|
|
804
|
-
var d =
|
|
805
|
-
if (d !== void 0 && f !==
|
|
791
|
+
getOwnPropertyDescriptor(l, a) {
|
|
792
|
+
var u = Reflect.getOwnPropertyDescriptor(l, a);
|
|
793
|
+
if (u && "value" in u) {
|
|
794
|
+
var c = n.get(a);
|
|
795
|
+
c && (u.value = I(c));
|
|
796
|
+
} else if (u === void 0) {
|
|
797
|
+
var d = n.get(a), f = d == null ? void 0 : d.v;
|
|
798
|
+
if (d !== void 0 && f !== P)
|
|
806
799
|
return {
|
|
807
800
|
enumerable: !0,
|
|
808
801
|
configurable: !0,
|
|
@@ -810,148 +803,148 @@ function It(e) {
|
|
|
810
803
|
writable: !0
|
|
811
804
|
};
|
|
812
805
|
}
|
|
813
|
-
return
|
|
806
|
+
return u;
|
|
814
807
|
},
|
|
815
|
-
has(l,
|
|
808
|
+
has(l, a) {
|
|
816
809
|
var f;
|
|
817
|
-
if (
|
|
810
|
+
if (a === ft)
|
|
818
811
|
return !0;
|
|
819
|
-
var
|
|
820
|
-
if (
|
|
821
|
-
|
|
822
|
-
var
|
|
812
|
+
var u = n.get(a), c = u !== void 0 && u.v !== P || Reflect.has(l, a);
|
|
813
|
+
if (u !== void 0 || N !== null && (!c || (f = Wt(l, a)) != null && f.writable)) {
|
|
814
|
+
u === void 0 && (u = o(() => {
|
|
815
|
+
var p = c ? Et(l[a]) : P, C = /* @__PURE__ */ G(p);
|
|
823
816
|
return C;
|
|
824
|
-
}),
|
|
825
|
-
var d = I(
|
|
826
|
-
if (d ===
|
|
817
|
+
}), n.set(a, u));
|
|
818
|
+
var d = I(u);
|
|
819
|
+
if (d === P)
|
|
827
820
|
return !1;
|
|
828
821
|
}
|
|
829
822
|
return c;
|
|
830
823
|
},
|
|
831
|
-
set(l,
|
|
832
|
-
var
|
|
833
|
-
var d =
|
|
834
|
-
if (
|
|
835
|
-
for (var
|
|
836
|
-
d.v;
|
|
837
|
-
var C =
|
|
838
|
-
C !== void 0 ?
|
|
824
|
+
set(l, a, u, c) {
|
|
825
|
+
var h;
|
|
826
|
+
var d = n.get(a), f = a in l;
|
|
827
|
+
if (i && a === "length")
|
|
828
|
+
for (var p = u; p < /** @type {Source<number>} */
|
|
829
|
+
d.v; p += 1) {
|
|
830
|
+
var C = n.get(p + "");
|
|
831
|
+
C !== void 0 ? V(C, P) : p in l && (C = o(() => /* @__PURE__ */ G(P)), n.set(p + "", C));
|
|
839
832
|
}
|
|
840
833
|
if (d === void 0)
|
|
841
|
-
(!f || (
|
|
834
|
+
(!f || (h = Wt(l, a)) != null && h.writable) && (d = o(() => /* @__PURE__ */ G(void 0)), V(d, Et(u)), n.set(a, d));
|
|
842
835
|
else {
|
|
843
|
-
f = d.v !==
|
|
844
|
-
var
|
|
845
|
-
|
|
836
|
+
f = d.v !== P;
|
|
837
|
+
var y = o(() => Et(u));
|
|
838
|
+
V(d, y);
|
|
846
839
|
}
|
|
847
|
-
var
|
|
848
|
-
if (
|
|
849
|
-
if (
|
|
840
|
+
var b = Reflect.getOwnPropertyDescriptor(l, a);
|
|
841
|
+
if (b != null && b.set && b.set.call(c, u), !f) {
|
|
842
|
+
if (i && typeof a == "string") {
|
|
850
843
|
var g = (
|
|
851
844
|
/** @type {Source<number>} */
|
|
852
|
-
|
|
853
|
-
), m = Number(
|
|
854
|
-
Number.isInteger(m) && m >= g.v &&
|
|
845
|
+
n.get("length")
|
|
846
|
+
), m = Number(a);
|
|
847
|
+
Number.isInteger(m) && m >= g.v && V(g, m + 1);
|
|
855
848
|
}
|
|
856
|
-
|
|
849
|
+
ee(s);
|
|
857
850
|
}
|
|
858
851
|
return !0;
|
|
859
852
|
},
|
|
860
853
|
ownKeys(l) {
|
|
861
854
|
I(s);
|
|
862
|
-
var
|
|
863
|
-
var f =
|
|
864
|
-
return f === void 0 || f.v !==
|
|
855
|
+
var a = Reflect.ownKeys(l).filter((d) => {
|
|
856
|
+
var f = n.get(d);
|
|
857
|
+
return f === void 0 || f.v !== P;
|
|
865
858
|
});
|
|
866
|
-
for (var [
|
|
867
|
-
c.v !==
|
|
868
|
-
return
|
|
859
|
+
for (var [u, c] of n)
|
|
860
|
+
c.v !== P && !(u in l) && a.push(u);
|
|
861
|
+
return a;
|
|
869
862
|
},
|
|
870
863
|
setPrototypeOf() {
|
|
871
|
-
|
|
864
|
+
hi();
|
|
872
865
|
}
|
|
873
866
|
}
|
|
874
867
|
);
|
|
875
868
|
}
|
|
876
869
|
function ke(e) {
|
|
877
870
|
try {
|
|
878
|
-
if (e !== null && typeof e == "object" &&
|
|
879
|
-
return e[
|
|
871
|
+
if (e !== null && typeof e == "object" && ft in e)
|
|
872
|
+
return e[ft];
|
|
880
873
|
} catch {
|
|
881
874
|
}
|
|
882
875
|
return e;
|
|
883
876
|
}
|
|
884
|
-
function
|
|
877
|
+
function Ri(e, t) {
|
|
885
878
|
return Object.is(ke(e), ke(t));
|
|
886
879
|
}
|
|
887
|
-
var
|
|
880
|
+
var ki, Mi, Ui;
|
|
888
881
|
// @__NO_SIDE_EFFECTS__
|
|
889
|
-
function
|
|
882
|
+
function xi(e) {
|
|
890
883
|
return (
|
|
891
884
|
/** @type {TemplateNode | null} */
|
|
892
|
-
|
|
885
|
+
Mi.call(e)
|
|
893
886
|
);
|
|
894
887
|
}
|
|
895
888
|
// @__NO_SIDE_EFFECTS__
|
|
896
|
-
function
|
|
889
|
+
function Bi(e) {
|
|
897
890
|
return (
|
|
898
891
|
/** @type {TemplateNode | null} */
|
|
899
|
-
|
|
892
|
+
Ui.call(e)
|
|
900
893
|
);
|
|
901
894
|
}
|
|
902
|
-
function
|
|
895
|
+
function Fi(e, t) {
|
|
903
896
|
if (t) {
|
|
904
|
-
const
|
|
905
|
-
e.autofocus = !0,
|
|
906
|
-
document.activeElement ===
|
|
897
|
+
const n = document.body;
|
|
898
|
+
e.autofocus = !0, Jt(() => {
|
|
899
|
+
document.activeElement === n && e.focus();
|
|
907
900
|
});
|
|
908
901
|
}
|
|
909
902
|
}
|
|
910
903
|
function Ae(e) {
|
|
911
|
-
var t = w,
|
|
912
|
-
|
|
904
|
+
var t = w, n = N;
|
|
905
|
+
Q(null), st(null);
|
|
913
906
|
try {
|
|
914
907
|
return e();
|
|
915
908
|
} finally {
|
|
916
|
-
|
|
909
|
+
Q(t), st(n);
|
|
917
910
|
}
|
|
918
911
|
}
|
|
919
|
-
function
|
|
920
|
-
|
|
912
|
+
function Hi(e) {
|
|
913
|
+
N === null && (w === null && ui(), ai()), it && li();
|
|
921
914
|
}
|
|
922
|
-
function
|
|
923
|
-
var
|
|
924
|
-
|
|
915
|
+
function Vi(e, t) {
|
|
916
|
+
var n = t.last;
|
|
917
|
+
n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
|
|
925
918
|
}
|
|
926
|
-
function
|
|
927
|
-
var
|
|
928
|
-
|
|
919
|
+
function vt(e, t, n) {
|
|
920
|
+
var i = N;
|
|
921
|
+
i !== null && (i.f & Nt) !== 0 && (e |= Nt);
|
|
929
922
|
var s = {
|
|
930
|
-
ctx:
|
|
923
|
+
ctx: X,
|
|
931
924
|
deps: null,
|
|
932
925
|
nodes: null,
|
|
933
|
-
f: e |
|
|
926
|
+
f: e | W | z,
|
|
934
927
|
first: null,
|
|
935
928
|
fn: t,
|
|
936
929
|
last: null,
|
|
937
930
|
next: null,
|
|
938
|
-
parent:
|
|
939
|
-
b:
|
|
931
|
+
parent: i,
|
|
932
|
+
b: i && i.b,
|
|
940
933
|
prev: null,
|
|
941
934
|
teardown: null,
|
|
942
935
|
wv: 0,
|
|
943
936
|
ac: null
|
|
944
937
|
};
|
|
945
|
-
if (
|
|
938
|
+
if (n)
|
|
946
939
|
try {
|
|
947
|
-
|
|
940
|
+
Mt(s), s.f |= be;
|
|
948
941
|
} catch (l) {
|
|
949
|
-
throw
|
|
942
|
+
throw gt(s), l;
|
|
950
943
|
}
|
|
951
|
-
else t !== null &&
|
|
944
|
+
else t !== null && Tt(s);
|
|
952
945
|
var r = s;
|
|
953
|
-
if (
|
|
954
|
-
(r.f &
|
|
946
|
+
if (n && r.deps === null && r.teardown === null && r.nodes === null && r.first === r.last && // either `null`, or a singular child
|
|
947
|
+
(r.f & Zt) === 0 && (r = r.first, (e & mt) !== 0 && (e & Pe) !== 0 && r !== null && (r.f |= Pe)), r !== null && (r.parent = i, i !== null && Vi(r, i), w !== null && (w.f & k) !== 0 && (e & Pt) === 0)) {
|
|
955
948
|
var o = (
|
|
956
949
|
/** @type {Derived} */
|
|
957
950
|
w
|
|
@@ -960,264 +953,273 @@ function mt(e, t, i) {
|
|
|
960
953
|
}
|
|
961
954
|
return s;
|
|
962
955
|
}
|
|
963
|
-
function
|
|
964
|
-
return w !== null && !
|
|
956
|
+
function hn() {
|
|
957
|
+
return w !== null && !q;
|
|
965
958
|
}
|
|
966
|
-
function
|
|
967
|
-
const t =
|
|
968
|
-
return
|
|
959
|
+
function pn(e) {
|
|
960
|
+
const t = vt(ye, null, !1);
|
|
961
|
+
return B(t, U), t.teardown = e, t;
|
|
969
962
|
}
|
|
970
|
-
function
|
|
971
|
-
|
|
963
|
+
function Wi(e) {
|
|
964
|
+
Hi();
|
|
972
965
|
var t = (
|
|
973
966
|
/** @type {Effect} */
|
|
974
|
-
|
|
975
|
-
),
|
|
976
|
-
if (
|
|
977
|
-
var
|
|
967
|
+
N.f
|
|
968
|
+
), n = !w && (t & yt) !== 0 && (t & be) === 0;
|
|
969
|
+
if (n) {
|
|
970
|
+
var i = (
|
|
978
971
|
/** @type {ComponentContext} */
|
|
979
|
-
|
|
972
|
+
X
|
|
980
973
|
);
|
|
981
|
-
(
|
|
974
|
+
(i.e ?? (i.e = [])).push(e);
|
|
982
975
|
} else
|
|
983
|
-
return
|
|
976
|
+
return _n(e);
|
|
984
977
|
}
|
|
985
|
-
function
|
|
986
|
-
return
|
|
978
|
+
function _n(e) {
|
|
979
|
+
return vt(Gt | ii, e, !1);
|
|
987
980
|
}
|
|
988
981
|
function Le(e) {
|
|
989
|
-
return
|
|
982
|
+
return vt(Gt, e, !1);
|
|
990
983
|
}
|
|
991
|
-
function
|
|
992
|
-
return
|
|
984
|
+
function ji(e) {
|
|
985
|
+
return vt(we | Zt, e, !0);
|
|
993
986
|
}
|
|
994
|
-
function
|
|
995
|
-
return
|
|
987
|
+
function Gi(e, t = 0) {
|
|
988
|
+
return vt(ye | t, e, !0);
|
|
996
989
|
}
|
|
997
|
-
function
|
|
998
|
-
var
|
|
999
|
-
return
|
|
990
|
+
function Cn(e, t = 0) {
|
|
991
|
+
var n = vt(ve | t, e, !0);
|
|
992
|
+
return n;
|
|
1000
993
|
}
|
|
1001
|
-
function
|
|
1002
|
-
return
|
|
994
|
+
function gn(e) {
|
|
995
|
+
return vt(yt | Zt, e, !0);
|
|
1003
996
|
}
|
|
1004
|
-
function
|
|
997
|
+
function mn(e) {
|
|
1005
998
|
var t = e.teardown;
|
|
1006
999
|
if (t !== null) {
|
|
1007
|
-
const
|
|
1008
|
-
Me(!0),
|
|
1000
|
+
const n = it, i = w;
|
|
1001
|
+
Me(!0), Q(null);
|
|
1009
1002
|
try {
|
|
1010
1003
|
t.call(null);
|
|
1011
1004
|
} finally {
|
|
1012
|
-
Me(
|
|
1005
|
+
Me(n), Q(i);
|
|
1013
1006
|
}
|
|
1014
1007
|
}
|
|
1015
1008
|
}
|
|
1016
|
-
function
|
|
1017
|
-
var
|
|
1018
|
-
for (e.first = e.last = null;
|
|
1019
|
-
const s =
|
|
1009
|
+
function yn(e, t = !1) {
|
|
1010
|
+
var n = e.first;
|
|
1011
|
+
for (e.first = e.last = null; n !== null; ) {
|
|
1012
|
+
const s = n.ac;
|
|
1020
1013
|
s !== null && Ae(() => {
|
|
1021
|
-
s.abort(
|
|
1014
|
+
s.abort(wt);
|
|
1022
1015
|
});
|
|
1023
|
-
var
|
|
1024
|
-
(
|
|
1016
|
+
var i = n.next;
|
|
1017
|
+
(n.f & Pt) !== 0 ? n.parent = null : gt(n, t), n = i;
|
|
1025
1018
|
}
|
|
1026
1019
|
}
|
|
1027
|
-
function
|
|
1020
|
+
function zi(e) {
|
|
1028
1021
|
for (var t = e.first; t !== null; ) {
|
|
1029
|
-
var
|
|
1030
|
-
(t.f &
|
|
1022
|
+
var n = t.next;
|
|
1023
|
+
(t.f & yt) === 0 && gt(t), t = n;
|
|
1031
1024
|
}
|
|
1032
1025
|
}
|
|
1033
|
-
function
|
|
1034
|
-
var
|
|
1035
|
-
(t || (e.f &
|
|
1026
|
+
function gt(e, t = !0) {
|
|
1027
|
+
var n = !1;
|
|
1028
|
+
(t || (e.f & Je) !== 0) && e.nodes !== null && e.nodes.end !== null && (Ki(
|
|
1036
1029
|
e.nodes.start,
|
|
1037
1030
|
/** @type {TemplateNode} */
|
|
1038
1031
|
e.nodes.end
|
|
1039
|
-
),
|
|
1040
|
-
var
|
|
1041
|
-
if (
|
|
1042
|
-
for (const r of
|
|
1032
|
+
), n = !0), yn(e, t && !n), Xt(e, 0), B(e, J);
|
|
1033
|
+
var i = e.nodes && e.nodes.t;
|
|
1034
|
+
if (i !== null)
|
|
1035
|
+
for (const r of i)
|
|
1043
1036
|
r.stop();
|
|
1044
|
-
|
|
1037
|
+
mn(e);
|
|
1045
1038
|
var s = e.parent;
|
|
1046
|
-
s !== null && s.first !== null &&
|
|
1039
|
+
s !== null && s.first !== null && vn(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
|
|
1047
1040
|
}
|
|
1048
|
-
function
|
|
1041
|
+
function Ki(e, t) {
|
|
1049
1042
|
for (; e !== null; ) {
|
|
1050
|
-
var
|
|
1051
|
-
e.remove(), e =
|
|
1043
|
+
var n = e === t ? null : /* @__PURE__ */ Bi(e);
|
|
1044
|
+
e.remove(), e = n;
|
|
1052
1045
|
}
|
|
1053
1046
|
}
|
|
1054
|
-
function
|
|
1055
|
-
var t = e.parent,
|
|
1056
|
-
|
|
1047
|
+
function vn(e) {
|
|
1048
|
+
var t = e.parent, n = e.prev, i = e.next;
|
|
1049
|
+
n !== null && (n.next = i), i !== null && (i.prev = n), t !== null && (t.first === e && (t.first = i), t.last === e && (t.last = n));
|
|
1057
1050
|
}
|
|
1058
|
-
let
|
|
1059
|
-
function
|
|
1060
|
-
|
|
1051
|
+
let ht = !1;
|
|
1052
|
+
function $t(e) {
|
|
1053
|
+
ht = e;
|
|
1061
1054
|
}
|
|
1062
|
-
let
|
|
1055
|
+
let it = !1;
|
|
1063
1056
|
function Me(e) {
|
|
1064
|
-
|
|
1057
|
+
it = e;
|
|
1065
1058
|
}
|
|
1066
|
-
let w = null,
|
|
1067
|
-
function
|
|
1059
|
+
let w = null, q = !1;
|
|
1060
|
+
function Q(e) {
|
|
1068
1061
|
w = e;
|
|
1069
1062
|
}
|
|
1070
|
-
let
|
|
1071
|
-
function
|
|
1072
|
-
|
|
1063
|
+
let N = null;
|
|
1064
|
+
function st(e) {
|
|
1065
|
+
N = e;
|
|
1073
1066
|
}
|
|
1074
|
-
let
|
|
1075
|
-
function
|
|
1076
|
-
w !== null && (
|
|
1067
|
+
let x = null;
|
|
1068
|
+
function Yi(e) {
|
|
1069
|
+
w !== null && (x === null ? x = [e] : x.push(e));
|
|
1077
1070
|
}
|
|
1078
|
-
let
|
|
1079
|
-
function
|
|
1080
|
-
|
|
1071
|
+
let F = null, H = 0, j = null;
|
|
1072
|
+
function qi(e) {
|
|
1073
|
+
j = e;
|
|
1081
1074
|
}
|
|
1082
|
-
let
|
|
1075
|
+
let bn = 1, ut = 0, pt = ut;
|
|
1083
1076
|
function Ue(e) {
|
|
1084
|
-
|
|
1077
|
+
pt = e;
|
|
1085
1078
|
}
|
|
1086
|
-
function
|
|
1087
|
-
return ++
|
|
1079
|
+
function wn() {
|
|
1080
|
+
return ++bn;
|
|
1088
1081
|
}
|
|
1089
|
-
function
|
|
1082
|
+
function xt(e) {
|
|
1090
1083
|
var t = e.f;
|
|
1091
|
-
if ((t &
|
|
1084
|
+
if ((t & W) !== 0)
|
|
1092
1085
|
return !0;
|
|
1093
|
-
if (t &
|
|
1094
|
-
var
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1086
|
+
if (t & k && (e.f &= ~Ct), (t & rt) !== 0) {
|
|
1087
|
+
for (var n = (
|
|
1088
|
+
/** @type {Value[]} */
|
|
1089
|
+
e.deps
|
|
1090
|
+
), i = n.length, s = 0; s < i; s++) {
|
|
1091
|
+
var r = n[s];
|
|
1092
|
+
if (xt(
|
|
1093
|
+
/** @type {Derived} */
|
|
1094
|
+
r
|
|
1095
|
+
) && un(
|
|
1096
|
+
/** @type {Derived} */
|
|
1097
|
+
r
|
|
1098
|
+
), r.wv > e.wv)
|
|
1099
|
+
return !0;
|
|
1100
|
+
}
|
|
1101
|
+
(t & z) !== 0 && // During time traveling we don't want to reset the status so that
|
|
1108
1102
|
// traversal of the graph in the other batches still happens
|
|
1109
|
-
|
|
1103
|
+
R === null && B(e, U);
|
|
1110
1104
|
}
|
|
1111
1105
|
return !1;
|
|
1112
1106
|
}
|
|
1113
|
-
function
|
|
1114
|
-
var
|
|
1115
|
-
if (
|
|
1116
|
-
for (var s = 0; s <
|
|
1117
|
-
var r =
|
|
1118
|
-
(r.f &
|
|
1107
|
+
function In(e, t, n = !0) {
|
|
1108
|
+
var i = e.reactions;
|
|
1109
|
+
if (i !== null && !(x != null && x.includes(e)))
|
|
1110
|
+
for (var s = 0; s < i.length; s++) {
|
|
1111
|
+
var r = i[s];
|
|
1112
|
+
(r.f & k) !== 0 ? In(
|
|
1119
1113
|
/** @type {Derived} */
|
|
1120
1114
|
r,
|
|
1121
1115
|
t,
|
|
1122
1116
|
!1
|
|
1123
|
-
) : t === r && (
|
|
1117
|
+
) : t === r && (n ? B(r, W) : (r.f & U) !== 0 && B(r, rt), Tt(
|
|
1124
1118
|
/** @type {Effect} */
|
|
1125
1119
|
r
|
|
1126
1120
|
));
|
|
1127
1121
|
}
|
|
1128
1122
|
}
|
|
1129
|
-
function
|
|
1123
|
+
function En(e) {
|
|
1130
1124
|
var C;
|
|
1131
|
-
var t =
|
|
1132
|
-
|
|
1133
|
-
null,
|
|
1134
|
-
e.ac.abort(
|
|
1125
|
+
var t = F, n = H, i = j, s = w, r = x, o = X, l = q, a = pt, u = e.f;
|
|
1126
|
+
F = /** @type {null | Value[]} */
|
|
1127
|
+
null, H = 0, j = null, w = (u & (yt | Pt)) === 0 ? e : null, x = null, zt(e.ctx), q = !1, pt = ++ut, e.ac !== null && (Ae(() => {
|
|
1128
|
+
e.ac.abort(wt);
|
|
1135
1129
|
}), e.ac = null);
|
|
1136
1130
|
try {
|
|
1137
|
-
e.f |=
|
|
1131
|
+
e.f |= de;
|
|
1138
1132
|
var c = (
|
|
1139
1133
|
/** @type {Function} */
|
|
1140
1134
|
e.fn
|
|
1141
1135
|
), d = c(), f = e.deps;
|
|
1142
|
-
if (
|
|
1143
|
-
var
|
|
1144
|
-
if (
|
|
1145
|
-
for (f.length =
|
|
1146
|
-
f[
|
|
1136
|
+
if (F !== null) {
|
|
1137
|
+
var p;
|
|
1138
|
+
if (Xt(e, H), f !== null && H > 0)
|
|
1139
|
+
for (f.length = H + F.length, p = 0; p < F.length; p++)
|
|
1140
|
+
f[H + p] = F[p];
|
|
1147
1141
|
else
|
|
1148
|
-
e.deps = f =
|
|
1149
|
-
if (
|
|
1150
|
-
for (
|
|
1151
|
-
((C = f[
|
|
1152
|
-
} else f !== null &&
|
|
1153
|
-
if (
|
|
1154
|
-
for (
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1142
|
+
e.deps = f = F;
|
|
1143
|
+
if (hn() && (e.f & z) !== 0)
|
|
1144
|
+
for (p = H; p < f.length; p++)
|
|
1145
|
+
((C = f[p]).reactions ?? (C.reactions = [])).push(e);
|
|
1146
|
+
} else f !== null && H < f.length && (Xt(e, H), f.length = H);
|
|
1147
|
+
if (en() && j !== null && !q && f !== null && (e.f & (k | rt | W)) === 0)
|
|
1148
|
+
for (p = 0; p < /** @type {Source[]} */
|
|
1149
|
+
j.length; p++)
|
|
1150
|
+
In(
|
|
1151
|
+
j[p],
|
|
1158
1152
|
/** @type {Effect} */
|
|
1159
1153
|
e
|
|
1160
1154
|
);
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1155
|
+
if (s !== null && s !== e) {
|
|
1156
|
+
if (ut++, s.deps !== null)
|
|
1157
|
+
for (let y = 0; y < n; y += 1)
|
|
1158
|
+
s.deps[y].rv = ut;
|
|
1159
|
+
if (t !== null)
|
|
1160
|
+
for (const y of t)
|
|
1161
|
+
y.rv = ut;
|
|
1162
|
+
j !== null && (i === null ? i = j : i.push(.../** @type {Source[]} */
|
|
1163
|
+
j));
|
|
1164
|
+
}
|
|
1165
|
+
return (e.f & et) !== 0 && (e.f ^= et), d;
|
|
1166
|
+
} catch (y) {
|
|
1167
|
+
return wi(y);
|
|
1165
1168
|
} finally {
|
|
1166
|
-
e.f ^=
|
|
1169
|
+
e.f ^= de, F = t, H = n, j = i, w = s, x = r, zt(o), q = l, pt = a;
|
|
1167
1170
|
}
|
|
1168
1171
|
}
|
|
1169
|
-
function
|
|
1170
|
-
let
|
|
1171
|
-
if (
|
|
1172
|
-
var
|
|
1173
|
-
if (
|
|
1174
|
-
var s =
|
|
1175
|
-
s === 0 ?
|
|
1172
|
+
function $i(e, t) {
|
|
1173
|
+
let n = t.reactions;
|
|
1174
|
+
if (n !== null) {
|
|
1175
|
+
var i = Qn.call(n, e);
|
|
1176
|
+
if (i !== -1) {
|
|
1177
|
+
var s = n.length - 1;
|
|
1178
|
+
s === 0 ? n = t.reactions = null : (n[i] = n[s], n.pop());
|
|
1176
1179
|
}
|
|
1177
1180
|
}
|
|
1178
|
-
|
|
1181
|
+
if (n === null && (t.f & k) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1179
1182
|
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1180
1183
|
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1181
|
-
(
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
));
|
|
1184
|
+
(F === null || !F.includes(t))) {
|
|
1185
|
+
var r = (
|
|
1186
|
+
/** @type {Derived} */
|
|
1187
|
+
t
|
|
1188
|
+
);
|
|
1189
|
+
(r.f & z) !== 0 && (r.f ^= z, r.f &= ~Ct), Ie(r), an(r), Xt(r, 0);
|
|
1190
|
+
}
|
|
1189
1191
|
}
|
|
1190
|
-
function
|
|
1191
|
-
var
|
|
1192
|
-
if (
|
|
1193
|
-
for (var
|
|
1194
|
-
|
|
1192
|
+
function Xt(e, t) {
|
|
1193
|
+
var n = e.deps;
|
|
1194
|
+
if (n !== null)
|
|
1195
|
+
for (var i = t; i < n.length; i++)
|
|
1196
|
+
$i(e, n[i]);
|
|
1195
1197
|
}
|
|
1196
|
-
function
|
|
1198
|
+
function Mt(e) {
|
|
1197
1199
|
var t = e.f;
|
|
1198
|
-
if ((t &
|
|
1199
|
-
|
|
1200
|
-
var
|
|
1201
|
-
|
|
1200
|
+
if ((t & J) === 0) {
|
|
1201
|
+
B(e, U);
|
|
1202
|
+
var n = N, i = ht;
|
|
1203
|
+
N = e, ht = !0;
|
|
1202
1204
|
try {
|
|
1203
|
-
(t & (
|
|
1204
|
-
var s =
|
|
1205
|
-
e.teardown = typeof s == "function" ? s : null, e.wv =
|
|
1205
|
+
(t & (mt | ve)) !== 0 ? zi(e) : yn(e), mn(e);
|
|
1206
|
+
var s = En(e);
|
|
1207
|
+
e.teardown = typeof s == "function" ? s : null, e.wv = bn;
|
|
1206
1208
|
var r;
|
|
1207
|
-
|
|
1209
|
+
ce && mi && (e.f & W) !== 0 && e.deps;
|
|
1208
1210
|
} finally {
|
|
1209
|
-
|
|
1211
|
+
ht = i, N = n;
|
|
1210
1212
|
}
|
|
1211
1213
|
}
|
|
1212
1214
|
}
|
|
1213
1215
|
function I(e) {
|
|
1214
|
-
var t = e.f,
|
|
1215
|
-
if (w !== null && !
|
|
1216
|
-
var
|
|
1217
|
-
if (!
|
|
1216
|
+
var t = e.f, n = (t & k) !== 0;
|
|
1217
|
+
if (w !== null && !q) {
|
|
1218
|
+
var i = N !== null && (N.f & J) !== 0;
|
|
1219
|
+
if (!i && !(x != null && x.includes(e))) {
|
|
1218
1220
|
var s = w.deps;
|
|
1219
|
-
if ((w.f &
|
|
1220
|
-
e.rv <
|
|
1221
|
+
if ((w.f & de) !== 0)
|
|
1222
|
+
e.rv < ut && (e.rv = ut, F === null && s !== null && s[H] === e ? H++ : F === null ? F = [e] : F.push(e));
|
|
1221
1223
|
else {
|
|
1222
1224
|
(w.deps ?? (w.deps = [])).push(e);
|
|
1223
1225
|
var r = e.reactions;
|
|
@@ -1225,170 +1227,168 @@ function I(e) {
|
|
|
1225
1227
|
}
|
|
1226
1228
|
}
|
|
1227
1229
|
}
|
|
1228
|
-
if (
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1230
|
+
if (it && nt.has(e))
|
|
1231
|
+
return nt.get(e);
|
|
1232
|
+
if (n) {
|
|
1233
|
+
var o = (
|
|
1234
|
+
/** @type {Derived} */
|
|
1235
|
+
e
|
|
1236
|
+
);
|
|
1237
|
+
if (it) {
|
|
1238
|
+
var l = o.v;
|
|
1239
|
+
return ((o.f & U) === 0 && o.reactions !== null || Dn(o)) && (l = De(o)), nt.set(o, l), l;
|
|
1237
1240
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1241
|
+
var a = (o.f & z) === 0 && !q && w !== null && (ht || (w.f & z) !== 0), u = o.deps === null;
|
|
1242
|
+
xt(o) && (a && (o.f |= z), un(o)), a && !u && Nn(o);
|
|
1243
|
+
}
|
|
1244
|
+
if (R != null && R.has(e))
|
|
1245
|
+
return R.get(e);
|
|
1246
|
+
if ((e.f & et) !== 0)
|
|
1243
1247
|
throw e.v;
|
|
1244
1248
|
return e.v;
|
|
1245
1249
|
}
|
|
1246
|
-
function
|
|
1250
|
+
function Nn(e) {
|
|
1247
1251
|
if (e.deps !== null) {
|
|
1248
|
-
e.f
|
|
1252
|
+
e.f |= z;
|
|
1249
1253
|
for (const t of e.deps)
|
|
1250
|
-
(t.reactions ?? (t.reactions = [])).push(e), (t.f &
|
|
1254
|
+
(t.reactions ?? (t.reactions = [])).push(e), (t.f & k) !== 0 && (t.f & z) === 0 && Nn(
|
|
1251
1255
|
/** @type {Derived} */
|
|
1252
1256
|
t
|
|
1253
1257
|
);
|
|
1254
1258
|
}
|
|
1255
1259
|
}
|
|
1256
|
-
function
|
|
1257
|
-
if (e.v ===
|
|
1260
|
+
function Dn(e) {
|
|
1261
|
+
if (e.v === P) return !0;
|
|
1258
1262
|
if (e.deps === null) return !1;
|
|
1259
1263
|
for (const t of e.deps)
|
|
1260
|
-
if (
|
|
1264
|
+
if (nt.has(t) || (t.f & k) !== 0 && Dn(
|
|
1261
1265
|
/** @type {Derived} */
|
|
1262
1266
|
t
|
|
1263
1267
|
))
|
|
1264
1268
|
return !0;
|
|
1265
1269
|
return !1;
|
|
1266
1270
|
}
|
|
1267
|
-
function
|
|
1268
|
-
var t =
|
|
1271
|
+
function An(e) {
|
|
1272
|
+
var t = q;
|
|
1269
1273
|
try {
|
|
1270
|
-
return
|
|
1274
|
+
return q = !0, e();
|
|
1271
1275
|
} finally {
|
|
1272
|
-
|
|
1276
|
+
q = t;
|
|
1273
1277
|
}
|
|
1274
1278
|
}
|
|
1275
|
-
const
|
|
1276
|
-
function
|
|
1277
|
-
e.f = e.f & Yn | t;
|
|
1278
|
-
}
|
|
1279
|
-
const qn = /* @__PURE__ */ new Set(), $n = /* @__PURE__ */ new Set();
|
|
1280
|
-
function Xn(e, t, i, n = {}) {
|
|
1279
|
+
const Xi = /* @__PURE__ */ new Set(), Qi = /* @__PURE__ */ new Set();
|
|
1280
|
+
function Zi(e, t, n, i = {}) {
|
|
1281
1281
|
function s(r) {
|
|
1282
|
-
if (
|
|
1283
|
-
return Ae(() =>
|
|
1282
|
+
if (i.capture || ts.call(t, r), !r.cancelBubble)
|
|
1283
|
+
return Ae(() => n == null ? void 0 : n.call(this, r));
|
|
1284
1284
|
}
|
|
1285
|
-
return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ?
|
|
1286
|
-
t.addEventListener(e, s,
|
|
1287
|
-
}) : t.addEventListener(e, s,
|
|
1285
|
+
return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? Jt(() => {
|
|
1286
|
+
t.addEventListener(e, s, i);
|
|
1287
|
+
}) : t.addEventListener(e, s, i), s;
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function Ji(e) {
|
|
1290
1290
|
for (var t = 0; t < e.length; t++)
|
|
1291
|
-
|
|
1292
|
-
for (var
|
|
1293
|
-
|
|
1291
|
+
Xi.add(e[t]);
|
|
1292
|
+
for (var n of Qi)
|
|
1293
|
+
n(e);
|
|
1294
1294
|
}
|
|
1295
1295
|
let xe = null;
|
|
1296
|
-
function
|
|
1297
|
-
var
|
|
1298
|
-
var t = this,
|
|
1296
|
+
function ts(e) {
|
|
1297
|
+
var b;
|
|
1298
|
+
var t = this, n = (
|
|
1299
1299
|
/** @type {Node} */
|
|
1300
1300
|
t.ownerDocument
|
|
1301
|
-
),
|
|
1301
|
+
), i = e.type, s = ((b = e.composedPath) == null ? void 0 : b.call(e)) || [], r = (
|
|
1302
1302
|
/** @type {null | Element} */
|
|
1303
1303
|
s[0] || e.target
|
|
1304
1304
|
);
|
|
1305
1305
|
xe = e;
|
|
1306
1306
|
var o = 0, l = xe === e && e.__root;
|
|
1307
1307
|
if (l) {
|
|
1308
|
-
var
|
|
1309
|
-
if (
|
|
1308
|
+
var a = s.indexOf(l);
|
|
1309
|
+
if (a !== -1 && (t === document || t === /** @type {any} */
|
|
1310
1310
|
window)) {
|
|
1311
1311
|
e.__root = t;
|
|
1312
1312
|
return;
|
|
1313
1313
|
}
|
|
1314
|
-
var
|
|
1315
|
-
if (
|
|
1314
|
+
var u = s.indexOf(t);
|
|
1315
|
+
if (u === -1)
|
|
1316
1316
|
return;
|
|
1317
|
-
|
|
1317
|
+
a <= u && (o = a);
|
|
1318
1318
|
}
|
|
1319
1319
|
if (r = /** @type {Element} */
|
|
1320
1320
|
s[o] || e.target, r !== t) {
|
|
1321
|
-
|
|
1321
|
+
Zn(e, "currentTarget", {
|
|
1322
1322
|
configurable: !0,
|
|
1323
1323
|
get() {
|
|
1324
|
-
return r ||
|
|
1324
|
+
return r || n;
|
|
1325
1325
|
}
|
|
1326
1326
|
});
|
|
1327
|
-
var c = w, d =
|
|
1328
|
-
|
|
1327
|
+
var c = w, d = N;
|
|
1328
|
+
Q(null), st(null);
|
|
1329
1329
|
try {
|
|
1330
|
-
for (var f,
|
|
1330
|
+
for (var f, p = []; r !== null; ) {
|
|
1331
1331
|
var C = r.assignedSlot || r.parentNode || /** @type {any} */
|
|
1332
1332
|
r.host || null;
|
|
1333
1333
|
try {
|
|
1334
|
-
var
|
|
1335
|
-
|
|
1334
|
+
var y = r["__" + i];
|
|
1335
|
+
y != null && (!/** @type {any} */
|
|
1336
1336
|
r.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1337
1337
|
// -> the target could not have been disabled because it emits the event in the first place
|
|
1338
|
-
e.target === r) &&
|
|
1338
|
+
e.target === r) && y.call(r, e);
|
|
1339
1339
|
} catch (g) {
|
|
1340
|
-
f ?
|
|
1340
|
+
f ? p.push(g) : f = g;
|
|
1341
1341
|
}
|
|
1342
1342
|
if (e.cancelBubble || C === t || C === null)
|
|
1343
1343
|
break;
|
|
1344
1344
|
r = C;
|
|
1345
1345
|
}
|
|
1346
1346
|
if (f) {
|
|
1347
|
-
for (let g of
|
|
1347
|
+
for (let g of p)
|
|
1348
1348
|
queueMicrotask(() => {
|
|
1349
1349
|
throw g;
|
|
1350
1350
|
});
|
|
1351
1351
|
throw f;
|
|
1352
1352
|
}
|
|
1353
1353
|
} finally {
|
|
1354
|
-
e.__root = t, delete e.currentTarget,
|
|
1354
|
+
e.__root = t, delete e.currentTarget, Q(c), st(d);
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1358
|
+
function es(e) {
|
|
1359
1359
|
var t = document.createElement("template");
|
|
1360
1360
|
return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1363
|
-
var
|
|
1362
|
+
function ns(e, t) {
|
|
1363
|
+
var n = (
|
|
1364
1364
|
/** @type {Effect} */
|
|
1365
|
-
|
|
1365
|
+
N
|
|
1366
1366
|
);
|
|
1367
|
-
|
|
1367
|
+
n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
|
|
1368
1368
|
}
|
|
1369
1369
|
// @__NO_SIDE_EFFECTS__
|
|
1370
|
-
function
|
|
1371
|
-
var
|
|
1370
|
+
function is(e, t) {
|
|
1371
|
+
var n = (t & qn) !== 0, i, s = !e.startsWith("<!>");
|
|
1372
1372
|
return () => {
|
|
1373
|
-
|
|
1374
|
-
/* @__PURE__ */
|
|
1373
|
+
i === void 0 && (i = es(s ? e : "<!>" + e), i = /** @type {TemplateNode} */
|
|
1374
|
+
/* @__PURE__ */ xi(i));
|
|
1375
1375
|
var r = (
|
|
1376
1376
|
/** @type {TemplateNode} */
|
|
1377
|
-
|
|
1377
|
+
n || ki ? document.importNode(i, !0) : i.cloneNode(!0)
|
|
1378
1378
|
);
|
|
1379
|
-
return
|
|
1379
|
+
return ns(r, r), r;
|
|
1380
1380
|
};
|
|
1381
1381
|
}
|
|
1382
|
-
function
|
|
1382
|
+
function ss(e, t) {
|
|
1383
1383
|
e !== null && e.before(
|
|
1384
1384
|
/** @type {Node} */
|
|
1385
1385
|
t
|
|
1386
1386
|
);
|
|
1387
1387
|
}
|
|
1388
|
-
function
|
|
1388
|
+
function rs(e) {
|
|
1389
1389
|
return e.endsWith("capture") && e !== "gotpointercapture" && e !== "lostpointercapture";
|
|
1390
1390
|
}
|
|
1391
|
-
const
|
|
1391
|
+
const os = [
|
|
1392
1392
|
"beforeinput",
|
|
1393
1393
|
"click",
|
|
1394
1394
|
"change",
|
|
@@ -1413,10 +1413,10 @@ const ss = [
|
|
|
1413
1413
|
"touchmove",
|
|
1414
1414
|
"touchstart"
|
|
1415
1415
|
];
|
|
1416
|
-
function
|
|
1417
|
-
return
|
|
1416
|
+
function ls(e) {
|
|
1417
|
+
return os.includes(e);
|
|
1418
1418
|
}
|
|
1419
|
-
const
|
|
1419
|
+
const as = {
|
|
1420
1420
|
// no `class: 'className'` because we handle that separately
|
|
1421
1421
|
formnovalidate: "formNoValidate",
|
|
1422
1422
|
ismap: "isMap",
|
|
@@ -1431,143 +1431,143 @@ const os = {
|
|
|
1431
1431
|
disablepictureinpicture: "disablePictureInPicture",
|
|
1432
1432
|
disableremoteplayback: "disableRemotePlayback"
|
|
1433
1433
|
};
|
|
1434
|
-
function
|
|
1435
|
-
return e = e.toLowerCase(),
|
|
1434
|
+
function us(e) {
|
|
1435
|
+
return e = e.toLowerCase(), as[e] ?? e;
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1438
|
-
var
|
|
1439
|
-
|
|
1440
|
-
|
|
1437
|
+
function cs(e, t) {
|
|
1438
|
+
var n = void 0, i;
|
|
1439
|
+
Cn(() => {
|
|
1440
|
+
n !== (n = t()) && (i && (gt(i), i = null), n && (i = gn(() => {
|
|
1441
1441
|
Le(() => (
|
|
1442
1442
|
/** @type {(node: Element) => void} */
|
|
1443
|
-
|
|
1443
|
+
n(e)
|
|
1444
1444
|
));
|
|
1445
1445
|
})));
|
|
1446
1446
|
});
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1449
|
-
var t,
|
|
1450
|
-
if (typeof e == "string" || typeof e == "number")
|
|
1448
|
+
function Ln(e) {
|
|
1449
|
+
var t, n, i = "";
|
|
1450
|
+
if (typeof e == "string" || typeof e == "number") i += e;
|
|
1451
1451
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1452
1452
|
var s = e.length;
|
|
1453
|
-
for (t = 0; t < s; t++) e[t] && (
|
|
1454
|
-
} else for (
|
|
1455
|
-
return
|
|
1453
|
+
for (t = 0; t < s; t++) e[t] && (n = Ln(e[t])) && (i && (i += " "), i += n);
|
|
1454
|
+
} else for (n in e) e[n] && (i && (i += " "), i += n);
|
|
1455
|
+
return i;
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1458
|
-
for (var e, t,
|
|
1459
|
-
return
|
|
1457
|
+
function ds() {
|
|
1458
|
+
for (var e, t, n = 0, i = "", s = arguments.length; n < s; n++) (e = arguments[n]) && (t = Ln(e)) && (i && (i += " "), i += t);
|
|
1459
|
+
return i;
|
|
1460
1460
|
}
|
|
1461
|
-
function
|
|
1462
|
-
return typeof e == "object" ?
|
|
1461
|
+
function fs(e) {
|
|
1462
|
+
return typeof e == "object" ? ds(e) : e ?? "";
|
|
1463
1463
|
}
|
|
1464
1464
|
const Be = [...`
|
|
1465
1465
|
\r\f \v\uFEFF`];
|
|
1466
|
-
function
|
|
1467
|
-
var
|
|
1468
|
-
if (
|
|
1469
|
-
for (var s in
|
|
1470
|
-
if (
|
|
1471
|
-
|
|
1472
|
-
else if (
|
|
1473
|
-
for (var r = s.length, o = 0; (o =
|
|
1466
|
+
function hs(e, t, n) {
|
|
1467
|
+
var i = e == null ? "" : "" + e;
|
|
1468
|
+
if (n) {
|
|
1469
|
+
for (var s in n)
|
|
1470
|
+
if (n[s])
|
|
1471
|
+
i = i ? i + " " + s : s;
|
|
1472
|
+
else if (i.length)
|
|
1473
|
+
for (var r = s.length, o = 0; (o = i.indexOf(s, o)) >= 0; ) {
|
|
1474
1474
|
var l = o + r;
|
|
1475
|
-
(o === 0 || Be.includes(
|
|
1475
|
+
(o === 0 || Be.includes(i[o - 1])) && (l === i.length || Be.includes(i[l])) ? i = (o === 0 ? "" : i.substring(0, o)) + i.substring(l + 1) : o = l;
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
|
-
return
|
|
1478
|
+
return i === "" ? null : i;
|
|
1479
1479
|
}
|
|
1480
1480
|
function Fe(e, t = !1) {
|
|
1481
|
-
var
|
|
1481
|
+
var n = t ? " !important;" : ";", i = "";
|
|
1482
1482
|
for (var s in e) {
|
|
1483
1483
|
var r = e[s];
|
|
1484
|
-
r != null && r !== "" && (
|
|
1484
|
+
r != null && r !== "" && (i += " " + s + ": " + r + n);
|
|
1485
1485
|
}
|
|
1486
|
-
return
|
|
1486
|
+
return i;
|
|
1487
1487
|
}
|
|
1488
1488
|
function ne(e) {
|
|
1489
1489
|
return e[0] !== "-" || e[1] !== "-" ? e.toLowerCase() : e;
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1491
|
+
function ps(e, t) {
|
|
1492
1492
|
if (t) {
|
|
1493
|
-
var
|
|
1494
|
-
if (Array.isArray(t) ? (
|
|
1493
|
+
var n = "", i, s;
|
|
1494
|
+
if (Array.isArray(t) ? (i = t[0], s = t[1]) : i = t, e) {
|
|
1495
1495
|
e = String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
|
|
1496
|
-
var r = !1, o = 0, l = !1,
|
|
1497
|
-
|
|
1498
|
-
var
|
|
1499
|
-
const
|
|
1500
|
-
for (var d = 0; d <
|
|
1496
|
+
var r = !1, o = 0, l = !1, a = [];
|
|
1497
|
+
i && a.push(...Object.keys(i).map(ne)), s && a.push(...Object.keys(s).map(ne));
|
|
1498
|
+
var u = 0, c = -1;
|
|
1499
|
+
const y = e.length;
|
|
1500
|
+
for (var d = 0; d < y; d++) {
|
|
1501
1501
|
var f = e[d];
|
|
1502
1502
|
if (l ? f === "/" && e[d - 1] === "*" && (l = !1) : r ? r === f && (r = !1) : f === "/" && e[d + 1] === "*" ? l = !0 : f === '"' || f === "'" ? r = f : f === "(" ? o++ : f === ")" && o--, !l && r === !1 && o === 0) {
|
|
1503
1503
|
if (f === ":" && c === -1)
|
|
1504
1504
|
c = d;
|
|
1505
|
-
else if (f === ";" || d ===
|
|
1505
|
+
else if (f === ";" || d === y - 1) {
|
|
1506
1506
|
if (c !== -1) {
|
|
1507
|
-
var
|
|
1508
|
-
if (!
|
|
1507
|
+
var p = ne(e.substring(u, c).trim());
|
|
1508
|
+
if (!a.includes(p)) {
|
|
1509
1509
|
f !== ";" && d++;
|
|
1510
|
-
var C = e.substring(
|
|
1511
|
-
|
|
1510
|
+
var C = e.substring(u, d).trim();
|
|
1511
|
+
n += " " + C + ";";
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
|
-
|
|
1514
|
+
u = d + 1, c = -1;
|
|
1515
1515
|
}
|
|
1516
1516
|
}
|
|
1517
1517
|
}
|
|
1518
1518
|
}
|
|
1519
|
-
return
|
|
1519
|
+
return i && (n += Fe(i)), s && (n += Fe(s, !0)), n = n.trim(), n === "" ? null : n;
|
|
1520
1520
|
}
|
|
1521
1521
|
return e == null ? null : String(e);
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1523
|
+
function _s(e, t, n, i, s, r) {
|
|
1524
1524
|
var o = e.__className;
|
|
1525
|
-
if (o !==
|
|
1526
|
-
var l =
|
|
1527
|
-
l == null ? e.removeAttribute("class") : t ? e.className = l : e.setAttribute("class", l), e.__className =
|
|
1525
|
+
if (o !== n || o === void 0) {
|
|
1526
|
+
var l = hs(n, i, r);
|
|
1527
|
+
l == null ? e.removeAttribute("class") : t ? e.className = l : e.setAttribute("class", l), e.__className = n;
|
|
1528
1528
|
} else if (r && s !== r)
|
|
1529
|
-
for (var
|
|
1530
|
-
var
|
|
1531
|
-
(s == null ||
|
|
1529
|
+
for (var a in r) {
|
|
1530
|
+
var u = !!r[a];
|
|
1531
|
+
(s == null || u !== !!s[a]) && e.classList.toggle(a, u);
|
|
1532
1532
|
}
|
|
1533
1533
|
return r;
|
|
1534
1534
|
}
|
|
1535
|
-
function
|
|
1536
|
-
for (var s in
|
|
1537
|
-
var r =
|
|
1538
|
-
t[s] !== r && (
|
|
1535
|
+
function ie(e, t = {}, n, i) {
|
|
1536
|
+
for (var s in n) {
|
|
1537
|
+
var r = n[s];
|
|
1538
|
+
t[s] !== r && (n[s] == null ? e.style.removeProperty(s) : e.style.setProperty(s, r, i));
|
|
1539
1539
|
}
|
|
1540
1540
|
}
|
|
1541
|
-
function
|
|
1541
|
+
function Cs(e, t, n, i) {
|
|
1542
1542
|
var s = e.__style;
|
|
1543
1543
|
if (s !== t) {
|
|
1544
|
-
var r =
|
|
1544
|
+
var r = ps(t, i);
|
|
1545
1545
|
r == null ? e.removeAttribute("style") : e.style.cssText = r, e.__style = t;
|
|
1546
|
-
} else
|
|
1547
|
-
return
|
|
1546
|
+
} else i && (Array.isArray(i) ? (ie(e, n == null ? void 0 : n[0], i[0]), ie(e, n == null ? void 0 : n[1], i[1], "important")) : ie(e, n, i));
|
|
1547
|
+
return i;
|
|
1548
1548
|
}
|
|
1549
|
-
function
|
|
1549
|
+
function ge(e, t, n = !1) {
|
|
1550
1550
|
if (e.multiple) {
|
|
1551
1551
|
if (t == null)
|
|
1552
1552
|
return;
|
|
1553
1553
|
if (!$e(t))
|
|
1554
|
-
return
|
|
1555
|
-
for (var
|
|
1556
|
-
|
|
1554
|
+
return _i();
|
|
1555
|
+
for (var i of e.options)
|
|
1556
|
+
i.selected = t.includes(He(i));
|
|
1557
1557
|
return;
|
|
1558
1558
|
}
|
|
1559
|
-
for (
|
|
1560
|
-
var s = He(
|
|
1561
|
-
if (
|
|
1562
|
-
|
|
1559
|
+
for (i of e.options) {
|
|
1560
|
+
var s = He(i);
|
|
1561
|
+
if (Ri(s, t)) {
|
|
1562
|
+
i.selected = !0;
|
|
1563
1563
|
return;
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
|
-
(!
|
|
1566
|
+
(!n || t !== void 0) && (e.selectedIndex = -1);
|
|
1567
1567
|
}
|
|
1568
|
-
function
|
|
1568
|
+
function gs(e) {
|
|
1569
1569
|
var t = new MutationObserver(() => {
|
|
1570
|
-
|
|
1570
|
+
ge(e, e.__value);
|
|
1571
1571
|
});
|
|
1572
1572
|
t.observe(e, {
|
|
1573
1573
|
// Listen to option element changes
|
|
@@ -1579,87 +1579,87 @@ function _s(e) {
|
|
|
1579
1579
|
// because that property is not reflected as an attribute)
|
|
1580
1580
|
attributes: !0,
|
|
1581
1581
|
attributeFilter: ["value"]
|
|
1582
|
-
}),
|
|
1582
|
+
}), pn(() => {
|
|
1583
1583
|
t.disconnect();
|
|
1584
1584
|
});
|
|
1585
1585
|
}
|
|
1586
1586
|
function He(e) {
|
|
1587
1587
|
return "__value" in e ? e.__value : e.value;
|
|
1588
1588
|
}
|
|
1589
|
-
const
|
|
1590
|
-
function
|
|
1589
|
+
const Ot = Symbol("class"), Rt = Symbol("style"), Sn = Symbol("is custom element"), Tn = Symbol("is html");
|
|
1590
|
+
function ms(e, t) {
|
|
1591
1591
|
t ? e.hasAttribute("selected") || e.setAttribute("selected", "") : e.removeAttribute("selected");
|
|
1592
1592
|
}
|
|
1593
|
-
function Ve(e, t,
|
|
1594
|
-
var s =
|
|
1595
|
-
s[t] !== (s[t] =
|
|
1593
|
+
function Ve(e, t, n, i) {
|
|
1594
|
+
var s = Pn(e);
|
|
1595
|
+
s[t] !== (s[t] = n) && (t === "loading" && (e[ri] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && On(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
|
|
1596
1596
|
}
|
|
1597
|
-
function
|
|
1598
|
-
var o =
|
|
1597
|
+
function ys(e, t, n, i, s = !1, r = !1) {
|
|
1598
|
+
var o = Pn(e), l = o[Sn], a = !o[Tn], u = t || {}, c = e.tagName === "OPTION";
|
|
1599
1599
|
for (var d in t)
|
|
1600
|
-
d in
|
|
1601
|
-
|
|
1602
|
-
var f =
|
|
1603
|
-
for (const
|
|
1604
|
-
let
|
|
1605
|
-
if (c &&
|
|
1606
|
-
e.value = e.__value = "",
|
|
1600
|
+
d in n || (n[d] = null);
|
|
1601
|
+
n.class ? n.class = fs(n.class) : n[Ot] && (n.class = null), n[Rt] && (n.style ?? (n.style = null));
|
|
1602
|
+
var f = On(e);
|
|
1603
|
+
for (const h in n) {
|
|
1604
|
+
let v = n[h];
|
|
1605
|
+
if (c && h === "value" && v == null) {
|
|
1606
|
+
e.value = e.__value = "", u[h] = v;
|
|
1607
1607
|
continue;
|
|
1608
1608
|
}
|
|
1609
|
-
if (
|
|
1610
|
-
var
|
|
1611
|
-
|
|
1609
|
+
if (h === "class") {
|
|
1610
|
+
var p = e.namespaceURI === "http://www.w3.org/1999/xhtml";
|
|
1611
|
+
_s(e, p, v, i, t == null ? void 0 : t[Ot], n[Ot]), u[h] = v, u[Ot] = n[Ot];
|
|
1612
1612
|
continue;
|
|
1613
1613
|
}
|
|
1614
|
-
if (
|
|
1615
|
-
|
|
1614
|
+
if (h === "style") {
|
|
1615
|
+
Cs(e, v, t == null ? void 0 : t[Rt], n[Rt]), u[h] = v, u[Rt] = n[Rt];
|
|
1616
1616
|
continue;
|
|
1617
1617
|
}
|
|
1618
|
-
var C =
|
|
1619
|
-
if (!(
|
|
1620
|
-
|
|
1621
|
-
var
|
|
1622
|
-
if (
|
|
1623
|
-
if (
|
|
1624
|
-
const T = {}, ot = "$$" +
|
|
1625
|
-
let O =
|
|
1626
|
-
var
|
|
1627
|
-
if (
|
|
1628
|
-
if (
|
|
1629
|
-
e.removeEventListener(O,
|
|
1618
|
+
var C = u[h];
|
|
1619
|
+
if (!(v === C && !(v === void 0 && e.hasAttribute(h)))) {
|
|
1620
|
+
u[h] = v;
|
|
1621
|
+
var y = h[0] + h[1];
|
|
1622
|
+
if (y !== "$$")
|
|
1623
|
+
if (y === "on") {
|
|
1624
|
+
const T = {}, ot = "$$" + h;
|
|
1625
|
+
let O = h.slice(2);
|
|
1626
|
+
var b = ls(O);
|
|
1627
|
+
if (rs(O) && (O = O.slice(0, -7), T.capture = !0), !b && C) {
|
|
1628
|
+
if (v != null) continue;
|
|
1629
|
+
e.removeEventListener(O, u[ot], T), u[ot] = null;
|
|
1630
1630
|
}
|
|
1631
|
-
if (
|
|
1632
|
-
if (
|
|
1633
|
-
e[`__${O}`] =
|
|
1631
|
+
if (v != null)
|
|
1632
|
+
if (b)
|
|
1633
|
+
e[`__${O}`] = v, Ji([O]);
|
|
1634
1634
|
else {
|
|
1635
|
-
let
|
|
1636
|
-
|
|
1635
|
+
let xn = function(Bn) {
|
|
1636
|
+
u[h].call(this, Bn);
|
|
1637
1637
|
};
|
|
1638
|
-
|
|
1638
|
+
u[ot] = Zi(O, e, xn, T);
|
|
1639
1639
|
}
|
|
1640
|
-
else
|
|
1641
|
-
} else if (
|
|
1642
|
-
Ve(e,
|
|
1643
|
-
else if (
|
|
1644
|
-
|
|
1640
|
+
else b && (e[`__${O}`] = void 0);
|
|
1641
|
+
} else if (h === "style")
|
|
1642
|
+
Ve(e, h, v);
|
|
1643
|
+
else if (h === "autofocus")
|
|
1644
|
+
Fi(
|
|
1645
1645
|
/** @type {HTMLElement} */
|
|
1646
1646
|
e,
|
|
1647
|
-
!!
|
|
1647
|
+
!!v
|
|
1648
1648
|
);
|
|
1649
|
-
else if (!l && (
|
|
1650
|
-
e.value = e.__value =
|
|
1651
|
-
else if (
|
|
1652
|
-
|
|
1649
|
+
else if (!l && (h === "__value" || h === "value" && v != null))
|
|
1650
|
+
e.value = e.__value = v;
|
|
1651
|
+
else if (h === "selected" && c)
|
|
1652
|
+
ms(
|
|
1653
1653
|
/** @type {HTMLOptionElement} */
|
|
1654
1654
|
e,
|
|
1655
|
-
|
|
1655
|
+
v
|
|
1656
1656
|
);
|
|
1657
1657
|
else {
|
|
1658
|
-
var g =
|
|
1659
|
-
|
|
1658
|
+
var g = h;
|
|
1659
|
+
a || (g = us(g));
|
|
1660
1660
|
var m = g === "defaultValue" || g === "defaultChecked";
|
|
1661
|
-
if (
|
|
1662
|
-
if (o[
|
|
1661
|
+
if (v == null && !l && !m)
|
|
1662
|
+
if (o[h] = null, g === "value" || g === "checked") {
|
|
1663
1663
|
let T = (
|
|
1664
1664
|
/** @type {HTMLInputElement} */
|
|
1665
1665
|
e
|
|
@@ -1673,161 +1673,161 @@ function gs(e, t, i, n, s = !1, r = !1) {
|
|
|
1673
1673
|
T.removeAttribute(g), T.defaultChecked = O, T.checked = ot ? O : !1;
|
|
1674
1674
|
}
|
|
1675
1675
|
} else
|
|
1676
|
-
e.removeAttribute(
|
|
1677
|
-
else m || f.includes(g) && (l || typeof
|
|
1676
|
+
e.removeAttribute(h);
|
|
1677
|
+
else m || f.includes(g) && (l || typeof v != "string") ? (e[g] = v, g in o && (o[g] = P)) : typeof v != "function" && Ve(e, g, v);
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
|
-
return
|
|
1681
|
+
return u;
|
|
1682
1682
|
}
|
|
1683
|
-
function
|
|
1684
|
-
|
|
1685
|
-
var
|
|
1686
|
-
if (
|
|
1687
|
-
var C = t(...
|
|
1683
|
+
function vs(e, t, n = [], i = [], s = [], r, o = !1, l = !1) {
|
|
1684
|
+
Ai(s, n, i, (a) => {
|
|
1685
|
+
var u = void 0, c = {}, d = e.nodeName === "SELECT", f = !1;
|
|
1686
|
+
if (Cn(() => {
|
|
1687
|
+
var C = t(...a.map(I)), y = ys(
|
|
1688
1688
|
e,
|
|
1689
|
-
|
|
1689
|
+
u,
|
|
1690
1690
|
C,
|
|
1691
1691
|
r,
|
|
1692
1692
|
o,
|
|
1693
1693
|
l
|
|
1694
1694
|
);
|
|
1695
|
-
f && d && "value" in C &&
|
|
1695
|
+
f && d && "value" in C && ge(
|
|
1696
1696
|
/** @type {HTMLSelectElement} */
|
|
1697
1697
|
e,
|
|
1698
1698
|
C.value
|
|
1699
1699
|
);
|
|
1700
1700
|
for (let g of Object.getOwnPropertySymbols(c))
|
|
1701
|
-
C[g] ||
|
|
1701
|
+
C[g] || gt(c[g]);
|
|
1702
1702
|
for (let g of Object.getOwnPropertySymbols(C)) {
|
|
1703
|
-
var
|
|
1704
|
-
g.description ===
|
|
1703
|
+
var b = C[g];
|
|
1704
|
+
g.description === Xn && (!u || b !== u[g]) && (c[g] && gt(c[g]), c[g] = gn(() => cs(e, () => b))), y[g] = b;
|
|
1705
1705
|
}
|
|
1706
|
-
|
|
1706
|
+
u = y;
|
|
1707
1707
|
}), d) {
|
|
1708
|
-
var
|
|
1708
|
+
var p = (
|
|
1709
1709
|
/** @type {HTMLSelectElement} */
|
|
1710
1710
|
e
|
|
1711
1711
|
);
|
|
1712
1712
|
Le(() => {
|
|
1713
|
-
|
|
1714
|
-
|
|
1713
|
+
ge(
|
|
1714
|
+
p,
|
|
1715
1715
|
/** @type {Record<string | symbol, any>} */
|
|
1716
|
-
|
|
1716
|
+
u.value,
|
|
1717
1717
|
!0
|
|
1718
|
-
),
|
|
1718
|
+
), gs(p);
|
|
1719
1719
|
});
|
|
1720
1720
|
}
|
|
1721
1721
|
f = !0;
|
|
1722
1722
|
});
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1724
|
+
function Pn(e) {
|
|
1725
1725
|
return (
|
|
1726
1726
|
/** @type {Record<string | symbol, unknown>} **/
|
|
1727
1727
|
// @ts-expect-error
|
|
1728
1728
|
e.__attributes ?? (e.__attributes = {
|
|
1729
|
-
[
|
|
1730
|
-
[
|
|
1729
|
+
[Sn]: e.nodeName.includes("-"),
|
|
1730
|
+
[Tn]: e.namespaceURI === $n
|
|
1731
1731
|
})
|
|
1732
1732
|
);
|
|
1733
1733
|
}
|
|
1734
1734
|
var We = /* @__PURE__ */ new Map();
|
|
1735
|
-
function
|
|
1736
|
-
var t = e.getAttribute("is") || e.nodeName,
|
|
1737
|
-
if (
|
|
1738
|
-
We.set(t,
|
|
1739
|
-
for (var
|
|
1740
|
-
|
|
1741
|
-
for (var o in
|
|
1742
|
-
|
|
1735
|
+
function On(e) {
|
|
1736
|
+
var t = e.getAttribute("is") || e.nodeName, n = We.get(t);
|
|
1737
|
+
if (n) return n;
|
|
1738
|
+
We.set(t, n = []);
|
|
1739
|
+
for (var i, s = e, r = Element.prototype; r !== s; ) {
|
|
1740
|
+
i = Jn(s);
|
|
1741
|
+
for (var o in i)
|
|
1742
|
+
i[o].set && n.push(o);
|
|
1743
1743
|
s = Xe(s);
|
|
1744
1744
|
}
|
|
1745
|
-
return
|
|
1745
|
+
return n;
|
|
1746
1746
|
}
|
|
1747
1747
|
function je(e, t) {
|
|
1748
|
-
return e === t || (e == null ? void 0 : e[
|
|
1748
|
+
return e === t || (e == null ? void 0 : e[ft]) === t;
|
|
1749
1749
|
}
|
|
1750
|
-
function
|
|
1750
|
+
function bs(e = {}, t, n, i) {
|
|
1751
1751
|
return Le(() => {
|
|
1752
1752
|
var s, r;
|
|
1753
|
-
return
|
|
1754
|
-
s = r, r = [],
|
|
1755
|
-
e !==
|
|
1753
|
+
return Gi(() => {
|
|
1754
|
+
s = r, r = [], An(() => {
|
|
1755
|
+
e !== n(...r) && (t(e, ...r), s && je(n(...s), e) && t(null, ...s));
|
|
1756
1756
|
});
|
|
1757
1757
|
}), () => {
|
|
1758
|
-
|
|
1759
|
-
r && je(
|
|
1758
|
+
Jt(() => {
|
|
1759
|
+
r && je(n(...r), e) && t(null, ...r);
|
|
1760
1760
|
});
|
|
1761
1761
|
};
|
|
1762
1762
|
}), e;
|
|
1763
1763
|
}
|
|
1764
|
-
let
|
|
1765
|
-
function
|
|
1766
|
-
var t =
|
|
1764
|
+
let Ft = !1;
|
|
1765
|
+
function ws(e) {
|
|
1766
|
+
var t = Ft;
|
|
1767
1767
|
try {
|
|
1768
|
-
return
|
|
1768
|
+
return Ft = !1, [e(), Ft];
|
|
1769
1769
|
} finally {
|
|
1770
|
-
|
|
1770
|
+
Ft = t;
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
1773
|
-
function
|
|
1773
|
+
function Ht(e, t, n, i) {
|
|
1774
1774
|
var m;
|
|
1775
|
-
var s = (
|
|
1775
|
+
var s = (n & Kn) !== 0, r = (n & Yn) !== 0, o = (
|
|
1776
1776
|
/** @type {V} */
|
|
1777
|
-
|
|
1778
|
-
), l = !0,
|
|
1777
|
+
i
|
|
1778
|
+
), l = !0, a = () => (l && (l = !1, o = r ? An(
|
|
1779
1779
|
/** @type {() => V} */
|
|
1780
|
-
|
|
1780
|
+
i
|
|
1781
1781
|
) : (
|
|
1782
1782
|
/** @type {V} */
|
|
1783
|
-
|
|
1784
|
-
)), o),
|
|
1783
|
+
i
|
|
1784
|
+
)), o), u;
|
|
1785
1785
|
if (s) {
|
|
1786
|
-
var c =
|
|
1787
|
-
|
|
1786
|
+
var c = ft in e || si in e;
|
|
1787
|
+
u = ((m = Wt(e, t)) == null ? void 0 : m.set) ?? (c && t in e ? (h) => e[t] = h : void 0);
|
|
1788
1788
|
}
|
|
1789
1789
|
var d, f = !1;
|
|
1790
|
-
s ? [d, f] =
|
|
1790
|
+
s ? [d, f] = ws(() => (
|
|
1791
1791
|
/** @type {V} */
|
|
1792
1792
|
e[t]
|
|
1793
1793
|
)) : d = /** @type {V} */
|
|
1794
|
-
e[t], d === void 0 &&
|
|
1795
|
-
var
|
|
1796
|
-
if (
|
|
1797
|
-
var
|
|
1794
|
+
e[t], d === void 0 && i !== void 0 && (d = a(), u && (di(), u(d)));
|
|
1795
|
+
var p;
|
|
1796
|
+
if (p = () => {
|
|
1797
|
+
var h = (
|
|
1798
1798
|
/** @type {V} */
|
|
1799
1799
|
e[t]
|
|
1800
1800
|
);
|
|
1801
|
-
return
|
|
1802
|
-
}, (
|
|
1803
|
-
return
|
|
1804
|
-
if (
|
|
1801
|
+
return h === void 0 ? a() : (l = !0, h);
|
|
1802
|
+
}, (n & zn) === 0)
|
|
1803
|
+
return p;
|
|
1804
|
+
if (u) {
|
|
1805
1805
|
var C = e.$$legacy;
|
|
1806
1806
|
return (
|
|
1807
1807
|
/** @type {() => V} */
|
|
1808
|
-
(function(
|
|
1809
|
-
return arguments.length > 0 ? ((!
|
|
1808
|
+
(function(h, v) {
|
|
1809
|
+
return arguments.length > 0 ? ((!v || C || f) && u(v ? p() : h), h) : p();
|
|
1810
1810
|
})
|
|
1811
1811
|
);
|
|
1812
1812
|
}
|
|
1813
|
-
var
|
|
1814
|
-
s && I(
|
|
1813
|
+
var y = !1, b = ((n & Gn) !== 0 ? Ne : Ti)(() => (y = !1, p()));
|
|
1814
|
+
s && I(b);
|
|
1815
1815
|
var g = (
|
|
1816
1816
|
/** @type {Effect} */
|
|
1817
|
-
|
|
1817
|
+
N
|
|
1818
1818
|
);
|
|
1819
1819
|
return (
|
|
1820
1820
|
/** @type {() => V} */
|
|
1821
|
-
(function(
|
|
1821
|
+
(function(h, v) {
|
|
1822
1822
|
if (arguments.length > 0) {
|
|
1823
|
-
const T =
|
|
1824
|
-
return
|
|
1823
|
+
const T = v ? I(b) : s ? Et(h) : h;
|
|
1824
|
+
return V(b, T), y = !0, o !== void 0 && (o = T), h;
|
|
1825
1825
|
}
|
|
1826
|
-
return
|
|
1826
|
+
return it && y || (g.f & J) !== 0 ? b.v : I(b);
|
|
1827
1827
|
})
|
|
1828
1828
|
);
|
|
1829
1829
|
}
|
|
1830
|
-
const
|
|
1830
|
+
const Is = [
|
|
1831
1831
|
[
|
|
1832
1832
|
"af",
|
|
1833
1833
|
// Afghanistan
|
|
@@ -3504,9 +3504,9 @@ const bs = [
|
|
|
3504
3504
|
null,
|
|
3505
3505
|
"0"
|
|
3506
3506
|
]
|
|
3507
|
-
],
|
|
3508
|
-
for (const e of
|
|
3509
|
-
|
|
3507
|
+
], _t = [];
|
|
3508
|
+
for (const e of Is)
|
|
3509
|
+
_t.push({
|
|
3510
3510
|
name: "",
|
|
3511
3511
|
// populated in the plugin
|
|
3512
3512
|
iso2: e[0],
|
|
@@ -3523,7 +3523,7 @@ for (const e of bs)
|
|
|
3523
3523
|
dialCodePlus: ""
|
|
3524
3524
|
// populated in the plugin
|
|
3525
3525
|
});
|
|
3526
|
-
const
|
|
3526
|
+
const Es = {
|
|
3527
3527
|
ad: "Andorra",
|
|
3528
3528
|
ae: "United Arab Emirates",
|
|
3529
3529
|
af: "Afghanistan",
|
|
@@ -3766,7 +3766,7 @@ const ws = {
|
|
|
3766
3766
|
za: "South Africa",
|
|
3767
3767
|
zm: "Zambia",
|
|
3768
3768
|
zw: "Zimbabwe"
|
|
3769
|
-
},
|
|
3769
|
+
}, Ns = {
|
|
3770
3770
|
selectedCountryAriaLabel: "Change country, selected ${countryName} (${dialCode})",
|
|
3771
3771
|
noCountrySelected: "Select country",
|
|
3772
3772
|
countryListAriaLabel: "List of countries",
|
|
@@ -3778,7 +3778,7 @@ const ws = {
|
|
|
3778
3778
|
// additional countries (not supported by country-list library)
|
|
3779
3779
|
ac: "Ascension Island",
|
|
3780
3780
|
xk: "Kosovo"
|
|
3781
|
-
},
|
|
3781
|
+
}, Rn = { ...Es, ...Ns }, Vt = {
|
|
3782
3782
|
OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
|
|
3783
3783
|
CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
|
|
3784
3784
|
COUNTRY_CHANGE: "countrychange",
|
|
@@ -3792,7 +3792,7 @@ const ws = {
|
|
|
3792
3792
|
FLAG: "iti__flag",
|
|
3793
3793
|
COUNTRY_ITEM: "iti__country",
|
|
3794
3794
|
HIGHLIGHT: "iti__highlight"
|
|
3795
|
-
},
|
|
3795
|
+
}, M = {
|
|
3796
3796
|
ARROW_UP: "ArrowUp",
|
|
3797
3797
|
ARROW_DOWN: "ArrowDown",
|
|
3798
3798
|
SPACE: " ",
|
|
@@ -3802,7 +3802,7 @@ const ws = {
|
|
|
3802
3802
|
}, Ge = {
|
|
3803
3803
|
PASTE: "insertFromPaste",
|
|
3804
3804
|
DELETE_FWD: "deleteContentForward"
|
|
3805
|
-
},
|
|
3805
|
+
}, at = {
|
|
3806
3806
|
ALPHA_UNICODE: new RegExp("\\p{L}", "u"),
|
|
3807
3807
|
// any kind of letter from any language
|
|
3808
3808
|
NON_PLUS_NUMERIC: /[^+0-9]/,
|
|
@@ -3811,39 +3811,39 @@ const ws = {
|
|
|
3811
3811
|
// chars that are NOT + or digit (global)
|
|
3812
3812
|
HIDDEN_SEARCH_CHAR: /^[a-zA-ZÀ-ÿа-яА-Я ]$/
|
|
3813
3813
|
// single acceptable hidden-search char
|
|
3814
|
-
},
|
|
3814
|
+
}, Ds = {
|
|
3815
3815
|
HIDDEN_SEARCH_RESET_MS: 1e3
|
|
3816
3816
|
}, ze = {
|
|
3817
3817
|
UNKNOWN_NUMBER_TYPE: -99,
|
|
3818
3818
|
UNKNOWN_VALIDATION_ERROR: -99
|
|
3819
|
-
},
|
|
3819
|
+
}, se = {
|
|
3820
3820
|
SANE_SELECTED_WITH_DIAL_WIDTH: 78,
|
|
3821
3821
|
// px width fallback when separateDialCode enabled
|
|
3822
3822
|
SANE_SELECTED_NO_DIAL_WIDTH: 42,
|
|
3823
3823
|
// px width fallback when no separate dial code
|
|
3824
3824
|
INPUT_PADDING_EXTRA_LEFT: 6
|
|
3825
3825
|
// px gap between selected country container and input text
|
|
3826
|
-
},
|
|
3826
|
+
}, kn = {
|
|
3827
3827
|
NANP: "1"
|
|
3828
3828
|
// North American Numbering Plan
|
|
3829
|
-
},
|
|
3829
|
+
}, re = {
|
|
3830
3830
|
DIAL_CODE: "44",
|
|
3831
3831
|
// +44 United Kingdom
|
|
3832
3832
|
MOBILE_PREFIX: "7",
|
|
3833
3833
|
// UK mobile numbers start with 7 after national trunk (0) or core section
|
|
3834
3834
|
MOBILE_CORE_LENGTH: 10
|
|
3835
3835
|
// core number length (excluding dial code / national prefix) for mobiles
|
|
3836
|
-
},
|
|
3836
|
+
}, As = {
|
|
3837
3837
|
ISO2: "us"
|
|
3838
|
-
},
|
|
3838
|
+
}, me = {
|
|
3839
3839
|
AGGRESSIVE: "aggressive",
|
|
3840
3840
|
POLITE: "polite"
|
|
3841
|
-
},
|
|
3841
|
+
}, oe = {
|
|
3842
3842
|
AUTO: "auto"
|
|
3843
3843
|
}, Ke = {
|
|
3844
3844
|
COUNTRY_CODE: "countryCode",
|
|
3845
3845
|
DIAL_CODE: "dialCode"
|
|
3846
|
-
},
|
|
3846
|
+
}, D = {
|
|
3847
3847
|
EXPANDED: "aria-expanded",
|
|
3848
3848
|
LABEL: "aria-label",
|
|
3849
3849
|
SELECTED: "aria-selected",
|
|
@@ -3853,21 +3853,21 @@ const ws = {
|
|
|
3853
3853
|
HIDDEN: "aria-hidden",
|
|
3854
3854
|
AUTOCOMPLETE: "aria-autocomplete",
|
|
3855
3855
|
MODAL: "aria-modal"
|
|
3856
|
-
},
|
|
3856
|
+
}, le = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, Ls = () => {
|
|
3857
3857
|
if (typeof navigator < "u" && typeof window < "u") {
|
|
3858
3858
|
const e = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
3859
3859
|
navigator.userAgent
|
|
3860
|
-
), t =
|
|
3861
|
-
return e || t ||
|
|
3860
|
+
), t = le("(max-width: 500px)"), n = le("(max-height: 600px)"), i = le("(pointer: coarse)");
|
|
3861
|
+
return e || t || i && n;
|
|
3862
3862
|
}
|
|
3863
3863
|
return !1;
|
|
3864
|
-
},
|
|
3864
|
+
}, Mn = {
|
|
3865
3865
|
// Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
|
|
3866
3866
|
allowPhonewords: !1,
|
|
3867
3867
|
//* Whether or not to allow the dropdown.
|
|
3868
3868
|
allowDropdown: !0,
|
|
3869
3869
|
//* Add a placeholder in the input with an example number for the selected country.
|
|
3870
|
-
autoPlaceholder:
|
|
3870
|
+
autoPlaceholder: me.POLITE,
|
|
3871
3871
|
//* Modify the parentClass.
|
|
3872
3872
|
containerClass: "",
|
|
3873
3873
|
//* The order of the countries in the dropdown. Defaults to alphabetical.
|
|
@@ -3909,43 +3909,43 @@ const ws = {
|
|
|
3909
3909
|
//* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
|
|
3910
3910
|
strictMode: !1,
|
|
3911
3911
|
//* Use full screen popup instead of dropdown for country list.
|
|
3912
|
-
useFullscreenPopup:
|
|
3912
|
+
useFullscreenPopup: Ls(),
|
|
3913
3913
|
//* The number type to enforce during validation.
|
|
3914
3914
|
validationNumberTypes: ["MOBILE"]
|
|
3915
|
-
},
|
|
3915
|
+
}, Ss = (e, t) => {
|
|
3916
3916
|
e.useFullscreenPopup && (e.fixDropdownWidth = !1), e.onlyCountries.length === 1 && (e.initialCountry = e.onlyCountries[0]), e.separateDialCode && (e.nationalMode = !1), e.allowDropdown && !e.showFlags && !e.separateDialCode && (e.nationalMode = !1), e.useFullscreenPopup && !e.dropdownContainer && (e.dropdownContainer = document.body), e.i18n = { ...t, ...e.i18n };
|
|
3917
|
-
},
|
|
3918
|
-
const
|
|
3917
|
+
}, jt = (e) => e.replace(/\D/g, ""), Un = (e = "") => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), Ts = (e, t) => {
|
|
3918
|
+
const n = Un(t), i = [], s = [], r = [], o = [], l = [], a = [];
|
|
3919
3919
|
for (const c of e)
|
|
3920
|
-
c.iso2 ===
|
|
3921
|
-
const
|
|
3920
|
+
c.iso2 === n ? i.push(c) : c.normalisedName.startsWith(n) ? s.push(c) : c.normalisedName.includes(n) ? r.push(c) : n === c.dialCode || n === c.dialCodePlus ? o.push(c) : c.dialCodePlus.includes(n) ? l.push(c) : c.initials.includes(n) && a.push(c);
|
|
3921
|
+
const u = (c, d) => c.priority - d.priority;
|
|
3922
3922
|
return [
|
|
3923
|
-
...
|
|
3924
|
-
...s.sort(
|
|
3925
|
-
...r.sort(
|
|
3926
|
-
...o.sort(
|
|
3927
|
-
...l.sort(
|
|
3928
|
-
...
|
|
3923
|
+
...i.sort(u),
|
|
3924
|
+
...s.sort(u),
|
|
3925
|
+
...r.sort(u),
|
|
3926
|
+
...o.sort(u),
|
|
3927
|
+
...l.sort(u),
|
|
3928
|
+
...a.sort(u)
|
|
3929
3929
|
];
|
|
3930
|
-
},
|
|
3931
|
-
const
|
|
3932
|
-
for (const
|
|
3933
|
-
if (
|
|
3934
|
-
return
|
|
3930
|
+
}, Ps = (e, t) => {
|
|
3931
|
+
const n = t.toLowerCase();
|
|
3932
|
+
for (const i of e)
|
|
3933
|
+
if (i.name.toLowerCase().startsWith(n))
|
|
3934
|
+
return i;
|
|
3935
3935
|
return null;
|
|
3936
|
-
},
|
|
3937
|
-
const
|
|
3936
|
+
}, ae = (e) => Object.keys(e).filter((t) => !!e[t]).join(" "), L = (e, t, n) => {
|
|
3937
|
+
const i = document.createElement(e);
|
|
3938
3938
|
return t && Object.entries(t).forEach(
|
|
3939
|
-
([s, r]) =>
|
|
3940
|
-
),
|
|
3941
|
-
},
|
|
3942
|
-
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${
|
|
3939
|
+
([s, r]) => i.setAttribute(s, r)
|
|
3940
|
+
), n && n.appendChild(i), i;
|
|
3941
|
+
}, Os = () => `
|
|
3942
|
+
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${D.HIDDEN}="true">
|
|
3943
3943
|
<circle cx="11" cy="11" r="7" />
|
|
3944
3944
|
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
3945
|
-
</svg>`,
|
|
3945
|
+
</svg>`, Rs = (e) => {
|
|
3946
3946
|
const t = `iti-${e}-clear-mask`;
|
|
3947
3947
|
return `
|
|
3948
|
-
<svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${
|
|
3948
|
+
<svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${D.HIDDEN}="true" focusable="false">
|
|
3949
3949
|
<mask id="${t}" maskUnits="userSpaceOnUse">
|
|
3950
3950
|
<rect width="16" height="16" fill="white" />
|
|
3951
3951
|
<path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
|
|
@@ -3953,123 +3953,123 @@ const ws = {
|
|
|
3953
3953
|
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${t})" />
|
|
3954
3954
|
</svg>`;
|
|
3955
3955
|
};
|
|
3956
|
-
class
|
|
3957
|
-
constructor(t,
|
|
3958
|
-
this.highlightedItem = null, this.selectedItem = null, t.dataset.intlTelInputId =
|
|
3956
|
+
class ks {
|
|
3957
|
+
constructor(t, n, i) {
|
|
3958
|
+
this.highlightedItem = null, this.selectedItem = null, t.dataset.intlTelInputId = i.toString(), this.telInput = t, this.options = n, this.id = i, this.hadInitialPlaceholder = !!t.getAttribute("placeholder"), this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.originalPaddingLeft = this.telInput.style.paddingLeft);
|
|
3959
3959
|
}
|
|
3960
3960
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
3961
3961
|
generateMarkup(t) {
|
|
3962
3962
|
this.countries = t, this._prepareTelInput();
|
|
3963
|
-
const
|
|
3964
|
-
this._maybeBuildCountryContainer(
|
|
3963
|
+
const n = this._createWrapperAndInsert();
|
|
3964
|
+
this._maybeBuildCountryContainer(n), n.appendChild(this.telInput), this._maybeUpdateInputPaddingAndReveal(), this._maybeBuildHiddenInputs(n);
|
|
3965
3965
|
}
|
|
3966
3966
|
_prepareTelInput() {
|
|
3967
3967
|
var t;
|
|
3968
3968
|
this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !((t = this.telInput.form) != null && t.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
|
|
3969
3969
|
}
|
|
3970
3970
|
_createWrapperAndInsert() {
|
|
3971
|
-
const { allowDropdown: t, showFlags:
|
|
3971
|
+
const { allowDropdown: t, showFlags: n, containerClass: i, useFullscreenPopup: s } = this.options, r = ae({
|
|
3972
3972
|
iti: !0,
|
|
3973
3973
|
"iti--allow-dropdown": t,
|
|
3974
|
-
"iti--show-flags":
|
|
3974
|
+
"iti--show-flags": n,
|
|
3975
3975
|
"iti--inline-dropdown": !s,
|
|
3976
|
-
[
|
|
3977
|
-
}), o =
|
|
3976
|
+
[i]: !!i
|
|
3977
|
+
}), o = L("div", { class: r });
|
|
3978
3978
|
return this.isRTL && o.setAttribute("dir", "ltr"), this.telInput.before(o), o;
|
|
3979
3979
|
}
|
|
3980
3980
|
_maybeBuildCountryContainer(t) {
|
|
3981
|
-
const { allowDropdown:
|
|
3982
|
-
if (
|
|
3983
|
-
this.countryContainer =
|
|
3981
|
+
const { allowDropdown: n, separateDialCode: i, showFlags: s } = this.options;
|
|
3982
|
+
if (n || s || i) {
|
|
3983
|
+
this.countryContainer = L(
|
|
3984
3984
|
"div",
|
|
3985
3985
|
// visibly hidden until we measure it's width to set the input padding correctly
|
|
3986
3986
|
{ class: `iti__country-container ${E.V_HIDE}` },
|
|
3987
3987
|
t
|
|
3988
|
-
),
|
|
3988
|
+
), n ? (this.selectedCountry = L(
|
|
3989
3989
|
"button",
|
|
3990
3990
|
{
|
|
3991
3991
|
type: "button",
|
|
3992
3992
|
class: "iti__selected-country",
|
|
3993
|
-
[
|
|
3994
|
-
[
|
|
3995
|
-
[
|
|
3996
|
-
[
|
|
3993
|
+
[D.EXPANDED]: "false",
|
|
3994
|
+
[D.LABEL]: this.options.i18n.noCountrySelected,
|
|
3995
|
+
[D.HASPOPUP]: "dialog",
|
|
3996
|
+
[D.CONTROLS]: `iti-${this.id}__dropdown-content`
|
|
3997
3997
|
},
|
|
3998
3998
|
this.countryContainer
|
|
3999
|
-
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry =
|
|
3999
|
+
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = L(
|
|
4000
4000
|
"div",
|
|
4001
4001
|
{ class: "iti__selected-country" },
|
|
4002
4002
|
this.countryContainer
|
|
4003
4003
|
);
|
|
4004
|
-
const r =
|
|
4004
|
+
const r = L(
|
|
4005
4005
|
"div",
|
|
4006
4006
|
{ class: "iti__selected-country-primary" },
|
|
4007
4007
|
this.selectedCountry
|
|
4008
4008
|
);
|
|
4009
|
-
this.selectedCountryInner =
|
|
4009
|
+
this.selectedCountryInner = L(
|
|
4010
4010
|
"div",
|
|
4011
4011
|
{ class: E.FLAG },
|
|
4012
4012
|
r
|
|
4013
|
-
),
|
|
4013
|
+
), n && (this.dropdownArrow = L(
|
|
4014
4014
|
"div",
|
|
4015
|
-
{ class: "iti__arrow", [
|
|
4015
|
+
{ class: "iti__arrow", [D.HIDDEN]: "true" },
|
|
4016
4016
|
r
|
|
4017
|
-
)),
|
|
4017
|
+
)), i && (this.selectedDialCode = L(
|
|
4018
4018
|
"div",
|
|
4019
4019
|
{ class: "iti__selected-dial-code" },
|
|
4020
4020
|
this.selectedCountry
|
|
4021
|
-
)),
|
|
4021
|
+
)), n && this._buildDropdownContent();
|
|
4022
4022
|
}
|
|
4023
4023
|
}
|
|
4024
4024
|
_buildDropdownContent() {
|
|
4025
4025
|
const {
|
|
4026
4026
|
fixDropdownWidth: t,
|
|
4027
|
-
useFullscreenPopup:
|
|
4028
|
-
countrySearch:
|
|
4027
|
+
useFullscreenPopup: n,
|
|
4028
|
+
countrySearch: i,
|
|
4029
4029
|
i18n: s,
|
|
4030
4030
|
dropdownContainer: r,
|
|
4031
4031
|
containerClass: o
|
|
4032
4032
|
} = this.options, l = t ? "" : "iti--flexible-dropdown-width";
|
|
4033
|
-
if (this.dropdownContent =
|
|
4033
|
+
if (this.dropdownContent = L("div", {
|
|
4034
4034
|
id: `iti-${this.id}__dropdown-content`,
|
|
4035
4035
|
class: `iti__dropdown-content ${E.HIDE} ${l}`,
|
|
4036
4036
|
role: "dialog",
|
|
4037
|
-
[
|
|
4038
|
-
}), this.isRTL && this.dropdownContent.setAttribute("dir", "rtl"),
|
|
4037
|
+
[D.MODAL]: "true"
|
|
4038
|
+
}), this.isRTL && this.dropdownContent.setAttribute("dir", "rtl"), i && this._buildSearchUI(), this.countryList = L(
|
|
4039
4039
|
"ul",
|
|
4040
4040
|
{
|
|
4041
4041
|
class: "iti__country-list",
|
|
4042
4042
|
id: `iti-${this.id}__country-listbox`,
|
|
4043
4043
|
role: "listbox",
|
|
4044
|
-
[
|
|
4044
|
+
[D.LABEL]: s.countryListAriaLabel
|
|
4045
4045
|
},
|
|
4046
4046
|
this.dropdownContent
|
|
4047
|
-
), this._appendListItems(),
|
|
4048
|
-
const
|
|
4047
|
+
), this._appendListItems(), i && this.updateSearchResultsA11yText(), r) {
|
|
4048
|
+
const a = ae({
|
|
4049
4049
|
iti: !0,
|
|
4050
4050
|
"iti--container": !0,
|
|
4051
|
-
"iti--fullscreen-popup":
|
|
4052
|
-
"iti--inline-dropdown": !
|
|
4051
|
+
"iti--fullscreen-popup": n,
|
|
4052
|
+
"iti--inline-dropdown": !n,
|
|
4053
4053
|
[o]: !!o
|
|
4054
4054
|
});
|
|
4055
|
-
this.dropdown =
|
|
4055
|
+
this.dropdown = L("div", { class: a }), this.dropdown.appendChild(this.dropdownContent);
|
|
4056
4056
|
} else
|
|
4057
4057
|
this.countryContainer.appendChild(this.dropdownContent);
|
|
4058
4058
|
}
|
|
4059
4059
|
_buildSearchUI() {
|
|
4060
|
-
const { i18n: t } = this.options,
|
|
4060
|
+
const { i18n: t } = this.options, n = L(
|
|
4061
4061
|
"div",
|
|
4062
4062
|
{ class: "iti__search-input-wrapper" },
|
|
4063
4063
|
this.dropdownContent
|
|
4064
4064
|
);
|
|
4065
|
-
this.searchIcon =
|
|
4065
|
+
this.searchIcon = L(
|
|
4066
4066
|
"span",
|
|
4067
4067
|
{
|
|
4068
4068
|
class: "iti__search-icon",
|
|
4069
|
-
[
|
|
4069
|
+
[D.HIDDEN]: "true"
|
|
4070
4070
|
},
|
|
4071
|
-
|
|
4072
|
-
), this.searchIcon.innerHTML =
|
|
4071
|
+
n
|
|
4072
|
+
), this.searchIcon.innerHTML = Os(), this.searchInput = L(
|
|
4073
4073
|
"input",
|
|
4074
4074
|
{
|
|
4075
4075
|
id: `iti-${this.id}__search-input`,
|
|
@@ -4079,31 +4079,31 @@ class Os {
|
|
|
4079
4079
|
placeholder: t.searchPlaceholder,
|
|
4080
4080
|
// role=combobox + aria-autocomplete=list + aria-activedescendant allows maintaining focus on the search input while allowing users to navigate search results with up/down keyboard keys
|
|
4081
4081
|
role: "combobox",
|
|
4082
|
-
[
|
|
4083
|
-
[
|
|
4084
|
-
[
|
|
4085
|
-
[
|
|
4082
|
+
[D.EXPANDED]: "true",
|
|
4083
|
+
[D.LABEL]: t.searchPlaceholder,
|
|
4084
|
+
[D.CONTROLS]: `iti-${this.id}__country-listbox`,
|
|
4085
|
+
[D.AUTOCOMPLETE]: "list",
|
|
4086
4086
|
autocomplete: "off"
|
|
4087
4087
|
},
|
|
4088
|
-
|
|
4089
|
-
), this.searchClearButton =
|
|
4088
|
+
n
|
|
4089
|
+
), this.searchClearButton = L(
|
|
4090
4090
|
"button",
|
|
4091
4091
|
{
|
|
4092
4092
|
type: "button",
|
|
4093
4093
|
class: `iti__search-clear ${E.HIDE}`,
|
|
4094
|
-
[
|
|
4094
|
+
[D.LABEL]: t.clearSearchAriaLabel,
|
|
4095
4095
|
tabindex: "-1"
|
|
4096
4096
|
},
|
|
4097
|
-
|
|
4098
|
-
), this.searchClearButton.innerHTML =
|
|
4097
|
+
n
|
|
4098
|
+
), this.searchClearButton.innerHTML = Rs(this.id), this.searchResultsA11yText = L(
|
|
4099
4099
|
"span",
|
|
4100
4100
|
{ class: "iti__a11y-text" },
|
|
4101
4101
|
this.dropdownContent
|
|
4102
|
-
), this.searchNoResults =
|
|
4102
|
+
), this.searchNoResults = L(
|
|
4103
4103
|
"div",
|
|
4104
4104
|
{
|
|
4105
4105
|
class: `iti__no-results ${E.HIDE}`,
|
|
4106
|
-
[
|
|
4106
|
+
[D.HIDDEN]: "true"
|
|
4107
4107
|
// all a11y messaging happens in this.searchResultsA11yText
|
|
4108
4108
|
},
|
|
4109
4109
|
this.dropdownContent
|
|
@@ -4113,15 +4113,15 @@ class Os {
|
|
|
4113
4113
|
this.countryContainer && (this.updateInputPadding(), this.countryContainer.classList.remove(E.V_HIDE));
|
|
4114
4114
|
}
|
|
4115
4115
|
_maybeBuildHiddenInputs(t) {
|
|
4116
|
-
var
|
|
4117
|
-
const { hiddenInput:
|
|
4118
|
-
if (
|
|
4119
|
-
const r = this.telInput.getAttribute("name") || "", o =
|
|
4116
|
+
var i, s;
|
|
4117
|
+
const { hiddenInput: n } = this.options;
|
|
4118
|
+
if (n) {
|
|
4119
|
+
const r = this.telInput.getAttribute("name") || "", o = n(r);
|
|
4120
4120
|
if (o.phone) {
|
|
4121
|
-
const l = (
|
|
4121
|
+
const l = (i = this.telInput.form) == null ? void 0 : i.querySelector(
|
|
4122
4122
|
`input[name="${o.phone}"]`
|
|
4123
4123
|
);
|
|
4124
|
-
l ? this.hiddenInput = l : (this.hiddenInput =
|
|
4124
|
+
l ? this.hiddenInput = l : (this.hiddenInput = L("input", {
|
|
4125
4125
|
type: "hidden",
|
|
4126
4126
|
name: o.phone
|
|
4127
4127
|
}), t.appendChild(this.hiddenInput));
|
|
@@ -4130,7 +4130,7 @@ class Os {
|
|
|
4130
4130
|
const l = (s = this.telInput.form) == null ? void 0 : s.querySelector(
|
|
4131
4131
|
`input[name="${o.country}"]`
|
|
4132
4132
|
);
|
|
4133
|
-
l ? this.hiddenInputCountry = l : (this.hiddenInputCountry =
|
|
4133
|
+
l ? this.hiddenInputCountry = l : (this.hiddenInputCountry = L("input", {
|
|
4134
4134
|
type: "hidden",
|
|
4135
4135
|
name: o.country
|
|
4136
4136
|
}), t.appendChild(this.hiddenInputCountry));
|
|
@@ -4140,29 +4140,29 @@ class Os {
|
|
|
4140
4140
|
//* For each country: add a country list item <li> to the countryList <ul> container.
|
|
4141
4141
|
_appendListItems() {
|
|
4142
4142
|
const t = document.createDocumentFragment();
|
|
4143
|
-
for (let
|
|
4144
|
-
const
|
|
4143
|
+
for (let n = 0; n < this.countries.length; n++) {
|
|
4144
|
+
const i = this.countries[n], s = ae({
|
|
4145
4145
|
[E.COUNTRY_ITEM]: !0
|
|
4146
|
-
}), r =
|
|
4147
|
-
id: `iti-${this.id}__item-${
|
|
4146
|
+
}), r = L("li", {
|
|
4147
|
+
id: `iti-${this.id}__item-${i.iso2}`,
|
|
4148
4148
|
class: s,
|
|
4149
4149
|
tabindex: "-1",
|
|
4150
4150
|
role: "option",
|
|
4151
|
-
[
|
|
4151
|
+
[D.SELECTED]: "false"
|
|
4152
4152
|
});
|
|
4153
|
-
r.dataset.dialCode =
|
|
4154
|
-
const o =
|
|
4155
|
-
o.textContent =
|
|
4156
|
-
const l =
|
|
4157
|
-
this.isRTL && l.setAttribute("dir", "ltr"), l.textContent = `+${
|
|
4153
|
+
r.dataset.dialCode = i.dialCode, r.dataset.countryCode = i.iso2, i.nodeById[this.id] = r, this.options.showFlags && L("div", { class: `${E.FLAG} iti__${i.iso2}` }, r);
|
|
4154
|
+
const o = L("span", { class: "iti__country-name" }, r);
|
|
4155
|
+
o.textContent = i.name;
|
|
4156
|
+
const l = L("span", { class: "iti__dial-code" }, r);
|
|
4157
|
+
this.isRTL && l.setAttribute("dir", "ltr"), l.textContent = `+${i.dialCode}`, t.appendChild(r);
|
|
4158
4158
|
}
|
|
4159
4159
|
this.countryList.appendChild(t);
|
|
4160
4160
|
}
|
|
4161
4161
|
//* Update the input padding to make space for the selected country/dial code.
|
|
4162
4162
|
updateInputPadding() {
|
|
4163
4163
|
if (this.selectedCountry) {
|
|
4164
|
-
const t = this.options.separateDialCode ?
|
|
4165
|
-
this.telInput.style.paddingLeft = `${
|
|
4164
|
+
const t = this.options.separateDialCode ? se.SANE_SELECTED_WITH_DIAL_WIDTH : se.SANE_SELECTED_NO_DIAL_WIDTH, i = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth() || t) + se.INPUT_PADDING_EXTRA_LEFT;
|
|
4165
|
+
this.telInput.style.paddingLeft = `${i}px`;
|
|
4166
4166
|
}
|
|
4167
4167
|
}
|
|
4168
4168
|
//* When input is in a hidden container during init, we cannot calculate the selected country width.
|
|
@@ -4177,165 +4177,165 @@ class Os {
|
|
|
4177
4177
|
} catch {
|
|
4178
4178
|
t = document.body;
|
|
4179
4179
|
}
|
|
4180
|
-
const
|
|
4180
|
+
const n = this.telInput.parentNode.cloneNode(
|
|
4181
4181
|
!1
|
|
4182
4182
|
);
|
|
4183
|
-
|
|
4184
|
-
const
|
|
4185
|
-
|
|
4183
|
+
n.style.visibility = "hidden", t.appendChild(n);
|
|
4184
|
+
const i = this.countryContainer.cloneNode();
|
|
4185
|
+
n.appendChild(i);
|
|
4186
4186
|
const s = this.selectedCountry.cloneNode(
|
|
4187
4187
|
!0
|
|
4188
4188
|
);
|
|
4189
|
-
|
|
4189
|
+
i.appendChild(s);
|
|
4190
4190
|
const r = s.offsetWidth;
|
|
4191
|
-
return t.removeChild(
|
|
4191
|
+
return t.removeChild(n), r;
|
|
4192
4192
|
}
|
|
4193
4193
|
return 0;
|
|
4194
4194
|
}
|
|
4195
4195
|
//* Update search results text (for a11y).
|
|
4196
4196
|
updateSearchResultsA11yText() {
|
|
4197
|
-
const { i18n: t } = this.options,
|
|
4198
|
-
let
|
|
4199
|
-
|
|
4197
|
+
const { i18n: t } = this.options, n = this.countryList.childElementCount;
|
|
4198
|
+
let i;
|
|
4199
|
+
n === 0 ? i = t.zeroSearchResults : t.searchResultsText ? i = t.searchResultsText(n) : n === 1 ? i = t.oneSearchResult : i = t.multipleSearchResults.replace(
|
|
4200
4200
|
"${count}",
|
|
4201
|
-
|
|
4202
|
-
), this.searchResultsA11yText.textContent =
|
|
4201
|
+
n.toString()
|
|
4202
|
+
), this.searchResultsA11yText.textContent = i;
|
|
4203
4203
|
}
|
|
4204
4204
|
//* Check if an element is visible within it's container, else scroll until it is.
|
|
4205
4205
|
scrollTo(t) {
|
|
4206
|
-
const
|
|
4207
|
-
if (
|
|
4208
|
-
|
|
4209
|
-
else if (
|
|
4206
|
+
const n = this.countryList, i = document.documentElement.scrollTop, s = n.offsetHeight, r = n.getBoundingClientRect().top + i, o = r + s, l = t.offsetHeight, a = t.getBoundingClientRect().top + i, u = a + l, c = a - r + n.scrollTop;
|
|
4207
|
+
if (a < r)
|
|
4208
|
+
n.scrollTop = c;
|
|
4209
|
+
else if (u > o) {
|
|
4210
4210
|
const d = s - l;
|
|
4211
|
-
|
|
4211
|
+
n.scrollTop = c - d;
|
|
4212
4212
|
}
|
|
4213
4213
|
}
|
|
4214
4214
|
//* Remove highlighting from the previous list item and highlight the new one.
|
|
4215
|
-
highlightListItem(t,
|
|
4216
|
-
const
|
|
4217
|
-
if (
|
|
4215
|
+
highlightListItem(t, n) {
|
|
4216
|
+
const i = this.highlightedItem;
|
|
4217
|
+
if (i && i.classList.remove(E.HIGHLIGHT), this.highlightedItem = t, this.highlightedItem && (this.highlightedItem.classList.add(E.HIGHLIGHT), this.options.countrySearch)) {
|
|
4218
4218
|
const s = this.highlightedItem.getAttribute("id") || "";
|
|
4219
|
-
this.searchInput.setAttribute(
|
|
4219
|
+
this.searchInput.setAttribute(D.ACTIVE_DESCENDANT, s);
|
|
4220
4220
|
}
|
|
4221
|
-
|
|
4221
|
+
n && this.highlightedItem.focus();
|
|
4222
4222
|
}
|
|
4223
4223
|
updateSelectedItem(t) {
|
|
4224
|
-
if (this.selectedItem && this.selectedItem.dataset.countryCode !== t && (this.selectedItem.setAttribute(
|
|
4225
|
-
const
|
|
4224
|
+
if (this.selectedItem && this.selectedItem.dataset.countryCode !== t && (this.selectedItem.setAttribute(D.SELECTED, "false"), this.selectedItem = null), t && !this.selectedItem) {
|
|
4225
|
+
const n = this.countryList.querySelector(
|
|
4226
4226
|
`[data-country-code="${t}"]`
|
|
4227
4227
|
);
|
|
4228
|
-
|
|
4228
|
+
n && (n.setAttribute(D.SELECTED, "true"), this.selectedItem = n);
|
|
4229
4229
|
}
|
|
4230
4230
|
}
|
|
4231
4231
|
//* Country search: Filter the country list to the given array of countries.
|
|
4232
4232
|
filterCountries(t) {
|
|
4233
4233
|
this.countryList.innerHTML = "";
|
|
4234
|
-
let
|
|
4235
|
-
for (const
|
|
4236
|
-
const s =
|
|
4237
|
-
s && (this.countryList.appendChild(s),
|
|
4234
|
+
let n = !0;
|
|
4235
|
+
for (const i of t) {
|
|
4236
|
+
const s = i.nodeById[this.id];
|
|
4237
|
+
s && (this.countryList.appendChild(s), n && (this.highlightListItem(s, !1), n = !1));
|
|
4238
4238
|
}
|
|
4239
|
-
|
|
4239
|
+
n ? (this.highlightListItem(null, !1), this.searchNoResults && this.searchNoResults.classList.remove(E.HIDE)) : this.searchNoResults && this.searchNoResults.classList.add(E.HIDE), this.countryList.scrollTop = 0, this.updateSearchResultsA11yText();
|
|
4240
4240
|
}
|
|
4241
4241
|
destroy() {
|
|
4242
4242
|
this.telInput.iti = void 0, delete this.telInput.dataset.intlTelInputId, this.options.separateDialCode && (this.telInput.style.paddingLeft = this.originalPaddingLeft);
|
|
4243
4243
|
const t = this.telInput.parentNode;
|
|
4244
4244
|
t.before(this.telInput), t.remove(), this.telInput = null, this.countryContainer = null, this.selectedCountry = null, this.selectedCountryInner = null, this.selectedDialCode = null, this.dropdownArrow = null, this.dropdownContent = null, this.searchInput = null, this.searchIcon = null, this.searchClearButton = null, this.searchNoResults = null, this.searchResultsA11yText = null, this.countryList = null, this.dropdown = null, this.hiddenInput = null, this.hiddenInputCountry = null, this.highlightedItem = null, this.selectedItem = null;
|
|
4245
|
-
for (const
|
|
4246
|
-
delete
|
|
4245
|
+
for (const n of this.countries)
|
|
4246
|
+
delete n.nodeById[this.id];
|
|
4247
4247
|
this.countries = null;
|
|
4248
4248
|
}
|
|
4249
4249
|
}
|
|
4250
|
-
const
|
|
4251
|
-
const { onlyCountries: t, excludeCountries:
|
|
4250
|
+
const Ms = (e) => {
|
|
4251
|
+
const { onlyCountries: t, excludeCountries: n } = e;
|
|
4252
4252
|
if (t.length) {
|
|
4253
|
-
const
|
|
4253
|
+
const i = t.map(
|
|
4254
4254
|
(s) => s.toLowerCase()
|
|
4255
4255
|
);
|
|
4256
|
-
return
|
|
4257
|
-
(s) =>
|
|
4256
|
+
return _t.filter(
|
|
4257
|
+
(s) => i.includes(s.iso2)
|
|
4258
4258
|
);
|
|
4259
|
-
} else if (
|
|
4260
|
-
const
|
|
4259
|
+
} else if (n.length) {
|
|
4260
|
+
const i = n.map(
|
|
4261
4261
|
(s) => s.toLowerCase()
|
|
4262
4262
|
);
|
|
4263
|
-
return
|
|
4264
|
-
(s) => !
|
|
4263
|
+
return _t.filter(
|
|
4264
|
+
(s) => !i.includes(s.iso2)
|
|
4265
4265
|
);
|
|
4266
4266
|
}
|
|
4267
|
-
return
|
|
4268
|
-
},
|
|
4269
|
-
for (const
|
|
4270
|
-
const
|
|
4271
|
-
t.i18n[
|
|
4267
|
+
return _t;
|
|
4268
|
+
}, Us = (e, t) => {
|
|
4269
|
+
for (const n of e) {
|
|
4270
|
+
const i = n.iso2.toLowerCase();
|
|
4271
|
+
t.i18n[i] && (n.name = t.i18n[i]);
|
|
4272
4272
|
}
|
|
4273
|
-
},
|
|
4273
|
+
}, xs = (e) => {
|
|
4274
4274
|
const t = /* @__PURE__ */ new Set();
|
|
4275
|
-
let
|
|
4276
|
-
const
|
|
4275
|
+
let n = 0;
|
|
4276
|
+
const i = {}, s = (o, l) => {
|
|
4277
4277
|
if (!o || !l)
|
|
4278
4278
|
return;
|
|
4279
|
-
l.length >
|
|
4280
|
-
const
|
|
4281
|
-
|
|
4279
|
+
l.length > n && (n = l.length), i.hasOwnProperty(l) || (i[l] = []);
|
|
4280
|
+
const a = i[l];
|
|
4281
|
+
a.includes(o) || a.push(o);
|
|
4282
4282
|
}, r = [...e].sort((o, l) => o.priority - l.priority);
|
|
4283
4283
|
for (const o of r) {
|
|
4284
4284
|
t.has(o.dialCode) || t.add(o.dialCode);
|
|
4285
4285
|
for (let l = 1; l < o.dialCode.length; l++) {
|
|
4286
|
-
const
|
|
4287
|
-
s(o.iso2,
|
|
4286
|
+
const a = o.dialCode.substring(0, l);
|
|
4287
|
+
s(o.iso2, a);
|
|
4288
4288
|
}
|
|
4289
4289
|
if (s(o.iso2, o.dialCode), o.areaCodes) {
|
|
4290
|
-
const l =
|
|
4291
|
-
for (const
|
|
4292
|
-
for (let
|
|
4293
|
-
const c =
|
|
4290
|
+
const l = i[o.dialCode][0];
|
|
4291
|
+
for (const a of o.areaCodes) {
|
|
4292
|
+
for (let u = 1; u < a.length; u++) {
|
|
4293
|
+
const c = a.substring(0, u), d = o.dialCode + c;
|
|
4294
4294
|
s(l, d), s(o.iso2, d);
|
|
4295
4295
|
}
|
|
4296
|
-
s(o.iso2, o.dialCode +
|
|
4296
|
+
s(o.iso2, o.dialCode + a);
|
|
4297
4297
|
}
|
|
4298
4298
|
}
|
|
4299
4299
|
}
|
|
4300
|
-
return { dialCodes: t, dialCodeMaxLen:
|
|
4301
|
-
},
|
|
4300
|
+
return { dialCodes: t, dialCodeMaxLen: n, dialCodeToIso2Map: i };
|
|
4301
|
+
}, Bs = (e, t) => {
|
|
4302
4302
|
t.countryOrder && (t.countryOrder = t.countryOrder.map(
|
|
4303
|
-
(
|
|
4304
|
-
)), e.sort((
|
|
4303
|
+
(n) => n.toLowerCase()
|
|
4304
|
+
)), e.sort((n, i) => {
|
|
4305
4305
|
const { countryOrder: s } = t;
|
|
4306
4306
|
if (s) {
|
|
4307
|
-
const r = s.indexOf(
|
|
4308
|
-
if (l ||
|
|
4309
|
-
return l &&
|
|
4307
|
+
const r = s.indexOf(n.iso2), o = s.indexOf(i.iso2), l = r > -1, a = o > -1;
|
|
4308
|
+
if (l || a)
|
|
4309
|
+
return l && a ? r - o : l ? -1 : 1;
|
|
4310
4310
|
}
|
|
4311
|
-
return
|
|
4311
|
+
return n.name.localeCompare(i.name);
|
|
4312
4312
|
});
|
|
4313
|
-
},
|
|
4313
|
+
}, Fs = (e) => {
|
|
4314
4314
|
for (const t of e)
|
|
4315
|
-
t.normalisedName =
|
|
4316
|
-
},
|
|
4315
|
+
t.normalisedName = Un(t.name), t.initials = t.normalisedName.split(/[^a-z]/).map((n) => n[0]).join(""), t.dialCodePlus = `+${t.dialCode}`;
|
|
4316
|
+
}, Hs = (e, t, n, i) => {
|
|
4317
4317
|
let s = e;
|
|
4318
|
-
if (
|
|
4319
|
-
t = `+${
|
|
4318
|
+
if (n && t) {
|
|
4319
|
+
t = `+${i.dialCode}`;
|
|
4320
4320
|
const r = s[t.length] === " " || s[t.length] === "-" ? t.length + 1 : t.length;
|
|
4321
4321
|
s = s.substring(r);
|
|
4322
4322
|
}
|
|
4323
4323
|
return s;
|
|
4324
|
-
},
|
|
4325
|
-
const r =
|
|
4324
|
+
}, Vs = (e, t, n, i, s) => {
|
|
4325
|
+
const r = n ? n.formatNumberAsYouType(e, i.iso2) : e, { dialCode: o } = i;
|
|
4326
4326
|
return s && t.charAt(0) !== "+" && r.includes(`+${o}`) ? (r.split(`+${o}`)[1] || "").trim() : r;
|
|
4327
|
-
},
|
|
4328
|
-
if (
|
|
4327
|
+
}, Ws = (e, t, n, i) => {
|
|
4328
|
+
if (n === 0 && !i)
|
|
4329
4329
|
return 0;
|
|
4330
4330
|
let s = 0;
|
|
4331
4331
|
for (let r = 0; r < t.length; r++) {
|
|
4332
|
-
if (/[+0-9]/.test(t[r]) && s++, s === e && !
|
|
4332
|
+
if (/[+0-9]/.test(t[r]) && s++, s === e && !i)
|
|
4333
4333
|
return r + 1;
|
|
4334
|
-
if (
|
|
4334
|
+
if (i && s === e + 1)
|
|
4335
4335
|
return r;
|
|
4336
4336
|
}
|
|
4337
4337
|
return t.length;
|
|
4338
|
-
},
|
|
4338
|
+
}, js = [
|
|
4339
4339
|
"800",
|
|
4340
4340
|
"822",
|
|
4341
4341
|
"833",
|
|
@@ -4354,24 +4354,24 @@ const Rs = (e) => {
|
|
|
4354
4354
|
"888",
|
|
4355
4355
|
"889"
|
|
4356
4356
|
], Ye = (e) => {
|
|
4357
|
-
const t =
|
|
4358
|
-
if (t.startsWith(
|
|
4359
|
-
const
|
|
4360
|
-
return
|
|
4357
|
+
const t = jt(e);
|
|
4358
|
+
if (t.startsWith(kn.NANP) && t.length >= 4) {
|
|
4359
|
+
const n = t.substring(1, 4);
|
|
4360
|
+
return js.includes(n);
|
|
4361
4361
|
}
|
|
4362
4362
|
return !1;
|
|
4363
4363
|
};
|
|
4364
|
-
for (const e of
|
|
4365
|
-
e.name =
|
|
4366
|
-
let
|
|
4367
|
-
const
|
|
4364
|
+
for (const e of _t)
|
|
4365
|
+
e.name = Rn[e.iso2];
|
|
4366
|
+
let Gs = 0;
|
|
4367
|
+
const zs = new Set(_t.map((e) => e.iso2)), ue = (e) => zs.has(e);
|
|
4368
4368
|
class Se {
|
|
4369
|
-
constructor(t,
|
|
4370
|
-
this.id =
|
|
4371
|
-
const { dialCodes:
|
|
4369
|
+
constructor(t, n = {}) {
|
|
4370
|
+
this.id = Gs++, this.options = { ...Mn, ...n }, Ss(this.options, Rn), this.ui = new ks(t, this.options, this.id), this.isAndroid = Se._getIsAndroid(), this.promise = this._createInitPromises(), this.countries = Ms(this.options);
|
|
4371
|
+
const { dialCodes: i, dialCodeMaxLen: s, dialCodeToIso2Map: r } = xs(
|
|
4372
4372
|
this.countries
|
|
4373
4373
|
);
|
|
4374
|
-
this.dialCodes =
|
|
4374
|
+
this.dialCodes = i, this.dialCodeMaxLen = s, this.dialCodeToIso2Map = r, this.countryByIso2 = new Map(this.countries.map((o) => [o.iso2, o])), this._init();
|
|
4375
4375
|
}
|
|
4376
4376
|
static _getIsAndroid() {
|
|
4377
4377
|
return typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1;
|
|
@@ -4382,8 +4382,8 @@ class Se {
|
|
|
4382
4382
|
_mapAsciiToUserNumerals(t) {
|
|
4383
4383
|
if (this.userNumeralSet || this._updateNumeralSet(this.ui.telInput.value), this.userNumeralSet === "ascii")
|
|
4384
4384
|
return t;
|
|
4385
|
-
const
|
|
4386
|
-
return t.replace(/[0-9]/g, (
|
|
4385
|
+
const n = this.userNumeralSet === "arabic-indic" ? 1632 : 1776;
|
|
4386
|
+
return t.replace(/[0-9]/g, (i) => String.fromCharCode(n + Number(i)));
|
|
4387
4387
|
}
|
|
4388
4388
|
// Normalize Eastern Arabic (U+0660-0669) and Persian/Extended Arabic-Indic (U+06F0-06F9) numerals to ASCII 0-9
|
|
4389
4389
|
_normaliseNumerals(t) {
|
|
@@ -4391,8 +4391,8 @@ class Se {
|
|
|
4391
4391
|
return "";
|
|
4392
4392
|
if (this._updateNumeralSet(t), this.userNumeralSet === "ascii")
|
|
4393
4393
|
return t;
|
|
4394
|
-
const
|
|
4395
|
-
return t.replace(
|
|
4394
|
+
const n = this.userNumeralSet === "arabic-indic" ? 1632 : 1776, i = this.userNumeralSet === "arabic-indic" ? /[\u0660-\u0669]/g : /[\u06F0-\u06F9]/g;
|
|
4395
|
+
return t.replace(i, (s) => String.fromCharCode(48 + (s.charCodeAt(0) - n)));
|
|
4396
4396
|
}
|
|
4397
4397
|
_getTelInputValue() {
|
|
4398
4398
|
const t = this.ui.telInput.value.trim();
|
|
@@ -4402,12 +4402,12 @@ class Se {
|
|
|
4402
4402
|
this.ui.telInput.value = this._mapAsciiToUserNumerals(t);
|
|
4403
4403
|
}
|
|
4404
4404
|
_createInitPromises() {
|
|
4405
|
-
const t = new Promise((
|
|
4406
|
-
this.resolveAutoCountryPromise =
|
|
4407
|
-
}),
|
|
4408
|
-
this.resolveUtilsScriptPromise =
|
|
4405
|
+
const t = new Promise((i, s) => {
|
|
4406
|
+
this.resolveAutoCountryPromise = i, this.rejectAutoCountryPromise = s;
|
|
4407
|
+
}), n = new Promise((i, s) => {
|
|
4408
|
+
this.resolveUtilsScriptPromise = i, this.rejectUtilsScriptPromise = s;
|
|
4409
4409
|
});
|
|
4410
|
-
return Promise.all([t,
|
|
4410
|
+
return Promise.all([t, n]);
|
|
4411
4411
|
}
|
|
4412
4412
|
//* Can't be private as it's called from intlTelInput convenience wrapper.
|
|
4413
4413
|
_init() {
|
|
@@ -4418,18 +4418,18 @@ class Se {
|
|
|
4418
4418
|
//********************
|
|
4419
4419
|
//* Prepare all of the country data, including onlyCountries, excludeCountries, countryOrder options.
|
|
4420
4420
|
_processCountryData() {
|
|
4421
|
-
|
|
4421
|
+
Us(this.countries, this.options), Bs(this.countries, this.options), Fs(this.countries);
|
|
4422
4422
|
}
|
|
4423
4423
|
//* Set the initial state of the input value and the selected country by:
|
|
4424
4424
|
//* 1. Extracting a dial code from the given number
|
|
4425
4425
|
//* 2. Using explicit initialCountry
|
|
4426
4426
|
_setInitialState(t = !1) {
|
|
4427
|
-
const
|
|
4428
|
-
if (l && !
|
|
4427
|
+
const n = this.ui.telInput.getAttribute("value"), i = this._normaliseNumerals(n), s = this._getTelInputValue(), o = i && i.startsWith("+") && (!s || !s.startsWith("+")) ? i : s, l = this._getDialCode(o), a = Ye(o), { initialCountry: u, geoIpLookup: c } = this.options, d = u === oe.AUTO && c;
|
|
4428
|
+
if (l && !a)
|
|
4429
4429
|
this._updateCountryFromNumber(o);
|
|
4430
4430
|
else if (!d || t) {
|
|
4431
|
-
const f =
|
|
4432
|
-
|
|
4431
|
+
const f = u ? u.toLowerCase() : "";
|
|
4432
|
+
ue(f) ? this._setCountry(f) : l && a ? this._setCountry(As.ISO2) : this._setCountry("");
|
|
4433
4433
|
}
|
|
4434
4434
|
o && this._updateValFromNumber(o);
|
|
4435
4435
|
}
|
|
@@ -4439,20 +4439,20 @@ class Se {
|
|
|
4439
4439
|
}
|
|
4440
4440
|
//* Update hidden input on form submit.
|
|
4441
4441
|
_initHiddenInputListener() {
|
|
4442
|
-
var
|
|
4442
|
+
var n;
|
|
4443
4443
|
const t = () => {
|
|
4444
4444
|
this.ui.hiddenInput && (this.ui.hiddenInput.value = this.getNumber()), this.ui.hiddenInputCountry && (this.ui.hiddenInputCountry.value = this.selectedCountryData.iso2 || "");
|
|
4445
4445
|
};
|
|
4446
|
-
(
|
|
4446
|
+
(n = this.ui.telInput.form) == null || n.addEventListener("submit", t, {
|
|
4447
4447
|
signal: this.abortController.signal
|
|
4448
4448
|
});
|
|
4449
4449
|
}
|
|
4450
4450
|
//* initialise the dropdown listeners.
|
|
4451
4451
|
_initDropdownListeners() {
|
|
4452
|
-
const t = this.abortController.signal,
|
|
4452
|
+
const t = this.abortController.signal, n = (o) => {
|
|
4453
4453
|
this.ui.dropdownContent.classList.contains(E.HIDE) ? this.ui.telInput.focus() : o.preventDefault();
|
|
4454
|
-
},
|
|
4455
|
-
|
|
4454
|
+
}, i = this.ui.telInput.closest("label");
|
|
4455
|
+
i && i.addEventListener("click", n, { signal: t });
|
|
4456
4456
|
const s = () => {
|
|
4457
4457
|
this.ui.dropdownContent.classList.contains(
|
|
4458
4458
|
E.HIDE
|
|
@@ -4468,7 +4468,7 @@ class Se {
|
|
|
4468
4468
|
const r = (o) => {
|
|
4469
4469
|
this.ui.dropdownContent.classList.contains(
|
|
4470
4470
|
E.HIDE
|
|
4471
|
-
) && [
|
|
4471
|
+
) && [M.ARROW_UP, M.ARROW_DOWN, M.SPACE, M.ENTER].includes(o.key) && (o.preventDefault(), o.stopPropagation(), this._openDropdown()), o.key === M.TAB && this._closeDropdown();
|
|
4472
4472
|
};
|
|
4473
4473
|
this.ui.countryContainer.addEventListener(
|
|
4474
4474
|
"keydown",
|
|
@@ -4478,7 +4478,7 @@ class Se {
|
|
|
4478
4478
|
}
|
|
4479
4479
|
//* Init many requests: utils script / geo ip lookup.
|
|
4480
4480
|
_initRequests() {
|
|
4481
|
-
const { loadUtils: t, initialCountry:
|
|
4481
|
+
const { loadUtils: t, initialCountry: n, geoIpLookup: i } = this.options;
|
|
4482
4482
|
if (t && !_.utils) {
|
|
4483
4483
|
const r = () => {
|
|
4484
4484
|
var o;
|
|
@@ -4497,14 +4497,14 @@ class Se {
|
|
|
4497
4497
|
}
|
|
4498
4498
|
} else
|
|
4499
4499
|
this.resolveUtilsScriptPromise();
|
|
4500
|
-
|
|
4500
|
+
n === oe.AUTO && i && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
|
|
4501
4501
|
}
|
|
4502
4502
|
//* Perform the geo ip lookup.
|
|
4503
4503
|
_loadAutoCountry() {
|
|
4504
4504
|
_.autoCountry ? this.handleAutoCountry() : _.startedLoadingAutoCountry || (_.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
|
|
4505
4505
|
(t = "") => {
|
|
4506
|
-
const
|
|
4507
|
-
|
|
4506
|
+
const n = t.toLowerCase();
|
|
4507
|
+
ue(n) ? (_.autoCountry = n, setTimeout(() => kt("handleAutoCountry"))) : (this._setInitialState(!0), kt("rejectAutoCountryPromise"));
|
|
4508
4508
|
},
|
|
4509
4509
|
() => {
|
|
4510
4510
|
this._setInitialState(!0), kt("rejectAutoCountryPromise");
|
|
@@ -4521,44 +4521,44 @@ class Se {
|
|
|
4521
4521
|
_bindInputListener() {
|
|
4522
4522
|
const {
|
|
4523
4523
|
strictMode: t,
|
|
4524
|
-
formatAsYouType:
|
|
4525
|
-
separateDialCode:
|
|
4524
|
+
formatAsYouType: n,
|
|
4525
|
+
separateDialCode: i,
|
|
4526
4526
|
allowDropdown: s,
|
|
4527
4527
|
countrySearch: r
|
|
4528
4528
|
} = this.options;
|
|
4529
4529
|
let o = !1;
|
|
4530
|
-
|
|
4531
|
-
const l = (
|
|
4532
|
-
const
|
|
4533
|
-
if (this.isAndroid && (
|
|
4534
|
-
const C = this.ui.telInput.selectionStart || 0,
|
|
4535
|
-
this._setTelInputValue(
|
|
4530
|
+
at.ALPHA_UNICODE.test(this._getTelInputValue()) && (o = !0);
|
|
4531
|
+
const l = (a) => {
|
|
4532
|
+
const u = this._getTelInputValue();
|
|
4533
|
+
if (this.isAndroid && (a == null ? void 0 : a.data) === "+" && i && s && r) {
|
|
4534
|
+
const C = this.ui.telInput.selectionStart || 0, y = u.substring(0, C - 1), b = u.substring(C);
|
|
4535
|
+
this._setTelInputValue(y + b), this._openDropdownWithPlus();
|
|
4536
4536
|
return;
|
|
4537
4537
|
}
|
|
4538
|
-
this._updateCountryFromNumber(
|
|
4539
|
-
const c = (
|
|
4540
|
-
c || d && !t ? o = !0 :
|
|
4541
|
-
const f = (
|
|
4542
|
-
if (
|
|
4543
|
-
const C = this.ui.telInput.selectionStart || 0,
|
|
4538
|
+
this._updateCountryFromNumber(u) && this._triggerCountryChange();
|
|
4539
|
+
const c = (a == null ? void 0 : a.data) && at.NON_PLUS_NUMERIC.test(a.data), d = (a == null ? void 0 : a.inputType) === Ge.PASTE && u;
|
|
4540
|
+
c || d && !t ? o = !0 : at.NON_PLUS_NUMERIC.test(u) || (o = !1);
|
|
4541
|
+
const f = (a == null ? void 0 : a.detail) && a.detail.isSetNumber, p = this.userNumeralSet === "ascii";
|
|
4542
|
+
if (n && !o && !f && p) {
|
|
4543
|
+
const C = this.ui.telInput.selectionStart || 0, b = u.substring(
|
|
4544
4544
|
0,
|
|
4545
4545
|
C
|
|
4546
4546
|
).replace(
|
|
4547
|
-
|
|
4547
|
+
at.NON_PLUS_NUMERIC_GLOBAL,
|
|
4548
4548
|
""
|
|
4549
|
-
).length, g = (
|
|
4549
|
+
).length, g = (a == null ? void 0 : a.inputType) === Ge.DELETE_FWD, m = this._getFullNumber(), h = Vs(
|
|
4550
4550
|
m,
|
|
4551
|
-
|
|
4551
|
+
u,
|
|
4552
4552
|
_.utils,
|
|
4553
4553
|
this.selectedCountryData,
|
|
4554
4554
|
this.options.separateDialCode
|
|
4555
|
-
),
|
|
4556
|
-
|
|
4557
|
-
|
|
4555
|
+
), v = Ws(
|
|
4556
|
+
b,
|
|
4557
|
+
h,
|
|
4558
4558
|
C,
|
|
4559
4559
|
g
|
|
4560
4560
|
);
|
|
4561
|
-
this._setTelInputValue(
|
|
4561
|
+
this._setTelInputValue(h), this.ui.telInput.setSelectionRange(v, v);
|
|
4562
4562
|
}
|
|
4563
4563
|
};
|
|
4564
4564
|
this.ui.telInput.addEventListener(
|
|
@@ -4570,20 +4570,20 @@ class Se {
|
|
|
4570
4570
|
);
|
|
4571
4571
|
}
|
|
4572
4572
|
_maybeBindKeydownListener() {
|
|
4573
|
-
const { strictMode: t, separateDialCode:
|
|
4574
|
-
if (t ||
|
|
4573
|
+
const { strictMode: t, separateDialCode: n, allowDropdown: i, countrySearch: s } = this.options;
|
|
4574
|
+
if (t || n) {
|
|
4575
4575
|
const r = (o) => {
|
|
4576
4576
|
if (o.key && o.key.length === 1 && !o.altKey && !o.ctrlKey && !o.metaKey) {
|
|
4577
|
-
if (
|
|
4577
|
+
if (n && i && s && o.key === "+") {
|
|
4578
4578
|
o.preventDefault(), this._openDropdownWithPlus();
|
|
4579
4579
|
return;
|
|
4580
4580
|
}
|
|
4581
4581
|
if (t) {
|
|
4582
|
-
const l = this._getTelInputValue(),
|
|
4583
|
-
|
|
4582
|
+
const l = this._getTelInputValue(), u = !l.startsWith("+") && this.ui.telInput.selectionStart === 0 && o.key === "+", c = this._normaliseNumerals(o.key), d = /^[0-9]$/.test(c), f = n ? d : u || d, p = this.ui.telInput, C = p.selectionStart, y = p.selectionEnd, b = l.slice(0, C), g = l.slice(y), m = b + o.key + g, h = this._getFullNumber(m), v = _.utils.getCoreNumber(
|
|
4583
|
+
h,
|
|
4584
4584
|
this.selectedCountryData.iso2
|
|
4585
|
-
), T = this.maxCoreNumberLength &&
|
|
4586
|
-
(!f || T && !O && !
|
|
4585
|
+
), T = this.maxCoreNumberLength && v.length > this.maxCoreNumberLength, O = this._getNewCountryFromNumber(h) !== null;
|
|
4586
|
+
(!f || T && !O && !u) && o.preventDefault();
|
|
4587
4587
|
}
|
|
4588
4588
|
}
|
|
4589
4589
|
};
|
|
@@ -4594,26 +4594,26 @@ class Se {
|
|
|
4594
4594
|
}
|
|
4595
4595
|
_maybeBindPasteListener() {
|
|
4596
4596
|
if (this.options.strictMode) {
|
|
4597
|
-
const t = (
|
|
4598
|
-
|
|
4599
|
-
const
|
|
4600
|
-
let m = l + g +
|
|
4597
|
+
const t = (n) => {
|
|
4598
|
+
n.preventDefault();
|
|
4599
|
+
const i = this.ui.telInput, s = i.selectionStart, r = i.selectionEnd, o = this._getTelInputValue(), l = o.slice(0, s), a = o.slice(r), u = this.selectedCountryData.iso2, c = n.clipboardData.getData("text"), d = this._normaliseNumerals(c), f = s === 0 && r > 0, p = !o.startsWith("+") || f, C = d.replace(at.NON_PLUS_NUMERIC_GLOBAL, ""), y = C.startsWith("+"), b = C.replace(/\+/g, ""), g = y && p ? `+${b}` : b;
|
|
4600
|
+
let m = l + g + a;
|
|
4601
4601
|
if (m.length > 5) {
|
|
4602
|
-
let
|
|
4603
|
-
for (;
|
|
4604
|
-
m = m.slice(0, -1),
|
|
4605
|
-
if (!
|
|
4602
|
+
let v = _.utils.getCoreNumber(m, u);
|
|
4603
|
+
for (; v.length === 0 && m.length > 0; )
|
|
4604
|
+
m = m.slice(0, -1), v = _.utils.getCoreNumber(m, u);
|
|
4605
|
+
if (!v)
|
|
4606
4606
|
return;
|
|
4607
|
-
if (this.maxCoreNumberLength &&
|
|
4608
|
-
if (
|
|
4609
|
-
const T =
|
|
4607
|
+
if (this.maxCoreNumberLength && v.length > this.maxCoreNumberLength)
|
|
4608
|
+
if (i.selectionEnd === o.length) {
|
|
4609
|
+
const T = v.length - this.maxCoreNumberLength;
|
|
4610
4610
|
m = m.slice(0, m.length - T);
|
|
4611
4611
|
} else
|
|
4612
4612
|
return;
|
|
4613
4613
|
}
|
|
4614
4614
|
this._setTelInputValue(m);
|
|
4615
|
-
const
|
|
4616
|
-
|
|
4615
|
+
const h = s + g.length;
|
|
4616
|
+
i.setSelectionRange(h, h), i.dispatchEvent(new InputEvent("input", { bubbles: !0 }));
|
|
4617
4617
|
};
|
|
4618
4618
|
this.ui.telInput.addEventListener("paste", t, {
|
|
4619
4619
|
signal: this.abortController.signal
|
|
@@ -4622,35 +4622,35 @@ class Se {
|
|
|
4622
4622
|
}
|
|
4623
4623
|
//* Adhere to the input's maxlength attr.
|
|
4624
4624
|
_cap(t) {
|
|
4625
|
-
const
|
|
4626
|
-
return
|
|
4625
|
+
const n = Number(this.ui.telInput.getAttribute("maxlength"));
|
|
4626
|
+
return n && t.length > n ? t.substring(0, n) : t;
|
|
4627
4627
|
}
|
|
4628
4628
|
//* Trigger a custom event on the input (typed via ItiEventMap).
|
|
4629
|
-
_trigger(t,
|
|
4630
|
-
const
|
|
4629
|
+
_trigger(t, n = {}) {
|
|
4630
|
+
const i = new CustomEvent(t, {
|
|
4631
4631
|
bubbles: !0,
|
|
4632
4632
|
cancelable: !0,
|
|
4633
|
-
detail:
|
|
4633
|
+
detail: n
|
|
4634
4634
|
});
|
|
4635
|
-
this.ui.telInput.dispatchEvent(
|
|
4635
|
+
this.ui.telInput.dispatchEvent(i);
|
|
4636
4636
|
}
|
|
4637
4637
|
//* Open the dropdown.
|
|
4638
4638
|
_openDropdown() {
|
|
4639
|
-
const { fixDropdownWidth: t, countrySearch:
|
|
4640
|
-
if (this.dropdownAbortController = new AbortController(), t && (this.ui.dropdownContent.style.width = `${this.ui.telInput.offsetWidth}px`), this.ui.dropdownContent.classList.remove(E.HIDE), this.ui.selectedCountry.setAttribute(
|
|
4641
|
-
const
|
|
4642
|
-
|
|
4639
|
+
const { fixDropdownWidth: t, countrySearch: n } = this.options;
|
|
4640
|
+
if (this.dropdownAbortController = new AbortController(), t && (this.ui.dropdownContent.style.width = `${this.ui.telInput.offsetWidth}px`), this.ui.dropdownContent.classList.remove(E.HIDE), this.ui.selectedCountry.setAttribute(D.EXPANDED, "true"), this._setDropdownPosition(), n) {
|
|
4641
|
+
const i = this.ui.countryList.firstElementChild;
|
|
4642
|
+
i && (this.ui.highlightListItem(i, !1), this.ui.countryList.scrollTop = 0), this.ui.searchInput.focus();
|
|
4643
4643
|
}
|
|
4644
|
-
this._bindDropdownListeners(), this.ui.dropdownArrow.classList.add(E.ARROW_UP), this._trigger(
|
|
4644
|
+
this._bindDropdownListeners(), this.ui.dropdownArrow.classList.add(E.ARROW_UP), this._trigger(Vt.OPEN_COUNTRY_DROPDOWN);
|
|
4645
4645
|
}
|
|
4646
4646
|
//* Set the dropdown position
|
|
4647
4647
|
_setDropdownPosition() {
|
|
4648
4648
|
if (this.options.dropdownContainer && this.options.dropdownContainer.appendChild(this.ui.dropdown), !this.options.useFullscreenPopup) {
|
|
4649
|
-
const t = this.ui.telInput.getBoundingClientRect(),
|
|
4649
|
+
const t = this.ui.telInput.getBoundingClientRect(), n = this.ui.telInput.offsetHeight;
|
|
4650
4650
|
if (this.options.dropdownContainer) {
|
|
4651
|
-
this.ui.dropdown.style.top = `${t.top +
|
|
4652
|
-
const
|
|
4653
|
-
window.addEventListener("scroll",
|
|
4651
|
+
this.ui.dropdown.style.top = `${t.top + n}px`, this.ui.dropdown.style.left = `${t.left}px`;
|
|
4652
|
+
const i = () => this._closeDropdown();
|
|
4653
|
+
window.addEventListener("scroll", i, {
|
|
4654
4654
|
signal: this.dropdownAbortController.signal
|
|
4655
4655
|
});
|
|
4656
4656
|
}
|
|
@@ -4664,16 +4664,16 @@ class Se {
|
|
|
4664
4664
|
//* When mouse over a list item, just highlight that one
|
|
4665
4665
|
//* we add the class "highlight", so if they hit "enter" we know which one to select.
|
|
4666
4666
|
_bindDropdownMouseoverListener(t) {
|
|
4667
|
-
const
|
|
4667
|
+
const n = (i) => {
|
|
4668
4668
|
var r;
|
|
4669
|
-
const s = (r =
|
|
4669
|
+
const s = (r = i.target) == null ? void 0 : r.closest(
|
|
4670
4670
|
`.${E.COUNTRY_ITEM}`
|
|
4671
4671
|
);
|
|
4672
4672
|
s && this.ui.highlightListItem(s, !1);
|
|
4673
4673
|
};
|
|
4674
4674
|
this.ui.countryList.addEventListener(
|
|
4675
4675
|
"mouseover",
|
|
4676
|
-
|
|
4676
|
+
n,
|
|
4677
4677
|
{
|
|
4678
4678
|
signal: t
|
|
4679
4679
|
}
|
|
@@ -4681,29 +4681,29 @@ class Se {
|
|
|
4681
4681
|
}
|
|
4682
4682
|
//* Listen for country selection.
|
|
4683
4683
|
_bindDropdownCountryClickListener(t) {
|
|
4684
|
-
const
|
|
4684
|
+
const n = (i) => {
|
|
4685
4685
|
var r;
|
|
4686
|
-
const s = (r =
|
|
4686
|
+
const s = (r = i.target) == null ? void 0 : r.closest(
|
|
4687
4687
|
`.${E.COUNTRY_ITEM}`
|
|
4688
4688
|
);
|
|
4689
4689
|
s && this._selectListItem(s);
|
|
4690
4690
|
};
|
|
4691
|
-
this.ui.countryList.addEventListener("click",
|
|
4691
|
+
this.ui.countryList.addEventListener("click", n, {
|
|
4692
4692
|
signal: t
|
|
4693
4693
|
});
|
|
4694
4694
|
}
|
|
4695
4695
|
//* Click off to close (except when this initial opening click is bubbling up).
|
|
4696
4696
|
//* We cannot just stopPropagation as it may be needed to close another instance.
|
|
4697
4697
|
_bindDropdownClickOffListener(t) {
|
|
4698
|
-
const
|
|
4699
|
-
!!
|
|
4698
|
+
const n = (i) => {
|
|
4699
|
+
!!i.target.closest(
|
|
4700
4700
|
`#iti-${this.id}__dropdown-content`
|
|
4701
4701
|
) || this._closeDropdown();
|
|
4702
4702
|
};
|
|
4703
4703
|
setTimeout(() => {
|
|
4704
4704
|
document.documentElement.addEventListener(
|
|
4705
4705
|
"click",
|
|
4706
|
-
|
|
4706
|
+
n,
|
|
4707
4707
|
{ signal: t }
|
|
4708
4708
|
);
|
|
4709
4709
|
}, 0);
|
|
@@ -4713,36 +4713,36 @@ class Se {
|
|
|
4713
4713
|
//* just hit down and hold it to scroll down (no keyup event).
|
|
4714
4714
|
//* Listen on the document because that's where key events are triggered if no input has focus.
|
|
4715
4715
|
_bindDropdownKeydownListener(t) {
|
|
4716
|
-
let
|
|
4716
|
+
let n = "", i = null;
|
|
4717
4717
|
const s = (r) => {
|
|
4718
4718
|
[
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
].includes(r.key) && (r.preventDefault(), r.stopPropagation(), r.key ===
|
|
4724
|
-
|
|
4725
|
-
},
|
|
4719
|
+
M.ARROW_UP,
|
|
4720
|
+
M.ARROW_DOWN,
|
|
4721
|
+
M.ENTER,
|
|
4722
|
+
M.ESC
|
|
4723
|
+
].includes(r.key) && (r.preventDefault(), r.stopPropagation(), r.key === M.ARROW_UP || r.key === M.ARROW_DOWN ? this._handleUpDownKey(r.key) : r.key === M.ENTER ? this._handleEnterKey() : r.key === M.ESC && (this._closeDropdown(), this.ui.selectedCountry.focus())), !this.options.countrySearch && at.HIDDEN_SEARCH_CHAR.test(r.key) && (r.stopPropagation(), i && clearTimeout(i), n += r.key.toLowerCase(), this._searchForCountry(n), i = setTimeout(() => {
|
|
4724
|
+
n = "";
|
|
4725
|
+
}, Ds.HIDDEN_SEARCH_RESET_MS));
|
|
4726
4726
|
};
|
|
4727
4727
|
document.addEventListener("keydown", s, { signal: t });
|
|
4728
4728
|
}
|
|
4729
4729
|
//* Search input listeners when countrySearch enabled.
|
|
4730
4730
|
_bindDropdownSearchListeners(t) {
|
|
4731
|
-
const
|
|
4731
|
+
const n = () => {
|
|
4732
4732
|
const o = this.ui.searchInput.value.trim();
|
|
4733
4733
|
this._filterCountriesByQuery(o), this.ui.searchInput.value ? this.ui.searchClearButton.classList.remove(E.HIDE) : this.ui.searchClearButton.classList.add(E.HIDE);
|
|
4734
4734
|
};
|
|
4735
|
-
let
|
|
4735
|
+
let i = null;
|
|
4736
4736
|
const s = () => {
|
|
4737
|
-
|
|
4738
|
-
|
|
4737
|
+
i && clearTimeout(i), i = setTimeout(() => {
|
|
4738
|
+
n(), i = null;
|
|
4739
4739
|
}, 100);
|
|
4740
4740
|
};
|
|
4741
4741
|
this.ui.searchInput.addEventListener("input", s, {
|
|
4742
4742
|
signal: t
|
|
4743
4743
|
});
|
|
4744
4744
|
const r = () => {
|
|
4745
|
-
this.ui.searchInput.value = "", this.ui.searchInput.focus(),
|
|
4745
|
+
this.ui.searchInput.value = "", this.ui.searchInput.focus(), n();
|
|
4746
4746
|
};
|
|
4747
4747
|
this.ui.searchClearButton.addEventListener("click", r, {
|
|
4748
4748
|
signal: t
|
|
@@ -4750,22 +4750,22 @@ class Se {
|
|
|
4750
4750
|
}
|
|
4751
4751
|
//* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
|
|
4752
4752
|
_searchForCountry(t) {
|
|
4753
|
-
const
|
|
4754
|
-
if (
|
|
4755
|
-
const
|
|
4756
|
-
this.ui.highlightListItem(
|
|
4753
|
+
const n = Ps(this.countries, t);
|
|
4754
|
+
if (n) {
|
|
4755
|
+
const i = n.nodeById[this.id];
|
|
4756
|
+
this.ui.highlightListItem(i, !1), this.ui.scrollTo(i);
|
|
4757
4757
|
}
|
|
4758
4758
|
}
|
|
4759
4759
|
//* Country search: Filter the countries according to the search query.
|
|
4760
4760
|
_filterCountriesByQuery(t) {
|
|
4761
|
-
let
|
|
4762
|
-
t === "" ?
|
|
4761
|
+
let n;
|
|
4762
|
+
t === "" ? n = this.countries : n = Ts(this.countries, t), this.ui.filterCountries(n);
|
|
4763
4763
|
}
|
|
4764
4764
|
//* Highlight the next/prev item in the list (and ensure it is visible).
|
|
4765
4765
|
_handleUpDownKey(t) {
|
|
4766
|
-
var
|
|
4767
|
-
let
|
|
4768
|
-
!
|
|
4766
|
+
var i, s;
|
|
4767
|
+
let n = t === M.ARROW_UP ? (i = this.ui.highlightedItem) == null ? void 0 : i.previousElementSibling : (s = this.ui.highlightedItem) == null ? void 0 : s.nextElementSibling;
|
|
4768
|
+
!n && this.ui.countryList.childElementCount > 1 && (n = t === M.ARROW_UP ? this.ui.countryList.lastElementChild : this.ui.countryList.firstElementChild), n && (this.ui.scrollTo(n), this.ui.highlightListItem(n, !1));
|
|
4769
4769
|
}
|
|
4770
4770
|
//* Select the currently highlighted item.
|
|
4771
4771
|
_handleEnterKey() {
|
|
@@ -4774,47 +4774,47 @@ class Se {
|
|
|
4774
4774
|
//* Update the input's value to the given val (format first if possible)
|
|
4775
4775
|
//* NOTE: this is called from _setInitialState, handleUtils and setNumber.
|
|
4776
4776
|
_updateValFromNumber(t) {
|
|
4777
|
-
let
|
|
4777
|
+
let n = t;
|
|
4778
4778
|
if (this.options.formatOnDisplay && _.utils && this.selectedCountryData) {
|
|
4779
|
-
const
|
|
4780
|
-
|
|
4781
|
-
|
|
4779
|
+
const i = this.options.nationalMode || !n.startsWith("+") && !this.options.separateDialCode, { NATIONAL: s, INTERNATIONAL: r } = _.utils.numberFormat, o = i ? s : r;
|
|
4780
|
+
n = _.utils.formatNumber(
|
|
4781
|
+
n,
|
|
4782
4782
|
this.selectedCountryData.iso2,
|
|
4783
4783
|
o
|
|
4784
4784
|
);
|
|
4785
4785
|
}
|
|
4786
|
-
|
|
4786
|
+
n = this._beforeSetNumber(n), this._setTelInputValue(n);
|
|
4787
4787
|
}
|
|
4788
4788
|
//* Check if need to select a new country based on the given number
|
|
4789
4789
|
//* Note: called from _setInitialState, keyup handler, setNumber.
|
|
4790
4790
|
_updateCountryFromNumber(t) {
|
|
4791
|
-
const
|
|
4792
|
-
return
|
|
4791
|
+
const n = this._getNewCountryFromNumber(t);
|
|
4792
|
+
return n !== null ? this._setCountry(n) : !1;
|
|
4793
4793
|
}
|
|
4794
4794
|
// if there is a selected country, and the number doesn't start with a dial code, then add it
|
|
4795
4795
|
_ensureHasDialCode(t) {
|
|
4796
|
-
const { dialCode:
|
|
4797
|
-
if (t.startsWith("+") || !
|
|
4796
|
+
const { dialCode: n, nationalPrefix: i } = this.selectedCountryData;
|
|
4797
|
+
if (t.startsWith("+") || !n)
|
|
4798
4798
|
return t;
|
|
4799
|
-
const o =
|
|
4800
|
-
return `+${
|
|
4799
|
+
const o = i && t.startsWith(i) && !this.options.separateDialCode ? t.substring(1) : t;
|
|
4800
|
+
return `+${n}${o}`;
|
|
4801
4801
|
}
|
|
4802
4802
|
// Get the country ISO2 code from the given number
|
|
4803
4803
|
// BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
|
|
4804
4804
|
// NOTE: consider refactoring this to be more clear
|
|
4805
4805
|
_getNewCountryFromNumber(t) {
|
|
4806
|
-
const
|
|
4807
|
-
let
|
|
4806
|
+
const n = t.indexOf("+");
|
|
4807
|
+
let i = n ? t.substring(n) : t;
|
|
4808
4808
|
const s = this.selectedCountryData.iso2, r = this.selectedCountryData.dialCode;
|
|
4809
|
-
|
|
4810
|
-
const o = this._getDialCode(
|
|
4809
|
+
i = this._ensureHasDialCode(i);
|
|
4810
|
+
const o = this._getDialCode(i, !0), l = jt(i);
|
|
4811
4811
|
if (o) {
|
|
4812
|
-
const
|
|
4813
|
-
if (
|
|
4814
|
-
return
|
|
4815
|
-
if (!s && this.defaultCountry &&
|
|
4812
|
+
const a = jt(o), u = this.dialCodeToIso2Map[a];
|
|
4813
|
+
if (u.length === 1)
|
|
4814
|
+
return u[0] === s ? null : u[0];
|
|
4815
|
+
if (!s && this.defaultCountry && u.includes(this.defaultCountry))
|
|
4816
4816
|
return this.defaultCountry;
|
|
4817
|
-
if (r ===
|
|
4817
|
+
if (r === kn.NANP && Ye(l))
|
|
4818
4818
|
return null;
|
|
4819
4819
|
const { areaCodes: d, priority: f } = this.selectedCountryData;
|
|
4820
4820
|
if (d) {
|
|
@@ -4825,31 +4825,31 @@ class Se {
|
|
|
4825
4825
|
if (l.startsWith(m))
|
|
4826
4826
|
return null;
|
|
4827
4827
|
}
|
|
4828
|
-
const C = d && !(f === 0) && l.length >
|
|
4829
|
-
if (!
|
|
4830
|
-
return
|
|
4831
|
-
} else if (
|
|
4832
|
-
const
|
|
4833
|
-
return
|
|
4834
|
-
} else if ((!
|
|
4828
|
+
const C = d && !(f === 0) && l.length > a.length, y = s && u.includes(s) && !C, b = s === u[0];
|
|
4829
|
+
if (!y && !b)
|
|
4830
|
+
return u[0];
|
|
4831
|
+
} else if (i.startsWith("+") && l.length) {
|
|
4832
|
+
const a = this.selectedCountryData.dialCode || "";
|
|
4833
|
+
return a && a.startsWith(l) ? null : "";
|
|
4834
|
+
} else if ((!i || i === "+") && !s)
|
|
4835
4835
|
return this.defaultCountry;
|
|
4836
4836
|
return null;
|
|
4837
4837
|
}
|
|
4838
4838
|
//* Update the selected country, dial code (if separateDialCode), placeholder, title, and selected list item.
|
|
4839
4839
|
//* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
|
|
4840
4840
|
_setCountry(t) {
|
|
4841
|
-
const { separateDialCode:
|
|
4841
|
+
const { separateDialCode: n, showFlags: i, i18n: s, allowDropdown: r } = this.options, o = this.selectedCountryData.iso2 || "";
|
|
4842
4842
|
if (r && this.ui.updateSelectedItem(t), this.selectedCountryData = t ? this.countryByIso2.get(t) : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.ui.selectedCountry) {
|
|
4843
|
-
const l = t &&
|
|
4844
|
-
let
|
|
4843
|
+
const l = t && i ? `${E.FLAG} iti__${t}` : `${E.FLAG} ${E.GLOBE}`;
|
|
4844
|
+
let a, u;
|
|
4845
4845
|
if (t) {
|
|
4846
4846
|
const { name: c, dialCode: d } = this.selectedCountryData;
|
|
4847
|
-
|
|
4847
|
+
u = c, a = s.selectedCountryAriaLabel.replace("${countryName}", c).replace("${dialCode}", `+${d}`);
|
|
4848
4848
|
} else
|
|
4849
|
-
|
|
4850
|
-
this.ui.selectedCountryInner.className = l, this.ui.selectedCountry.setAttribute("title",
|
|
4849
|
+
u = s.noCountrySelected, a = s.noCountrySelected;
|
|
4850
|
+
this.ui.selectedCountryInner.className = l, this.ui.selectedCountry.setAttribute("title", u), this.ui.selectedCountry.setAttribute(D.LABEL, a);
|
|
4851
4851
|
}
|
|
4852
|
-
if (
|
|
4852
|
+
if (n) {
|
|
4853
4853
|
const l = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
4854
4854
|
this.ui.selectedDialCode.textContent = l, this.ui.updateInputPadding();
|
|
4855
4855
|
}
|
|
@@ -4857,10 +4857,10 @@ class Se {
|
|
|
4857
4857
|
}
|
|
4858
4858
|
//* Update the maximum valid number length for the currently selected country.
|
|
4859
4859
|
_updateMaxLength() {
|
|
4860
|
-
const { strictMode: t, placeholderNumberType:
|
|
4860
|
+
const { strictMode: t, placeholderNumberType: n, validationNumberTypes: i } = this.options, { iso2: s } = this.selectedCountryData;
|
|
4861
4861
|
if (t && _.utils)
|
|
4862
4862
|
if (s) {
|
|
4863
|
-
const r = _.utils.numberType[
|
|
4863
|
+
const r = _.utils.numberType[n];
|
|
4864
4864
|
let o = _.utils.getExampleNumber(
|
|
4865
4865
|
s,
|
|
4866
4866
|
!1,
|
|
@@ -4870,11 +4870,11 @@ class Se {
|
|
|
4870
4870
|
for (; _.utils.isPossibleNumber(
|
|
4871
4871
|
o,
|
|
4872
4872
|
s,
|
|
4873
|
-
|
|
4873
|
+
i
|
|
4874
4874
|
); )
|
|
4875
4875
|
l = o, o += "0";
|
|
4876
|
-
const
|
|
4877
|
-
this.maxCoreNumberLength =
|
|
4876
|
+
const a = _.utils.getCoreNumber(l, s);
|
|
4877
|
+
this.maxCoreNumberLength = a.length, s === "by" && (this.maxCoreNumberLength = a.length + 1);
|
|
4878
4878
|
} else
|
|
4879
4879
|
this.maxCoreNumberLength = null;
|
|
4880
4880
|
}
|
|
@@ -4882,15 +4882,15 @@ class Se {
|
|
|
4882
4882
|
_updatePlaceholder() {
|
|
4883
4883
|
const {
|
|
4884
4884
|
autoPlaceholder: t,
|
|
4885
|
-
placeholderNumberType:
|
|
4886
|
-
nationalMode:
|
|
4885
|
+
placeholderNumberType: n,
|
|
4886
|
+
nationalMode: i,
|
|
4887
4887
|
customPlaceholder: s
|
|
4888
|
-
} = this.options, r = t ===
|
|
4888
|
+
} = this.options, r = t === me.AGGRESSIVE || !this.ui.hadInitialPlaceholder && t === me.POLITE;
|
|
4889
4889
|
if (_.utils && r) {
|
|
4890
|
-
const o = _.utils.numberType[
|
|
4890
|
+
const o = _.utils.numberType[n];
|
|
4891
4891
|
let l = this.selectedCountryData.iso2 ? _.utils.getExampleNumber(
|
|
4892
4892
|
this.selectedCountryData.iso2,
|
|
4893
|
-
|
|
4893
|
+
i,
|
|
4894
4894
|
o
|
|
4895
4895
|
) : "";
|
|
4896
4896
|
l = this._beforeSetNumber(l), typeof s == "function" && (l = s(l, this.selectedCountryData)), this.ui.telInput.setAttribute("placeholder", l);
|
|
@@ -4898,33 +4898,33 @@ class Se {
|
|
|
4898
4898
|
}
|
|
4899
4899
|
//* Called when the user selects a list item from the dropdown.
|
|
4900
4900
|
_selectListItem(t) {
|
|
4901
|
-
const
|
|
4901
|
+
const n = t.dataset[Ke.COUNTRY_CODE], i = this._setCountry(n);
|
|
4902
4902
|
this._closeDropdown();
|
|
4903
4903
|
const s = t.dataset[Ke.DIAL_CODE];
|
|
4904
4904
|
if (this._updateDialCode(s), this.options.formatOnDisplay) {
|
|
4905
4905
|
const r = this._getTelInputValue();
|
|
4906
4906
|
this._updateValFromNumber(r);
|
|
4907
4907
|
}
|
|
4908
|
-
this.ui.telInput.focus(),
|
|
4908
|
+
this.ui.telInput.focus(), i && this._triggerCountryChange();
|
|
4909
4909
|
}
|
|
4910
4910
|
//* Close the dropdown and unbind any listeners.
|
|
4911
4911
|
_closeDropdown() {
|
|
4912
|
-
this.ui.dropdownContent.classList.contains(E.HIDE) || (this.ui.dropdownContent.classList.add(E.HIDE), this.ui.selectedCountry.setAttribute(
|
|
4912
|
+
this.ui.dropdownContent.classList.contains(E.HIDE) || (this.ui.dropdownContent.classList.add(E.HIDE), this.ui.selectedCountry.setAttribute(D.EXPANDED, "false"), this.options.countrySearch && (this.ui.searchInput.removeAttribute(D.ACTIVE_DESCENDANT), this.ui.highlightedItem && (this.ui.highlightedItem.classList.remove(E.HIGHLIGHT), this.ui.highlightedItem = null)), this.ui.dropdownArrow.classList.remove(E.ARROW_UP), this.dropdownAbortController.abort(), this.dropdownAbortController = null, this.options.dropdownContainer && this.ui.dropdown.remove(), this._trigger(Vt.CLOSE_COUNTRY_DROPDOWN));
|
|
4913
4913
|
}
|
|
4914
4914
|
//* Replace any existing dial code with the new one
|
|
4915
4915
|
//* Note: called from _selectListItem and setCountry
|
|
4916
4916
|
_updateDialCode(t) {
|
|
4917
|
-
const
|
|
4917
|
+
const n = this._getTelInputValue(), i = `+${t}`;
|
|
4918
4918
|
let s;
|
|
4919
|
-
if (
|
|
4920
|
-
const r = this._getDialCode(
|
|
4921
|
-
r ? s =
|
|
4919
|
+
if (n.startsWith("+")) {
|
|
4920
|
+
const r = this._getDialCode(n);
|
|
4921
|
+
r ? s = n.replace(r, i) : s = i, this._setTelInputValue(s);
|
|
4922
4922
|
}
|
|
4923
4923
|
}
|
|
4924
4924
|
//* Try and extract a valid international dial code from a full telephone number.
|
|
4925
4925
|
//* Note: returns the raw string inc plus character and any whitespace/dots etc.
|
|
4926
|
-
_getDialCode(t,
|
|
4927
|
-
let
|
|
4926
|
+
_getDialCode(t, n) {
|
|
4927
|
+
let i = "";
|
|
4928
4928
|
if (t.startsWith("+")) {
|
|
4929
4929
|
let s = "", r = !1;
|
|
4930
4930
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -4933,43 +4933,43 @@ class Se {
|
|
|
4933
4933
|
if (s += l, !!!this.dialCodeToIso2Map[s])
|
|
4934
4934
|
break;
|
|
4935
4935
|
if (this.dialCodes.has(s)) {
|
|
4936
|
-
if (
|
|
4936
|
+
if (i = t.substring(0, o + 1), r = !0, !n)
|
|
4937
4937
|
break;
|
|
4938
|
-
} else
|
|
4938
|
+
} else n && r && (i = t.substring(0, o + 1));
|
|
4939
4939
|
if (s.length === this.dialCodeMaxLen)
|
|
4940
4940
|
break;
|
|
4941
4941
|
}
|
|
4942
4942
|
}
|
|
4943
4943
|
}
|
|
4944
|
-
return
|
|
4944
|
+
return i;
|
|
4945
4945
|
}
|
|
4946
4946
|
//* Get the input val, adding the dial code if separateDialCode is enabled.
|
|
4947
4947
|
_getFullNumber(t) {
|
|
4948
|
-
const
|
|
4948
|
+
const n = t ? this._normaliseNumerals(t) : this._getTelInputValue(), { dialCode: i } = this.selectedCountryData;
|
|
4949
4949
|
let s;
|
|
4950
|
-
const r =
|
|
4951
|
-
return this.options.separateDialCode && !
|
|
4950
|
+
const r = jt(n);
|
|
4951
|
+
return this.options.separateDialCode && !n.startsWith("+") && i && r ? s = `+${i}` : s = "", s + n;
|
|
4952
4952
|
}
|
|
4953
4953
|
//* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
|
|
4954
4954
|
_beforeSetNumber(t) {
|
|
4955
|
-
const
|
|
4955
|
+
const n = this._getDialCode(t), i = Hs(
|
|
4956
4956
|
t,
|
|
4957
|
-
|
|
4957
|
+
n,
|
|
4958
4958
|
this.options.separateDialCode,
|
|
4959
4959
|
this.selectedCountryData
|
|
4960
4960
|
);
|
|
4961
|
-
return this._cap(
|
|
4961
|
+
return this._cap(i);
|
|
4962
4962
|
}
|
|
4963
4963
|
//* Trigger the 'countrychange' event.
|
|
4964
4964
|
_triggerCountryChange() {
|
|
4965
|
-
this._trigger(
|
|
4965
|
+
this._trigger(Vt.COUNTRY_CHANGE);
|
|
4966
4966
|
}
|
|
4967
4967
|
//**************************
|
|
4968
4968
|
//* SECRET PUBLIC METHODS
|
|
4969
4969
|
//**************************
|
|
4970
4970
|
//* This is called when the geoip call returns.
|
|
4971
4971
|
handleAutoCountry() {
|
|
4972
|
-
this.options.initialCountry ===
|
|
4972
|
+
this.options.initialCountry === oe.AUTO && _.autoCountry && (this.defaultCountry = _.autoCountry, this.selectedCountryData.iso2 || this.ui.selectedCountryInner.classList.contains(E.GLOBE) || this.setCountry(this.defaultCountry), this.resolveAutoCountryPromise());
|
|
4973
4973
|
}
|
|
4974
4974
|
//* This is called when the utils request completes.
|
|
4975
4975
|
handleUtils() {
|
|
@@ -4996,9 +4996,9 @@ class Se {
|
|
|
4996
4996
|
//* Format the number to the given format.
|
|
4997
4997
|
getNumber(t) {
|
|
4998
4998
|
if (_.utils) {
|
|
4999
|
-
const { iso2:
|
|
5000
|
-
n,
|
|
4999
|
+
const { iso2: n } = this.selectedCountryData, i = this._getFullNumber(), s = _.utils.formatNumber(
|
|
5001
5000
|
i,
|
|
5001
|
+
n,
|
|
5002
5002
|
t
|
|
5003
5003
|
);
|
|
5004
5004
|
return this._mapAsciiToUserNumerals(s);
|
|
@@ -5026,10 +5026,10 @@ class Se {
|
|
|
5026
5026
|
}
|
|
5027
5027
|
//* Validate the input val using number length only
|
|
5028
5028
|
isValidNumber() {
|
|
5029
|
-
const { dialCode: t, iso2:
|
|
5030
|
-
if (t ===
|
|
5031
|
-
const
|
|
5032
|
-
if (s[0] ===
|
|
5029
|
+
const { dialCode: t, iso2: n } = this.selectedCountryData;
|
|
5030
|
+
if (t === re.DIAL_CODE && _.utils) {
|
|
5031
|
+
const i = this._getFullNumber(), s = _.utils.getCoreNumber(i, n);
|
|
5032
|
+
if (s[0] === re.MOBILE_PREFIX && s.length !== re.MOBILE_CORE_LENGTH)
|
|
5033
5033
|
return !1;
|
|
5034
5034
|
}
|
|
5035
5035
|
return this._validateNumber(!1);
|
|
@@ -5051,12 +5051,12 @@ class Se {
|
|
|
5051
5051
|
return null;
|
|
5052
5052
|
if (!this.selectedCountryData.iso2)
|
|
5053
5053
|
return !1;
|
|
5054
|
-
const
|
|
5054
|
+
const n = (o) => t ? this._utilsIsValidNumber(o) : this._utilsIsPossibleNumber(o), i = this._getFullNumber(), s = i.search(at.ALPHA_UNICODE);
|
|
5055
5055
|
if (s > -1 && !this.options.allowPhonewords) {
|
|
5056
|
-
const o =
|
|
5057
|
-
return l &&
|
|
5056
|
+
const o = i.substring(0, s), l = n(o), a = n(i);
|
|
5057
|
+
return l && a;
|
|
5058
5058
|
}
|
|
5059
|
-
return i
|
|
5059
|
+
return n(i);
|
|
5060
5060
|
}
|
|
5061
5061
|
_utilsIsValidNumber(t) {
|
|
5062
5062
|
return _.utils ? _.utils.isValidNumber(
|
|
@@ -5067,12 +5067,12 @@ class Se {
|
|
|
5067
5067
|
}
|
|
5068
5068
|
//* Update the selected country, and update the input val accordingly.
|
|
5069
5069
|
setCountry(t) {
|
|
5070
|
-
const
|
|
5071
|
-
if (!
|
|
5072
|
-
throw new Error(`Invalid country code: '${
|
|
5073
|
-
const
|
|
5074
|
-
if (t &&
|
|
5075
|
-
if (this._setCountry(
|
|
5070
|
+
const n = t == null ? void 0 : t.toLowerCase();
|
|
5071
|
+
if (!ue(n))
|
|
5072
|
+
throw new Error(`Invalid country code: '${n}'`);
|
|
5073
|
+
const i = this.selectedCountryData.iso2;
|
|
5074
|
+
if (t && n !== i || !t && i) {
|
|
5075
|
+
if (this._setCountry(n), this._updateDialCode(this.selectedCountryData.dialCode), this.options.formatOnDisplay) {
|
|
5076
5076
|
const r = this._getTelInputValue();
|
|
5077
5077
|
this._updateValFromNumber(r);
|
|
5078
5078
|
}
|
|
@@ -5081,8 +5081,8 @@ class Se {
|
|
|
5081
5081
|
}
|
|
5082
5082
|
//* Set the input value and update the country.
|
|
5083
5083
|
setNumber(t) {
|
|
5084
|
-
const
|
|
5085
|
-
this._updateValFromNumber(
|
|
5084
|
+
const n = this._normaliseNumerals(t), i = this._updateCountryFromNumber(n);
|
|
5085
|
+
this._updateValFromNumber(n), i && this._triggerCountryChange(), this._trigger(Vt.INPUT, { isSetNumber: !0 });
|
|
5086
5086
|
}
|
|
5087
5087
|
//* Set the placeholder number typ
|
|
5088
5088
|
setPlaceholderNumberType(t) {
|
|
@@ -5092,14 +5092,14 @@ class Se {
|
|
|
5092
5092
|
this.ui.telInput.disabled = t, t ? this.ui.selectedCountry.setAttribute("disabled", "true") : this.ui.selectedCountry.removeAttribute("disabled");
|
|
5093
5093
|
}
|
|
5094
5094
|
}
|
|
5095
|
-
const
|
|
5095
|
+
const Ks = (e) => {
|
|
5096
5096
|
if (!_.utils && !_.startedLoadingUtilsScript) {
|
|
5097
5097
|
let t;
|
|
5098
5098
|
if (typeof e == "function")
|
|
5099
5099
|
try {
|
|
5100
5100
|
t = Promise.resolve(e());
|
|
5101
|
-
} catch (
|
|
5102
|
-
return Promise.reject(
|
|
5101
|
+
} catch (n) {
|
|
5102
|
+
return Promise.reject(n);
|
|
5103
5103
|
}
|
|
5104
5104
|
else
|
|
5105
5105
|
return Promise.reject(
|
|
@@ -5107,34 +5107,34 @@ const Gs = (e) => {
|
|
|
5107
5107
|
`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof e}`
|
|
5108
5108
|
)
|
|
5109
5109
|
);
|
|
5110
|
-
return _.startedLoadingUtilsScript = !0, t.then((
|
|
5111
|
-
const
|
|
5112
|
-
if (!
|
|
5110
|
+
return _.startedLoadingUtilsScript = !0, t.then((n) => {
|
|
5111
|
+
const i = n == null ? void 0 : n.default;
|
|
5112
|
+
if (!i || typeof i != "object")
|
|
5113
5113
|
throw new TypeError(
|
|
5114
5114
|
"The loader function passed to attachUtils did not resolve to a module object with utils as its default export."
|
|
5115
5115
|
);
|
|
5116
|
-
return _.utils =
|
|
5117
|
-
}).catch((
|
|
5118
|
-
throw kt("rejectUtilsScriptPromise",
|
|
5116
|
+
return _.utils = i, kt("handleUtils"), !0;
|
|
5117
|
+
}).catch((n) => {
|
|
5118
|
+
throw kt("rejectUtilsScriptPromise", n), n;
|
|
5119
5119
|
});
|
|
5120
5120
|
}
|
|
5121
5121
|
return null;
|
|
5122
5122
|
}, kt = (e, ...t) => {
|
|
5123
|
-
Object.values(_.instances).forEach((
|
|
5124
|
-
const
|
|
5125
|
-
typeof
|
|
5123
|
+
Object.values(_.instances).forEach((n) => {
|
|
5124
|
+
const i = n[e];
|
|
5125
|
+
typeof i == "function" && i.apply(n, t);
|
|
5126
5126
|
});
|
|
5127
5127
|
}, _ = Object.assign(
|
|
5128
5128
|
(e, t) => {
|
|
5129
|
-
const
|
|
5130
|
-
return _.instances[
|
|
5129
|
+
const n = new Se(e, t);
|
|
5130
|
+
return _.instances[n.id] = n, e.iti = n, n;
|
|
5131
5131
|
},
|
|
5132
5132
|
{
|
|
5133
|
-
defaults:
|
|
5133
|
+
defaults: Mn,
|
|
5134
5134
|
//* Using a static var like this allows us to mock it in the tests.
|
|
5135
5135
|
documentReady: () => document.readyState === "complete",
|
|
5136
5136
|
//* Get the country data object.
|
|
5137
|
-
getCountryData: () =>
|
|
5137
|
+
getCountryData: () => _t,
|
|
5138
5138
|
//* A getter for the plugin instance.
|
|
5139
5139
|
getInstance: (e) => {
|
|
5140
5140
|
const t = e.dataset.intlTelInputId;
|
|
@@ -5142,44 +5142,44 @@ const Gs = (e) => {
|
|
|
5142
5142
|
},
|
|
5143
5143
|
//* A map from instance ID to instance object.
|
|
5144
5144
|
instances: {},
|
|
5145
|
-
attachUtils:
|
|
5145
|
+
attachUtils: Ks,
|
|
5146
5146
|
startedLoadingUtilsScript: !1,
|
|
5147
5147
|
startedLoadingAutoCountry: !1,
|
|
5148
|
-
version: "25.
|
|
5148
|
+
version: "25.15.1"
|
|
5149
5149
|
}
|
|
5150
5150
|
);
|
|
5151
|
-
var
|
|
5152
|
-
function
|
|
5153
|
-
|
|
5154
|
-
let
|
|
5151
|
+
var Ys = /* @__PURE__ */ is("<input/>");
|
|
5152
|
+
function Qs(e, t) {
|
|
5153
|
+
yi(t, !0);
|
|
5154
|
+
let n = Ht(t, "disabled", 3, !1), i = Ht(t, "inputProps", 19, () => ({})), s = Ht(t, "options", 19, () => ({})), r = Ht(t, "value", 3, ""), o = /* @__PURE__ */ G(void 0), l = /* @__PURE__ */ G(void 0), a = /* @__PURE__ */ G(null), u = /* @__PURE__ */ G(!1);
|
|
5155
5155
|
const c = () => I(l) ? s().strictMode ? I(l).isValidNumberPrecise() : I(l).isValidNumber() : null, d = () => {
|
|
5156
|
-
var
|
|
5156
|
+
var h, v;
|
|
5157
5157
|
const m = c();
|
|
5158
|
-
I(
|
|
5158
|
+
I(a) !== m && (V(a, m, !0), (h = t.onChangeValidity) == null || h.call(t, !!m), (v = t.onChangeErrorCode) == null || v.call(t, m ? null : I(l).getValidationError()));
|
|
5159
5159
|
}, f = () => {
|
|
5160
|
-
var m,
|
|
5161
|
-
(
|
|
5162
|
-
},
|
|
5163
|
-
var m,
|
|
5164
|
-
(
|
|
5160
|
+
var m, h;
|
|
5161
|
+
(h = t.onChangeNumber) == null || h.call(t, ((m = I(l)) == null ? void 0 : m.getNumber()) ?? ""), d();
|
|
5162
|
+
}, p = () => {
|
|
5163
|
+
var m, h;
|
|
5164
|
+
(h = t.onChangeCountry) == null || h.call(t, ((m = I(l)) == null ? void 0 : m.getSelectedCountryData().iso2) ?? ""), f();
|
|
5165
5165
|
};
|
|
5166
|
-
|
|
5167
|
-
I(o) && (
|
|
5168
|
-
}),
|
|
5166
|
+
Vn(() => {
|
|
5167
|
+
I(o) && (V(l, _(I(o), s()), !0), I(o).addEventListener("countrychange", p), r() && I(l).setNumber(r()), n() && I(l).setDisabled(n()), V(a, c(), !0), V(u, !0));
|
|
5168
|
+
}), Wn(() => {
|
|
5169
5169
|
var m;
|
|
5170
|
-
I(o) && I(o).removeEventListener("countrychange",
|
|
5171
|
-
}),
|
|
5172
|
-
I(
|
|
5170
|
+
I(o) && I(o).removeEventListener("countrychange", p), (m = I(l)) == null || m.destroy();
|
|
5171
|
+
}), Wi(() => {
|
|
5172
|
+
I(u) && I(l) && I(l).setDisabled(n());
|
|
5173
5173
|
});
|
|
5174
5174
|
function C() {
|
|
5175
5175
|
return I(l);
|
|
5176
5176
|
}
|
|
5177
|
-
function
|
|
5177
|
+
function y() {
|
|
5178
5178
|
return I(o);
|
|
5179
5179
|
}
|
|
5180
|
-
var
|
|
5181
|
-
return
|
|
5180
|
+
var b = { getInstance: C, getInput: y }, g = Ys();
|
|
5181
|
+
return vs(g, () => ({ type: "tel", oninput: f, ...i() }), void 0, void 0, void 0, void 0, !0), bs(g, (m) => V(o, m), () => I(o)), ss(e, g), vi(b);
|
|
5182
5182
|
}
|
|
5183
5183
|
export {
|
|
5184
|
-
|
|
5184
|
+
Qs as default
|
|
5185
5185
|
};
|