@verbb/formie-browser 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -22
- package/dist/chunks/address-country-Rx6GQTND.js +68 -0
- package/dist/chunks/address-finder-yXU5yMjG.js +30 -0
- package/dist/chunks/address-state-BQ0xGV9n.js +344 -0
- package/dist/chunks/api-CmwLRq_n.js +780 -0
- package/dist/chunks/api-DMK8NSUI.js +407 -0
- package/dist/chunks/api-sPqGbOww.js +125 -0
- package/dist/chunks/async-nPFRNQ06.js +25 -0
- package/dist/chunks/bpoint-DSjqRv63.js +24 -0
- package/dist/chunks/calculations-CgVJcQ2P.js +299 -0
- package/dist/chunks/captcha-eu-CWJb64_j.js +31 -0
- package/dist/chunks/checkbox-radio-DQ0H67Tj.js +125 -0
- package/dist/chunks/chunk-3b4jIN3o.js +13 -0
- package/dist/chunks/combobox-D-2b42wn.js +1954 -0
- package/dist/chunks/conditions-CZ3FU5QO.js +412 -0
- package/dist/chunks/constants-DVcJAvc5.js +38 -0
- package/dist/chunks/country-from-ip-BwxKaBuJ.js +26 -0
- package/dist/chunks/custom-google-maps-BsaSirEZ.js +194 -0
- package/dist/chunks/custom-link-CJ1-FjEM.js +46 -0
- package/dist/chunks/custom-maps-DYW_pBid.js +161 -0
- package/dist/chunks/date-picker-5CA_-zGb.js +5311 -0
- package/dist/chunks/debug-BV0DvdHx.js +41 -0
- package/dist/chunks/dist-BF5GU3_9.js +2674 -0
- package/dist/chunks/event-names-BCI2FLD8.js +51 -0
- package/dist/chunks/eway-D3ctTbEk.js +70 -0
- package/dist/chunks/field-references.keys-58ZSTrCW.js +21 -0
- package/dist/chunks/field-references.resolver-CHwn0G0L.js +145 -0
- package/dist/chunks/file-upload-D49m8-DR.js +287 -0
- package/dist/chunks/friendly-captcha-v1-ByXzENYZ.js +31 -0
- package/dist/chunks/friendly-captcha-v2-BPdlmhQu.js +36 -0
- package/dist/chunks/friendly-challenge-8uPatWqk.js +832 -0
- package/dist/chunks/go-cardless-BwASSYSK.js +23 -0
- package/dist/chunks/google-address-OhKilPWE.js +161 -0
- package/dist/chunks/hcaptcha-CdCd9oEi.js +54 -0
- package/dist/chunks/hidden-D7_Ch-QN.js +26 -0
- package/dist/chunks/http-D-JExro7.js +27 -0
- package/dist/chunks/i18n-BY1ds1BL.js +121 -0
- package/dist/chunks/leaflet-src-j-lHNmhR.js +4585 -0
- package/dist/chunks/loqate-Cp2zvwpE.js +76 -0
- package/dist/chunks/mollie-COG-ko2D.js +23 -0
- package/dist/chunks/moneris-CMH8PlRc.js +117 -0
- package/dist/chunks/opayo-D2jsR5vh.js +113 -0
- package/dist/chunks/paddle-DxF88RfC.js +55 -0
- package/dist/chunks/paypal-b5pnwrA2.js +95 -0
- package/dist/chunks/payway-BJYu9DIR.js +55 -0
- package/dist/chunks/phone-country-D3ayr60L.js +2645 -0
- package/dist/chunks/place-kit-BGHklIZ-.js +48 -0
- package/dist/chunks/placekit-autocomplete.esm-DWVabQlq.js +1236 -0
- package/dist/chunks/recaptcha-enterprise-BSwi8IVX.js +65 -0
- package/dist/chunks/recaptcha-shared-B4zAescW.js +15 -0
- package/dist/chunks/recaptcha-v2-checkbox-CnDQmsKa.js +40 -0
- package/dist/chunks/recaptcha-v2-invisible-Cz5uIlp-.js +53 -0
- package/dist/chunks/recaptcha-v3-BtbbP111.js +27 -0
- package/dist/chunks/repeater-B5leVxZU.js +102 -0
- package/dist/chunks/rich-text-Cv8ADyk-.js +349 -0
- package/dist/chunks/scripts-6CYSUGKQ.js +24 -0
- package/dist/chunks/sdk-BhHAYgga.js +1397 -0
- package/dist/chunks/shared-Bx9s0i0P.js +100 -0
- package/dist/chunks/signature-CpgqHCEx.js +463 -0
- package/dist/chunks/snaptcha-vz1RnZ15.js +8 -0
- package/dist/chunks/square-BP8RWAKB.js +40 -0
- package/dist/chunks/stripe-MihN63uC.js +184 -0
- package/dist/chunks/styles-BfoIZwJp.js +19 -0
- package/dist/chunks/summary-D3AjxpYN.js +114 -0
- package/dist/chunks/table-C-lkQN6I.js +78 -0
- package/dist/chunks/text-limit-B09elPDB.js +125 -0
- package/dist/chunks/theme-classes-Tv7q7ToE.js +44 -0
- package/dist/chunks/turnstile-D_Pi1CKM.js +58 -0
- package/dist/chunks/utils-Vqp8i_RM.js +49401 -0
- package/dist/css/formie-theme.css +2 -0
- package/dist/css/theme/fields/_address-state.css +94 -0
- package/dist/css/theme/fields/_combobox.css +246 -0
- package/dist/css/theme/fields/_select.css +13 -0
- package/dist/index.js +2447 -39
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/submit-result-ui.d.ts.map +1 -1
- package/dist/js/core/validation-focus.d.ts +4 -0
- package/dist/js/core/validation-focus.d.ts.map +1 -0
- package/dist/js/modules/address/api.d.ts +1 -0
- package/dist/js/modules/address/api.d.ts.map +1 -1
- package/dist/js/modules/address/constants.d.ts +22 -1
- package/dist/js/modules/address/constants.d.ts.map +1 -1
- package/dist/js/modules/address/host.d.ts +2 -2
- package/dist/js/modules/address/host.d.ts.map +1 -1
- package/dist/js/modules/address/loqate.d.ts.map +1 -1
- package/dist/js/modules/fields/address-country.d.ts +3 -0
- package/dist/js/modules/fields/address-country.d.ts.map +1 -0
- package/dist/js/modules/fields/address-state.d.ts +3 -0
- package/dist/js/modules/fields/address-state.d.ts.map +1 -0
- package/dist/js/modules/fields/calculations.d.ts.map +1 -1
- package/dist/js/modules/fields/combobox.d.ts +17 -0
- package/dist/js/modules/fields/combobox.d.ts.map +1 -0
- package/dist/js/modules/fields/custom-google-maps.d.ts +64 -0
- package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -0
- package/dist/js/modules/fields/custom-link.d.ts +3 -0
- package/dist/js/modules/fields/custom-link.d.ts.map +1 -0
- package/dist/js/modules/fields/custom-maps.d.ts +3 -0
- package/dist/js/modules/fields/custom-maps.d.ts.map +1 -0
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
- package/dist/js/modules/fields/index.d.ts.map +1 -1
- package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
- package/dist/js/submit/pipeline.d.ts.map +1 -1
- package/dist/js/utils/country-from-ip.d.ts +7 -0
- package/dist/js/utils/country-from-ip.d.ts.map +1 -0
- package/dist/js/utils/field-references.d.ts +1 -0
- package/dist/js/utils/field-references.d.ts.map +1 -1
- package/dist/js/utils/field-references.row-scope.d.ts +11 -0
- package/dist/js/utils/field-references.row-scope.d.ts.map +1 -0
- package/package.json +6 -3
- package/src/css/formie-theme.css +2 -0
- package/src/css/theme/fields/_address-state.css +94 -0
- package/src/css/theme/fields/_combobox.css +246 -0
- package/src/css/theme/fields/_select.css +13 -0
- package/src/js/core/create-formie-client.ts +27 -0
- package/src/js/core/submit-result-ui.ts +4 -4
- package/src/js/core/validation-focus.ts +117 -0
- package/src/js/modules/address/api.ts +7 -0
- package/src/js/modules/address/constants.ts +82 -2
- package/src/js/modules/address/host.ts +16 -6
- package/src/js/modules/address/loqate.ts +3 -17
- package/src/js/modules/fields/address-country.ts +156 -0
- package/src/js/modules/fields/address-state.ts +946 -0
- package/src/js/modules/fields/calculations.ts +32 -0
- package/src/js/modules/fields/combobox.ts +188 -0
- package/src/js/modules/fields/custom-google-maps.ts +416 -0
- package/src/js/modules/fields/custom-link.ts +95 -0
- package/src/js/modules/fields/custom-maps.ts +339 -0
- package/src/js/modules/fields/date-picker.ts +96 -3
- package/src/js/modules/fields/index.ts +6 -0
- package/src/js/modules/fields/phone-country.ts +6 -0
- package/src/js/submit/pipeline.ts +11 -1
- package/src/js/utils/country-from-ip.ts +54 -0
- package/src/js/utils/field-references.row-scope.ts +303 -0
- package/src/js/utils/field-references.ts +1 -0
- package/dist/chunks/address-finder-BU4roxT6.js +0 -37
- package/dist/chunks/bpoint-uNg5j6rt.js +0 -26
- package/dist/chunks/calculations-C9t6Zop9.js +0 -147
- package/dist/chunks/captcha-eu-BAPzHNts.js +0 -34
- package/dist/chunks/checkbox-radio-CHeLNVIK.js +0 -141
- package/dist/chunks/conditions-DKxVCsjD.js +0 -459
- package/dist/chunks/date-picker-B3iQ797Z.js +0 -4994
- package/dist/chunks/eway-DCielIML.js +0 -74
- package/dist/chunks/file-upload-DP2TOUYV.js +0 -316
- package/dist/chunks/friendly-captcha-v1-DdlcGiFY.js +0 -33
- package/dist/chunks/friendly-captcha-v2-76w-YnFm.js +0 -38
- package/dist/chunks/go-cardless-rwCkzbNK.js +0 -24
- package/dist/chunks/google-address-BD8IZ86V.js +0 -181
- package/dist/chunks/hcaptcha-BNNTL6uf.js +0 -56
- package/dist/chunks/hidden-CW6Rcf1N.js +0 -31
- package/dist/chunks/index-BEsfee-D.js +0 -1839
- package/dist/chunks/index-BP7Unm5Y.js +0 -863
- package/dist/chunks/index-D6npYxvr.js +0 -4423
- package/dist/chunks/loqate-B-ZNS65B.js +0 -55
- package/dist/chunks/mollie-BDAZ-1X4.js +0 -24
- package/dist/chunks/moneris-B1b0uEtY.js +0 -101
- package/dist/chunks/opayo-CC5hraHo.js +0 -122
- package/dist/chunks/paddle-B4GmrDsq.js +0 -60
- package/dist/chunks/paypal-BFS6XsIS.js +0 -100
- package/dist/chunks/payway-DekoJead.js +0 -56
- package/dist/chunks/phone-country-Cm5YUeXI.js +0 -3765
- package/dist/chunks/place-kit-DizZWV_e.js +0 -42
- package/dist/chunks/placekit-autocomplete.esm-LAwfbPZl.js +0 -1299
- package/dist/chunks/recaptcha-enterprise-BbOvO7JZ.js +0 -71
- package/dist/chunks/recaptcha-shared-Dwg1eVFS.js +0 -15
- package/dist/chunks/recaptcha-v2-checkbox-SY3ti5iQ.js +0 -41
- package/dist/chunks/recaptcha-v2-invisible-DSmQnn6c.js +0 -59
- package/dist/chunks/recaptcha-v3-DNh7YCnR.js +0 -28
- package/dist/chunks/repeater-DM0vuFNQ.js +0 -124
- package/dist/chunks/rich-text-C8aGYp70.js +0 -304
- package/dist/chunks/scripts-CKTFtxPO.js +0 -36
- package/dist/chunks/sdk-3SicTWby.js +0 -1559
- package/dist/chunks/shared--BU5CFoL.js +0 -80
- package/dist/chunks/signature-pFhZfH7d.js +0 -550
- package/dist/chunks/snaptcha-VuOUOaLj.js +0 -8
- package/dist/chunks/square-BR9pvToy.js +0 -46
- package/dist/chunks/stripe-OHUwoV9g.js +0 -202
- package/dist/chunks/styles-C3aqgtek.js +0 -21
- package/dist/chunks/summary-Da7Ktg3N.js +0 -126
- package/dist/chunks/table-C0PmR9bI.js +0 -95
- package/dist/chunks/text-limit-mLEwZDIa.js +0 -144
- package/dist/chunks/turnstile-9tM7q_LK.js +0 -59
- package/dist/chunks/utils-BntI3W4S.js +0 -6149
|
@@ -0,0 +1,1236 @@
|
|
|
1
|
+
//#region ../../node_modules/@placekit/autocomplete-js/dist/placekit-autocomplete.esm.mjs
|
|
2
|
+
var e = /* @__PURE__ */ new Map();
|
|
3
|
+
function t() {
|
|
4
|
+
let e = [];
|
|
5
|
+
return typeof window < "u" && navigator.userAgent && e.push(navigator.userAgent), e.push("PlaceKit/2.3.0 (Client=JavaScript)"), typeof process < "u" && process.version && e.push(`NodeJS/${process.version}`), e.join(" ");
|
|
6
|
+
}
|
|
7
|
+
function n(n, r = {}) {
|
|
8
|
+
if (["string", "undefined"].includes(typeof n)) n || console.warn("PlaceKit: missing or empty `apiKey` argument.");
|
|
9
|
+
else throw Error("PlaceKit: `apiKey` argument is invalid, expected a string.");
|
|
10
|
+
let i = 0, a = ["https://api.placekit.co"], o = !1, s = { maxResults: 5 };
|
|
11
|
+
typeof window < "u" && navigator.language && (s.language = navigator.language.slice(0, 2));
|
|
12
|
+
let c = t();
|
|
13
|
+
function l(e = "POST", t = "", r = {}) {
|
|
14
|
+
let { timeout: o, forwardIP: s, ...u } = r, d = new AbortController(), f = o === void 0 ? void 0 : setTimeout(() => d.abort(), o), p = new URL(t.trim().replace(/^\/+/, ""), a[i]);
|
|
15
|
+
["GET", "HEAD"].includes(e) && u !== void 0 && Object.keys(u).forEach((e) => p.searchParams.append(e, u[e]));
|
|
16
|
+
let m = {
|
|
17
|
+
"Content-Type": "application/json; charset=UTF-8",
|
|
18
|
+
"User-Agent": c,
|
|
19
|
+
"x-placekit-api-key": n
|
|
20
|
+
};
|
|
21
|
+
return s && (m["x-forwarded-for"] = s), fetch(p, {
|
|
22
|
+
method: e,
|
|
23
|
+
headers: m,
|
|
24
|
+
signal: d.signal,
|
|
25
|
+
body: ["GET", "HEAD"].includes(e) ? void 0 : JSON.stringify(u)
|
|
26
|
+
}).then(async (e) => {
|
|
27
|
+
clearTimeout(f);
|
|
28
|
+
let t = await e.json();
|
|
29
|
+
if (!e.ok) throw {
|
|
30
|
+
status: e.status,
|
|
31
|
+
statusText: e.statusText,
|
|
32
|
+
...t
|
|
33
|
+
};
|
|
34
|
+
return t;
|
|
35
|
+
}).catch((n) => {
|
|
36
|
+
if ((n.name === "AbortError" || n.status && n.status >= 500) && (i++, i < a.length - 1)) return l(e, t, r);
|
|
37
|
+
throw n;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
let u = {
|
|
41
|
+
get options() {
|
|
42
|
+
return s;
|
|
43
|
+
},
|
|
44
|
+
get hasGeolocation() {
|
|
45
|
+
return o;
|
|
46
|
+
},
|
|
47
|
+
configure(e = {}) {
|
|
48
|
+
if (!["object", "undefined"].includes(typeof e) || Array.isArray(e) || e === null) throw Error("PlaceKit.configure: `opts` argument is invalid, expected an object.");
|
|
49
|
+
Object.assign(s, e);
|
|
50
|
+
},
|
|
51
|
+
requestGeolocation(e = {}) {
|
|
52
|
+
if (!["object", "undefined"].includes(typeof e) || Array.isArray(e) || e === null) throw Error("PlaceKit.requestGeolocation: `opts` argument is invalid, expected an object.");
|
|
53
|
+
return new Promise((t, n) => {
|
|
54
|
+
typeof window > "u" || !navigator.geolocation ? n(Error("PlaceKit.requestGeolocation: geolocation is only available in the browser.")) : navigator.geolocation.getCurrentPosition((e) => {
|
|
55
|
+
o = !0, s.coordinates = `${e.coords.latitude},${e.coords.longitude}`, t(e);
|
|
56
|
+
}, (e) => {
|
|
57
|
+
o = !1, delete s.coordinates, n(Error(`PlaceKit.requestGeolocation: (${e.code}) ${e.message}`));
|
|
58
|
+
}, e);
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
clearGeolocation() {
|
|
62
|
+
o = !1, delete s.coordinates;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
for (let [t, n] of e.entries()) {
|
|
66
|
+
if (t in u) throw Error(`PlaceKit extend: \`client.${t}\` already exists.`);
|
|
67
|
+
u[t] = n(l, u);
|
|
68
|
+
}
|
|
69
|
+
return u.configure(r), u;
|
|
70
|
+
}
|
|
71
|
+
n.extend = function(t, n) {
|
|
72
|
+
if (!n?.call) throw Error("PlaceKit extend: `init` argument is invalid, expected a function.");
|
|
73
|
+
e.set(t, n);
|
|
74
|
+
}, n.extend("search", (e, t) => (n, r = {}) => {
|
|
75
|
+
if (!["string", "undefined"].includes(typeof n)) throw Error("PlaceKit `client.search`: `query` argument is invalid, expected a string.");
|
|
76
|
+
if (!["object", "undefined"].includes(typeof r) || Array.isArray(r) || r === null) throw Error("PlaceKit.search: `opts` argument is invalid, expected an object.");
|
|
77
|
+
return e("POST", "search", {
|
|
78
|
+
...t.options,
|
|
79
|
+
...r,
|
|
80
|
+
query: n
|
|
81
|
+
});
|
|
82
|
+
}), n.extend("reverse", (e, t) => (n = {}) => {
|
|
83
|
+
if (!["object", "undefined"].includes(typeof n) || Array.isArray(n) || n === null) throw Error("PlaceKit.reverse: `opts` argument is invalid, expected an object.");
|
|
84
|
+
return e("POST", "reverse", {
|
|
85
|
+
...t.options,
|
|
86
|
+
...n
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
var r = "top", i = "bottom", a = "right", o = "left", s = "auto", c = [
|
|
90
|
+
r,
|
|
91
|
+
i,
|
|
92
|
+
a,
|
|
93
|
+
o
|
|
94
|
+
], l = "start", u = "end", d = "clippingParents", f = "viewport", p = "popper", m = "reference", h = c.reduce(function(e, t) {
|
|
95
|
+
return e.concat([t + "-" + l, t + "-" + u]);
|
|
96
|
+
}, []), g = [].concat(c, [s]).reduce(function(e, t) {
|
|
97
|
+
return e.concat([
|
|
98
|
+
t,
|
|
99
|
+
t + "-" + l,
|
|
100
|
+
t + "-" + u
|
|
101
|
+
]);
|
|
102
|
+
}, []), _ = [
|
|
103
|
+
"beforeRead",
|
|
104
|
+
"read",
|
|
105
|
+
"afterRead",
|
|
106
|
+
"beforeMain",
|
|
107
|
+
"main",
|
|
108
|
+
"afterMain",
|
|
109
|
+
"beforeWrite",
|
|
110
|
+
"write",
|
|
111
|
+
"afterWrite"
|
|
112
|
+
];
|
|
113
|
+
function v(e) {
|
|
114
|
+
return e ? (e.nodeName || "").toLowerCase() : null;
|
|
115
|
+
}
|
|
116
|
+
function y(e) {
|
|
117
|
+
if (e == null) return window;
|
|
118
|
+
if (e.toString() !== "[object Window]") {
|
|
119
|
+
var t = e.ownerDocument;
|
|
120
|
+
return t && t.defaultView || window;
|
|
121
|
+
}
|
|
122
|
+
return e;
|
|
123
|
+
}
|
|
124
|
+
function b(e) {
|
|
125
|
+
return e instanceof y(e).Element || e instanceof Element;
|
|
126
|
+
}
|
|
127
|
+
function x(e) {
|
|
128
|
+
return e instanceof y(e).HTMLElement || e instanceof HTMLElement;
|
|
129
|
+
}
|
|
130
|
+
function S(e) {
|
|
131
|
+
return typeof ShadowRoot > "u" ? !1 : e instanceof y(e).ShadowRoot || e instanceof ShadowRoot;
|
|
132
|
+
}
|
|
133
|
+
function C(e) {
|
|
134
|
+
var t = e.state;
|
|
135
|
+
Object.keys(t.elements).forEach(function(e) {
|
|
136
|
+
var n = t.styles[e] || {}, r = t.attributes[e] || {}, i = t.elements[e];
|
|
137
|
+
!x(i) || !v(i) || (Object.assign(i.style, n), Object.keys(r).forEach(function(e) {
|
|
138
|
+
var t = r[e];
|
|
139
|
+
t === !1 ? i.removeAttribute(e) : i.setAttribute(e, t === !0 ? "" : t);
|
|
140
|
+
}));
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function w(e) {
|
|
144
|
+
var t = e.state, n = {
|
|
145
|
+
popper: {
|
|
146
|
+
position: t.options.strategy,
|
|
147
|
+
left: "0",
|
|
148
|
+
top: "0",
|
|
149
|
+
margin: "0"
|
|
150
|
+
},
|
|
151
|
+
arrow: { position: "absolute" },
|
|
152
|
+
reference: {}
|
|
153
|
+
};
|
|
154
|
+
return Object.assign(t.elements.popper.style, n.popper), t.styles = n, t.elements.arrow && Object.assign(t.elements.arrow.style, n.arrow), function() {
|
|
155
|
+
Object.keys(t.elements).forEach(function(e) {
|
|
156
|
+
var r = t.elements[e], i = t.attributes[e] || {}, a = Object.keys(t.styles.hasOwnProperty(e) ? t.styles[e] : n[e]).reduce(function(e, t) {
|
|
157
|
+
return e[t] = "", e;
|
|
158
|
+
}, {});
|
|
159
|
+
!x(r) || !v(r) || (Object.assign(r.style, a), Object.keys(i).forEach(function(e) {
|
|
160
|
+
r.removeAttribute(e);
|
|
161
|
+
}));
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
var T = {
|
|
166
|
+
name: "applyStyles",
|
|
167
|
+
enabled: !0,
|
|
168
|
+
phase: "write",
|
|
169
|
+
fn: C,
|
|
170
|
+
effect: w,
|
|
171
|
+
requires: ["computeStyles"]
|
|
172
|
+
};
|
|
173
|
+
function E(e) {
|
|
174
|
+
return e.split("-")[0];
|
|
175
|
+
}
|
|
176
|
+
var D = Math.max, O = Math.min, k = Math.round;
|
|
177
|
+
function A() {
|
|
178
|
+
var e = navigator.userAgentData;
|
|
179
|
+
return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(e) {
|
|
180
|
+
return e.brand + "/" + e.version;
|
|
181
|
+
}).join(" ") : navigator.userAgent;
|
|
182
|
+
}
|
|
183
|
+
function j() {
|
|
184
|
+
return !/^((?!chrome|android).)*safari/i.test(A());
|
|
185
|
+
}
|
|
186
|
+
function M(e, t, n) {
|
|
187
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
188
|
+
var r = e.getBoundingClientRect(), i = 1, a = 1;
|
|
189
|
+
t && x(e) && (i = e.offsetWidth > 0 && k(r.width) / e.offsetWidth || 1, a = e.offsetHeight > 0 && k(r.height) / e.offsetHeight || 1);
|
|
190
|
+
var o = (b(e) ? y(e) : window).visualViewport, s = !j() && n, c = (r.left + (s && o ? o.offsetLeft : 0)) / i, l = (r.top + (s && o ? o.offsetTop : 0)) / a, u = r.width / i, d = r.height / a;
|
|
191
|
+
return {
|
|
192
|
+
width: u,
|
|
193
|
+
height: d,
|
|
194
|
+
top: l,
|
|
195
|
+
right: c + u,
|
|
196
|
+
bottom: l + d,
|
|
197
|
+
left: c,
|
|
198
|
+
x: c,
|
|
199
|
+
y: l
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function N(e) {
|
|
203
|
+
var t = M(e), n = e.offsetWidth, r = e.offsetHeight;
|
|
204
|
+
return Math.abs(t.width - n) <= 1 && (n = t.width), Math.abs(t.height - r) <= 1 && (r = t.height), {
|
|
205
|
+
x: e.offsetLeft,
|
|
206
|
+
y: e.offsetTop,
|
|
207
|
+
width: n,
|
|
208
|
+
height: r
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function P(e, t) {
|
|
212
|
+
var n = t.getRootNode && t.getRootNode();
|
|
213
|
+
if (e.contains(t)) return !0;
|
|
214
|
+
if (n && S(n)) {
|
|
215
|
+
var r = t;
|
|
216
|
+
do {
|
|
217
|
+
if (r && e.isSameNode(r)) return !0;
|
|
218
|
+
r = r.parentNode || r.host;
|
|
219
|
+
} while (r);
|
|
220
|
+
}
|
|
221
|
+
return !1;
|
|
222
|
+
}
|
|
223
|
+
function F(e) {
|
|
224
|
+
return y(e).getComputedStyle(e);
|
|
225
|
+
}
|
|
226
|
+
function I(e) {
|
|
227
|
+
return [
|
|
228
|
+
"table",
|
|
229
|
+
"td",
|
|
230
|
+
"th"
|
|
231
|
+
].indexOf(v(e)) >= 0;
|
|
232
|
+
}
|
|
233
|
+
function L(e) {
|
|
234
|
+
return ((b(e) ? e.ownerDocument : e.document) || window.document).documentElement;
|
|
235
|
+
}
|
|
236
|
+
function R(e) {
|
|
237
|
+
return v(e) === "html" ? e : e.assignedSlot || e.parentNode || (S(e) ? e.host : null) || L(e);
|
|
238
|
+
}
|
|
239
|
+
function z(e) {
|
|
240
|
+
return !x(e) || F(e).position === "fixed" ? null : e.offsetParent;
|
|
241
|
+
}
|
|
242
|
+
function B(e) {
|
|
243
|
+
var t = /firefox/i.test(A());
|
|
244
|
+
if (/Trident/i.test(A()) && x(e) && F(e).position === "fixed") return null;
|
|
245
|
+
var n = R(e);
|
|
246
|
+
for (S(n) && (n = n.host); x(n) && ["html", "body"].indexOf(v(n)) < 0;) {
|
|
247
|
+
var r = F(n);
|
|
248
|
+
if (r.transform !== "none" || r.perspective !== "none" || r.contain === "paint" || ["transform", "perspective"].indexOf(r.willChange) !== -1 || t && r.willChange === "filter" || t && r.filter && r.filter !== "none") return n;
|
|
249
|
+
n = n.parentNode;
|
|
250
|
+
}
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
function V(e) {
|
|
254
|
+
for (var t = y(e), n = z(e); n && I(n) && F(n).position === "static";) n = z(n);
|
|
255
|
+
return n && (v(n) === "html" || v(n) === "body" && F(n).position === "static") ? t : n || B(e) || t;
|
|
256
|
+
}
|
|
257
|
+
function ee(e) {
|
|
258
|
+
return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
|
|
259
|
+
}
|
|
260
|
+
function H(e, t, n) {
|
|
261
|
+
return D(e, O(t, n));
|
|
262
|
+
}
|
|
263
|
+
function te(e, t, n) {
|
|
264
|
+
var r = H(e, t, n);
|
|
265
|
+
return r > n ? n : r;
|
|
266
|
+
}
|
|
267
|
+
function ne() {
|
|
268
|
+
return {
|
|
269
|
+
top: 0,
|
|
270
|
+
right: 0,
|
|
271
|
+
bottom: 0,
|
|
272
|
+
left: 0
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function U(e) {
|
|
276
|
+
return Object.assign({}, ne(), e);
|
|
277
|
+
}
|
|
278
|
+
function re(e, t) {
|
|
279
|
+
return t.reduce(function(t, n) {
|
|
280
|
+
return t[n] = e, t;
|
|
281
|
+
}, {});
|
|
282
|
+
}
|
|
283
|
+
var ie = function(e, t) {
|
|
284
|
+
return e = typeof e == "function" ? e(Object.assign({}, t.rects, { placement: t.placement })) : e, U(typeof e == "number" ? re(e, c) : e);
|
|
285
|
+
};
|
|
286
|
+
function ae(e) {
|
|
287
|
+
var t, n = e.state, s = e.name, c = e.options, l = n.elements.arrow, u = n.modifiersData.popperOffsets, d = E(n.placement), f = ee(d), p = [o, a].indexOf(d) >= 0 ? "height" : "width";
|
|
288
|
+
if (!(!l || !u)) {
|
|
289
|
+
var m = ie(c.padding, n), h = N(l), g = f === "y" ? r : o, _ = f === "y" ? i : a, v = n.rects.reference[p] + n.rects.reference[f] - u[f] - n.rects.popper[p], y = u[f] - n.rects.reference[f], b = V(l), x = b ? f === "y" ? b.clientHeight || 0 : b.clientWidth || 0 : 0, S = v / 2 - y / 2, C = m[g], w = x - h[p] - m[_], T = x / 2 - h[p] / 2 + S, D = H(C, T, w), O = f;
|
|
290
|
+
n.modifiersData[s] = (t = {}, t[O] = D, t.centerOffset = D - T, t);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
function oe(e) {
|
|
294
|
+
var t = e.state, n = e.options.element, r = n === void 0 ? "[data-popper-arrow]" : n;
|
|
295
|
+
r != null && (typeof r == "string" && (r = t.elements.popper.querySelector(r), !r) || P(t.elements.popper, r) && (t.elements.arrow = r));
|
|
296
|
+
}
|
|
297
|
+
var se = {
|
|
298
|
+
name: "arrow",
|
|
299
|
+
enabled: !0,
|
|
300
|
+
phase: "main",
|
|
301
|
+
fn: ae,
|
|
302
|
+
effect: oe,
|
|
303
|
+
requires: ["popperOffsets"],
|
|
304
|
+
requiresIfExists: ["preventOverflow"]
|
|
305
|
+
};
|
|
306
|
+
function W(e) {
|
|
307
|
+
return e.split("-")[1];
|
|
308
|
+
}
|
|
309
|
+
var ce = {
|
|
310
|
+
top: "auto",
|
|
311
|
+
right: "auto",
|
|
312
|
+
bottom: "auto",
|
|
313
|
+
left: "auto"
|
|
314
|
+
};
|
|
315
|
+
function le(e, t) {
|
|
316
|
+
var n = e.x, r = e.y, i = t.devicePixelRatio || 1;
|
|
317
|
+
return {
|
|
318
|
+
x: k(n * i) / i || 0,
|
|
319
|
+
y: k(r * i) / i || 0
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function ue(e) {
|
|
323
|
+
var t, n = e.popper, s = e.popperRect, c = e.placement, l = e.variation, d = e.offsets, f = e.position, p = e.gpuAcceleration, m = e.adaptive, h = e.roundOffsets, g = e.isFixed, _ = d.x, v = _ === void 0 ? 0 : _, b = d.y, x = b === void 0 ? 0 : b, S = typeof h == "function" ? h({
|
|
324
|
+
x: v,
|
|
325
|
+
y: x
|
|
326
|
+
}) : {
|
|
327
|
+
x: v,
|
|
328
|
+
y: x
|
|
329
|
+
};
|
|
330
|
+
v = S.x, x = S.y;
|
|
331
|
+
var C = d.hasOwnProperty("x"), w = d.hasOwnProperty("y"), T = o, E = r, D = window;
|
|
332
|
+
if (m) {
|
|
333
|
+
var O = V(n), k = "clientHeight", A = "clientWidth";
|
|
334
|
+
if (O === y(n) && (O = L(n), F(O).position !== "static" && f === "absolute" && (k = "scrollHeight", A = "scrollWidth")), O = O, c === r || (c === o || c === a) && l === u) {
|
|
335
|
+
E = i;
|
|
336
|
+
var j = g && O === D && D.visualViewport ? D.visualViewport.height : O[k];
|
|
337
|
+
x -= j - s.height, x *= p ? 1 : -1;
|
|
338
|
+
}
|
|
339
|
+
if (c === o || (c === r || c === i) && l === u) {
|
|
340
|
+
T = a;
|
|
341
|
+
var M = g && O === D && D.visualViewport ? D.visualViewport.width : O[A];
|
|
342
|
+
v -= M - s.width, v *= p ? 1 : -1;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
var N = Object.assign({ position: f }, m && ce), P = h === !0 ? le({
|
|
346
|
+
x: v,
|
|
347
|
+
y: x
|
|
348
|
+
}, y(n)) : {
|
|
349
|
+
x: v,
|
|
350
|
+
y: x
|
|
351
|
+
};
|
|
352
|
+
if (v = P.x, x = P.y, p) {
|
|
353
|
+
var I;
|
|
354
|
+
return Object.assign({}, N, (I = {}, I[E] = w ? "0" : "", I[T] = C ? "0" : "", I.transform = (D.devicePixelRatio || 1) <= 1 ? "translate(" + v + "px, " + x + "px)" : "translate3d(" + v + "px, " + x + "px, 0)", I));
|
|
355
|
+
}
|
|
356
|
+
return Object.assign({}, N, (t = {}, t[E] = w ? x + "px" : "", t[T] = C ? v + "px" : "", t.transform = "", t));
|
|
357
|
+
}
|
|
358
|
+
function de(e) {
|
|
359
|
+
var t = e.state, n = e.options, r = n.gpuAcceleration, i = r === void 0 ? !0 : r, a = n.adaptive, o = a === void 0 ? !0 : a, s = n.roundOffsets, c = s === void 0 ? !0 : s, l = {
|
|
360
|
+
placement: E(t.placement),
|
|
361
|
+
variation: W(t.placement),
|
|
362
|
+
popper: t.elements.popper,
|
|
363
|
+
popperRect: t.rects.popper,
|
|
364
|
+
gpuAcceleration: i,
|
|
365
|
+
isFixed: t.options.strategy === "fixed"
|
|
366
|
+
};
|
|
367
|
+
t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, ue(Object.assign({}, l, {
|
|
368
|
+
offsets: t.modifiersData.popperOffsets,
|
|
369
|
+
position: t.options.strategy,
|
|
370
|
+
adaptive: o,
|
|
371
|
+
roundOffsets: c
|
|
372
|
+
})))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, ue(Object.assign({}, l, {
|
|
373
|
+
offsets: t.modifiersData.arrow,
|
|
374
|
+
position: "absolute",
|
|
375
|
+
adaptive: !1,
|
|
376
|
+
roundOffsets: c
|
|
377
|
+
})))), t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-placement": t.placement });
|
|
378
|
+
}
|
|
379
|
+
var fe = {
|
|
380
|
+
name: "computeStyles",
|
|
381
|
+
enabled: !0,
|
|
382
|
+
phase: "beforeWrite",
|
|
383
|
+
fn: de,
|
|
384
|
+
data: {}
|
|
385
|
+
}, G = { passive: !0 };
|
|
386
|
+
function pe(e) {
|
|
387
|
+
var t = e.state, n = e.instance, r = e.options, i = r.scroll, a = i === void 0 ? !0 : i, o = r.resize, s = o === void 0 ? !0 : o, c = y(t.elements.popper), l = [].concat(t.scrollParents.reference, t.scrollParents.popper);
|
|
388
|
+
return a && l.forEach(function(e) {
|
|
389
|
+
e.addEventListener("scroll", n.update, G);
|
|
390
|
+
}), s && c.addEventListener("resize", n.update, G), function() {
|
|
391
|
+
a && l.forEach(function(e) {
|
|
392
|
+
e.removeEventListener("scroll", n.update, G);
|
|
393
|
+
}), s && c.removeEventListener("resize", n.update, G);
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
var me = {
|
|
397
|
+
name: "eventListeners",
|
|
398
|
+
enabled: !0,
|
|
399
|
+
phase: "write",
|
|
400
|
+
fn: function() {},
|
|
401
|
+
effect: pe,
|
|
402
|
+
data: {}
|
|
403
|
+
}, K = {
|
|
404
|
+
left: "right",
|
|
405
|
+
right: "left",
|
|
406
|
+
bottom: "top",
|
|
407
|
+
top: "bottom"
|
|
408
|
+
};
|
|
409
|
+
function q(e) {
|
|
410
|
+
return e.replace(/left|right|bottom|top/g, function(e) {
|
|
411
|
+
return K[e];
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
var he = {
|
|
415
|
+
start: "end",
|
|
416
|
+
end: "start"
|
|
417
|
+
};
|
|
418
|
+
function ge(e) {
|
|
419
|
+
return e.replace(/start|end/g, function(e) {
|
|
420
|
+
return he[e];
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
function _e(e) {
|
|
424
|
+
var t = y(e);
|
|
425
|
+
return {
|
|
426
|
+
scrollLeft: t.pageXOffset,
|
|
427
|
+
scrollTop: t.pageYOffset
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function J(e) {
|
|
431
|
+
return M(L(e)).left + _e(e).scrollLeft;
|
|
432
|
+
}
|
|
433
|
+
function ve(e, t) {
|
|
434
|
+
var n = y(e), r = L(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
|
|
435
|
+
if (i) {
|
|
436
|
+
a = i.width, o = i.height;
|
|
437
|
+
var l = j();
|
|
438
|
+
(l || !l && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
|
|
439
|
+
}
|
|
440
|
+
return {
|
|
441
|
+
width: a,
|
|
442
|
+
height: o,
|
|
443
|
+
x: s + J(e),
|
|
444
|
+
y: c
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
function ye(e) {
|
|
448
|
+
var t = L(e), n = _e(e), r = e.ownerDocument?.body, i = D(t.scrollWidth, t.clientWidth, r ? r.scrollWidth : 0, r ? r.clientWidth : 0), a = D(t.scrollHeight, t.clientHeight, r ? r.scrollHeight : 0, r ? r.clientHeight : 0), o = -n.scrollLeft + J(e), s = -n.scrollTop;
|
|
449
|
+
return F(r || t).direction === "rtl" && (o += D(t.clientWidth, r ? r.clientWidth : 0) - i), {
|
|
450
|
+
width: i,
|
|
451
|
+
height: a,
|
|
452
|
+
x: o,
|
|
453
|
+
y: s
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
function Y(e) {
|
|
457
|
+
var t = F(e), n = t.overflow, r = t.overflowX, i = t.overflowY;
|
|
458
|
+
return /auto|scroll|overlay|hidden/.test(n + i + r);
|
|
459
|
+
}
|
|
460
|
+
function X(e) {
|
|
461
|
+
return [
|
|
462
|
+
"html",
|
|
463
|
+
"body",
|
|
464
|
+
"#document"
|
|
465
|
+
].indexOf(v(e)) >= 0 ? e.ownerDocument.body : x(e) && Y(e) ? e : X(R(e));
|
|
466
|
+
}
|
|
467
|
+
function Z(e, t) {
|
|
468
|
+
t === void 0 && (t = []);
|
|
469
|
+
var n = X(e), r = n === e.ownerDocument?.body, i = y(n), a = r ? [i].concat(i.visualViewport || [], Y(n) ? n : []) : n, o = t.concat(a);
|
|
470
|
+
return r ? o : o.concat(Z(R(a)));
|
|
471
|
+
}
|
|
472
|
+
function Q(e) {
|
|
473
|
+
return Object.assign({}, e, {
|
|
474
|
+
left: e.x,
|
|
475
|
+
top: e.y,
|
|
476
|
+
right: e.x + e.width,
|
|
477
|
+
bottom: e.y + e.height
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
function be(e, t) {
|
|
481
|
+
var n = M(e, !1, t === "fixed");
|
|
482
|
+
return n.top += e.clientTop, n.left += e.clientLeft, n.bottom = n.top + e.clientHeight, n.right = n.left + e.clientWidth, n.width = e.clientWidth, n.height = e.clientHeight, n.x = n.left, n.y = n.top, n;
|
|
483
|
+
}
|
|
484
|
+
function xe(e, t, n) {
|
|
485
|
+
return t === f ? Q(ve(e, n)) : b(t) ? be(t, n) : Q(ye(L(e)));
|
|
486
|
+
}
|
|
487
|
+
function Se(e) {
|
|
488
|
+
var t = Z(R(e)), n = ["absolute", "fixed"].indexOf(F(e).position) >= 0 && x(e) ? V(e) : e;
|
|
489
|
+
return b(n) ? t.filter(function(e) {
|
|
490
|
+
return b(e) && P(e, n) && v(e) !== "body";
|
|
491
|
+
}) : [];
|
|
492
|
+
}
|
|
493
|
+
function Ce(e, t, n, r) {
|
|
494
|
+
var i = t === "clippingParents" ? Se(e) : [].concat(t), a = [].concat(i, [n]), o = a[0], s = a.reduce(function(t, n) {
|
|
495
|
+
var i = xe(e, n, r);
|
|
496
|
+
return t.top = D(i.top, t.top), t.right = O(i.right, t.right), t.bottom = O(i.bottom, t.bottom), t.left = D(i.left, t.left), t;
|
|
497
|
+
}, xe(e, o, r));
|
|
498
|
+
return s.width = s.right - s.left, s.height = s.bottom - s.top, s.x = s.left, s.y = s.top, s;
|
|
499
|
+
}
|
|
500
|
+
function we(e) {
|
|
501
|
+
var t = e.reference, n = e.element, s = e.placement, c = s ? E(s) : null, d = s ? W(s) : null, f = t.x + t.width / 2 - n.width / 2, p = t.y + t.height / 2 - n.height / 2, m;
|
|
502
|
+
switch (c) {
|
|
503
|
+
case r:
|
|
504
|
+
m = {
|
|
505
|
+
x: f,
|
|
506
|
+
y: t.y - n.height
|
|
507
|
+
};
|
|
508
|
+
break;
|
|
509
|
+
case i:
|
|
510
|
+
m = {
|
|
511
|
+
x: f,
|
|
512
|
+
y: t.y + t.height
|
|
513
|
+
};
|
|
514
|
+
break;
|
|
515
|
+
case a:
|
|
516
|
+
m = {
|
|
517
|
+
x: t.x + t.width,
|
|
518
|
+
y: p
|
|
519
|
+
};
|
|
520
|
+
break;
|
|
521
|
+
case o:
|
|
522
|
+
m = {
|
|
523
|
+
x: t.x - n.width,
|
|
524
|
+
y: p
|
|
525
|
+
};
|
|
526
|
+
break;
|
|
527
|
+
default: m = {
|
|
528
|
+
x: t.x,
|
|
529
|
+
y: t.y
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
var h = c ? ee(c) : null;
|
|
533
|
+
if (h != null) {
|
|
534
|
+
var g = h === "y" ? "height" : "width";
|
|
535
|
+
switch (d) {
|
|
536
|
+
case l:
|
|
537
|
+
m[h] = m[h] - (t[g] / 2 - n[g] / 2);
|
|
538
|
+
break;
|
|
539
|
+
case u:
|
|
540
|
+
m[h] = m[h] + (t[g] / 2 - n[g] / 2);
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return m;
|
|
545
|
+
}
|
|
546
|
+
function $(e, t) {
|
|
547
|
+
t === void 0 && (t = {});
|
|
548
|
+
var n = t, o = n.placement, s = o === void 0 ? e.placement : o, l = n.strategy, u = l === void 0 ? e.strategy : l, h = n.boundary, g = h === void 0 ? d : h, _ = n.rootBoundary, v = _ === void 0 ? f : _, y = n.elementContext, x = y === void 0 ? p : y, S = n.altBoundary, C = S === void 0 ? !1 : S, w = n.padding, T = w === void 0 ? 0 : w, E = U(typeof T == "number" ? re(T, c) : T), D = x === p ? m : p, O = e.rects.popper, k = e.elements[C ? D : x], A = Ce(b(k) ? k : k.contextElement || L(e.elements.popper), g, v, u), j = M(e.elements.reference), N = we({
|
|
549
|
+
reference: j,
|
|
550
|
+
element: O,
|
|
551
|
+
strategy: "absolute",
|
|
552
|
+
placement: s
|
|
553
|
+
}), P = Q(Object.assign({}, O, N)), F = x === p ? P : j, I = {
|
|
554
|
+
top: A.top - F.top + E.top,
|
|
555
|
+
bottom: F.bottom - A.bottom + E.bottom,
|
|
556
|
+
left: A.left - F.left + E.left,
|
|
557
|
+
right: F.right - A.right + E.right
|
|
558
|
+
}, R = e.modifiersData.offset;
|
|
559
|
+
if (x === p && R) {
|
|
560
|
+
var z = R[s];
|
|
561
|
+
Object.keys(I).forEach(function(e) {
|
|
562
|
+
var t = [a, i].indexOf(e) >= 0 ? 1 : -1, n = [r, i].indexOf(e) >= 0 ? "y" : "x";
|
|
563
|
+
I[e] += z[n] * t;
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
return I;
|
|
567
|
+
}
|
|
568
|
+
function Te(e, t) {
|
|
569
|
+
t === void 0 && (t = {});
|
|
570
|
+
var n = t, r = n.placement, i = n.boundary, a = n.rootBoundary, o = n.padding, s = n.flipVariations, l = n.allowedAutoPlacements, u = l === void 0 ? g : l, d = W(r), f = d ? s ? h : h.filter(function(e) {
|
|
571
|
+
return W(e) === d;
|
|
572
|
+
}) : c, p = f.filter(function(e) {
|
|
573
|
+
return u.indexOf(e) >= 0;
|
|
574
|
+
});
|
|
575
|
+
p.length === 0 && (p = f);
|
|
576
|
+
var m = p.reduce(function(t, n) {
|
|
577
|
+
return t[n] = $(e, {
|
|
578
|
+
placement: n,
|
|
579
|
+
boundary: i,
|
|
580
|
+
rootBoundary: a,
|
|
581
|
+
padding: o
|
|
582
|
+
})[E(n)], t;
|
|
583
|
+
}, {});
|
|
584
|
+
return Object.keys(m).sort(function(e, t) {
|
|
585
|
+
return m[e] - m[t];
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
function Ee(e) {
|
|
589
|
+
if (E(e) === s) return [];
|
|
590
|
+
var t = q(e);
|
|
591
|
+
return [
|
|
592
|
+
ge(e),
|
|
593
|
+
t,
|
|
594
|
+
ge(t)
|
|
595
|
+
];
|
|
596
|
+
}
|
|
597
|
+
function De(e) {
|
|
598
|
+
var t = e.state, n = e.options, c = e.name;
|
|
599
|
+
if (!t.modifiersData[c]._skip) {
|
|
600
|
+
for (var u = n.mainAxis, d = u === void 0 ? !0 : u, f = n.altAxis, p = f === void 0 ? !0 : f, m = n.fallbackPlacements, h = n.padding, g = n.boundary, _ = n.rootBoundary, v = n.altBoundary, y = n.flipVariations, b = y === void 0 ? !0 : y, x = n.allowedAutoPlacements, S = t.options.placement, C = E(S) === S, w = m || (C || !b ? [q(S)] : Ee(S)), T = [S].concat(w).reduce(function(e, n) {
|
|
601
|
+
return e.concat(E(n) === s ? Te(t, {
|
|
602
|
+
placement: n,
|
|
603
|
+
boundary: g,
|
|
604
|
+
rootBoundary: _,
|
|
605
|
+
padding: h,
|
|
606
|
+
flipVariations: b,
|
|
607
|
+
allowedAutoPlacements: x
|
|
608
|
+
}) : n);
|
|
609
|
+
}, []), D = t.rects.reference, O = t.rects.popper, k = /* @__PURE__ */ new Map(), A = !0, j = T[0], M = 0; M < T.length; M++) {
|
|
610
|
+
var N = T[M], P = E(N), F = W(N) === l, I = [r, i].indexOf(P) >= 0, L = I ? "width" : "height", R = $(t, {
|
|
611
|
+
placement: N,
|
|
612
|
+
boundary: g,
|
|
613
|
+
rootBoundary: _,
|
|
614
|
+
altBoundary: v,
|
|
615
|
+
padding: h
|
|
616
|
+
}), z = I ? F ? a : o : F ? i : r;
|
|
617
|
+
D[L] > O[L] && (z = q(z));
|
|
618
|
+
var B = q(z), V = [];
|
|
619
|
+
if (d && V.push(R[P] <= 0), p && V.push(R[z] <= 0, R[B] <= 0), V.every(function(e) {
|
|
620
|
+
return e;
|
|
621
|
+
})) {
|
|
622
|
+
j = N, A = !1;
|
|
623
|
+
break;
|
|
624
|
+
}
|
|
625
|
+
k.set(N, V);
|
|
626
|
+
}
|
|
627
|
+
if (A) for (var ee = b ? 3 : 1, H = function(e) {
|
|
628
|
+
var t = T.find(function(t) {
|
|
629
|
+
var n = k.get(t);
|
|
630
|
+
if (n) return n.slice(0, e).every(function(e) {
|
|
631
|
+
return e;
|
|
632
|
+
});
|
|
633
|
+
});
|
|
634
|
+
if (t) return j = t, "break";
|
|
635
|
+
}, te = ee; te > 0 && H(te) !== "break"; te--);
|
|
636
|
+
t.placement !== j && (t.modifiersData[c]._skip = !0, t.placement = j, t.reset = !0);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
var Oe = {
|
|
640
|
+
name: "flip",
|
|
641
|
+
enabled: !0,
|
|
642
|
+
phase: "main",
|
|
643
|
+
fn: De,
|
|
644
|
+
requiresIfExists: ["offset"],
|
|
645
|
+
data: { _skip: !1 }
|
|
646
|
+
};
|
|
647
|
+
function ke(e, t, n) {
|
|
648
|
+
return n === void 0 && (n = {
|
|
649
|
+
x: 0,
|
|
650
|
+
y: 0
|
|
651
|
+
}), {
|
|
652
|
+
top: e.top - t.height - n.y,
|
|
653
|
+
right: e.right - t.width + n.x,
|
|
654
|
+
bottom: e.bottom - t.height + n.y,
|
|
655
|
+
left: e.left - t.width - n.x
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
function Ae(e) {
|
|
659
|
+
return [
|
|
660
|
+
r,
|
|
661
|
+
a,
|
|
662
|
+
i,
|
|
663
|
+
o
|
|
664
|
+
].some(function(t) {
|
|
665
|
+
return e[t] >= 0;
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
function je(e) {
|
|
669
|
+
var t = e.state, n = e.name, r = t.rects.reference, i = t.rects.popper, a = t.modifiersData.preventOverflow, o = $(t, { elementContext: "reference" }), s = $(t, { altBoundary: !0 }), c = ke(o, r), l = ke(s, i, a), u = Ae(c), d = Ae(l);
|
|
670
|
+
t.modifiersData[n] = {
|
|
671
|
+
referenceClippingOffsets: c,
|
|
672
|
+
popperEscapeOffsets: l,
|
|
673
|
+
isReferenceHidden: u,
|
|
674
|
+
hasPopperEscaped: d
|
|
675
|
+
}, t.attributes.popper = Object.assign({}, t.attributes.popper, {
|
|
676
|
+
"data-popper-reference-hidden": u,
|
|
677
|
+
"data-popper-escaped": d
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
var Me = {
|
|
681
|
+
name: "hide",
|
|
682
|
+
enabled: !0,
|
|
683
|
+
phase: "main",
|
|
684
|
+
requiresIfExists: ["preventOverflow"],
|
|
685
|
+
fn: je
|
|
686
|
+
};
|
|
687
|
+
function Ne(e, t, n) {
|
|
688
|
+
var i = E(e), s = [o, r].indexOf(i) >= 0 ? -1 : 1, c = typeof n == "function" ? n(Object.assign({}, t, { placement: e })) : n, l = c[0], u = c[1];
|
|
689
|
+
return l ||= 0, u = (u || 0) * s, [o, a].indexOf(i) >= 0 ? {
|
|
690
|
+
x: u,
|
|
691
|
+
y: l
|
|
692
|
+
} : {
|
|
693
|
+
x: l,
|
|
694
|
+
y: u
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
function Pe(e) {
|
|
698
|
+
var t = e.state, n = e.options, r = e.name, i = n.offset, a = i === void 0 ? [0, 0] : i, o = g.reduce(function(e, n) {
|
|
699
|
+
return e[n] = Ne(n, t.rects, a), e;
|
|
700
|
+
}, {}), s = o[t.placement], c = s.x, l = s.y;
|
|
701
|
+
t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += c, t.modifiersData.popperOffsets.y += l), t.modifiersData[r] = o;
|
|
702
|
+
}
|
|
703
|
+
var Fe = {
|
|
704
|
+
name: "offset",
|
|
705
|
+
enabled: !0,
|
|
706
|
+
phase: "main",
|
|
707
|
+
requires: ["popperOffsets"],
|
|
708
|
+
fn: Pe
|
|
709
|
+
};
|
|
710
|
+
function Ie(e) {
|
|
711
|
+
var t = e.state, n = e.name;
|
|
712
|
+
t.modifiersData[n] = we({
|
|
713
|
+
reference: t.rects.reference,
|
|
714
|
+
element: t.rects.popper,
|
|
715
|
+
strategy: "absolute",
|
|
716
|
+
placement: t.placement
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
var Le = {
|
|
720
|
+
name: "popperOffsets",
|
|
721
|
+
enabled: !0,
|
|
722
|
+
phase: "read",
|
|
723
|
+
fn: Ie,
|
|
724
|
+
data: {}
|
|
725
|
+
};
|
|
726
|
+
function Re(e) {
|
|
727
|
+
return e === "x" ? "y" : "x";
|
|
728
|
+
}
|
|
729
|
+
function ze(e) {
|
|
730
|
+
var t = e.state, n = e.options, s = e.name, c = n.mainAxis, u = c === void 0 ? !0 : c, d = n.altAxis, f = d === void 0 ? !1 : d, p = n.boundary, m = n.rootBoundary, h = n.altBoundary, g = n.padding, _ = n.tether, v = _ === void 0 ? !0 : _, y = n.tetherOffset, b = y === void 0 ? 0 : y, x = $(t, {
|
|
731
|
+
boundary: p,
|
|
732
|
+
rootBoundary: m,
|
|
733
|
+
padding: g,
|
|
734
|
+
altBoundary: h
|
|
735
|
+
}), S = E(t.placement), C = W(t.placement), w = !C, T = ee(S), k = Re(T), A = t.modifiersData.popperOffsets, j = t.rects.reference, M = t.rects.popper, P = typeof b == "function" ? b(Object.assign({}, t.rects, { placement: t.placement })) : b, F = typeof P == "number" ? {
|
|
736
|
+
mainAxis: P,
|
|
737
|
+
altAxis: P
|
|
738
|
+
} : Object.assign({
|
|
739
|
+
mainAxis: 0,
|
|
740
|
+
altAxis: 0
|
|
741
|
+
}, P), I = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, L = {
|
|
742
|
+
x: 0,
|
|
743
|
+
y: 0
|
|
744
|
+
};
|
|
745
|
+
if (A) {
|
|
746
|
+
if (u) {
|
|
747
|
+
var R = T === "y" ? r : o, z = T === "y" ? i : a, B = T === "y" ? "height" : "width", U = A[T], re = U + x[R], ie = U - x[z], ae = v ? -M[B] / 2 : 0, oe = C === l ? j[B] : M[B], se = C === l ? -M[B] : -j[B], ce = t.elements.arrow, le = v && ce ? N(ce) : {
|
|
748
|
+
width: 0,
|
|
749
|
+
height: 0
|
|
750
|
+
}, ue = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : ne(), de = ue[R], fe = ue[z], G = H(0, j[B], le[B]), pe = w ? j[B] / 2 - ae - G - de - F.mainAxis : oe - G - de - F.mainAxis, me = w ? -j[B] / 2 + ae + G + fe + F.mainAxis : se + G + fe + F.mainAxis, K = t.elements.arrow && V(t.elements.arrow), q = K ? T === "y" ? K.clientTop || 0 : K.clientLeft || 0 : 0, he = I?.[T] ?? 0, ge = U + pe - he - q, _e = U + me - he, J = H(v ? O(re, ge) : re, U, v ? D(ie, _e) : ie);
|
|
751
|
+
A[T] = J, L[T] = J - U;
|
|
752
|
+
}
|
|
753
|
+
if (f) {
|
|
754
|
+
var ve = T === "x" ? r : o, ye = T === "x" ? i : a, Y = A[k], X = k === "y" ? "height" : "width", Z = Y + x[ve], Q = Y - x[ye], be = [r, o].indexOf(S) !== -1, xe = I?.[k] ?? 0, Se = be ? Z : Y - j[X] - M[X] - xe + F.altAxis, Ce = be ? Y + j[X] + M[X] - xe - F.altAxis : Q, we = v && be ? te(Se, Y, Ce) : H(v ? Se : Z, Y, v ? Ce : Q);
|
|
755
|
+
A[k] = we, L[k] = we - Y;
|
|
756
|
+
}
|
|
757
|
+
t.modifiersData[s] = L;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
var Be = {
|
|
761
|
+
name: "preventOverflow",
|
|
762
|
+
enabled: !0,
|
|
763
|
+
phase: "main",
|
|
764
|
+
fn: ze,
|
|
765
|
+
requiresIfExists: ["offset"]
|
|
766
|
+
};
|
|
767
|
+
function Ve(e) {
|
|
768
|
+
return {
|
|
769
|
+
scrollLeft: e.scrollLeft,
|
|
770
|
+
scrollTop: e.scrollTop
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
function He(e) {
|
|
774
|
+
return e === y(e) || !x(e) ? _e(e) : Ve(e);
|
|
775
|
+
}
|
|
776
|
+
function Ue(e) {
|
|
777
|
+
var t = e.getBoundingClientRect(), n = k(t.width) / e.offsetWidth || 1, r = k(t.height) / e.offsetHeight || 1;
|
|
778
|
+
return n !== 1 || r !== 1;
|
|
779
|
+
}
|
|
780
|
+
function We(e, t, n) {
|
|
781
|
+
n === void 0 && (n = !1);
|
|
782
|
+
var r = x(t), i = x(t) && Ue(t), a = L(t), o = M(e, i, n), s = {
|
|
783
|
+
scrollLeft: 0,
|
|
784
|
+
scrollTop: 0
|
|
785
|
+
}, c = {
|
|
786
|
+
x: 0,
|
|
787
|
+
y: 0
|
|
788
|
+
};
|
|
789
|
+
return (r || !r && !n) && ((v(t) !== "body" || Y(a)) && (s = He(t)), x(t) ? (c = M(t, !0), c.x += t.clientLeft, c.y += t.clientTop) : a && (c.x = J(a))), {
|
|
790
|
+
x: o.left + s.scrollLeft - c.x,
|
|
791
|
+
y: o.top + s.scrollTop - c.y,
|
|
792
|
+
width: o.width,
|
|
793
|
+
height: o.height
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
function Ge(e) {
|
|
797
|
+
var t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = [];
|
|
798
|
+
e.forEach(function(e) {
|
|
799
|
+
t.set(e.name, e);
|
|
800
|
+
});
|
|
801
|
+
function i(e) {
|
|
802
|
+
n.add(e.name), [].concat(e.requires || [], e.requiresIfExists || []).forEach(function(e) {
|
|
803
|
+
if (!n.has(e)) {
|
|
804
|
+
var r = t.get(e);
|
|
805
|
+
r && i(r);
|
|
806
|
+
}
|
|
807
|
+
}), r.push(e);
|
|
808
|
+
}
|
|
809
|
+
return e.forEach(function(e) {
|
|
810
|
+
n.has(e.name) || i(e);
|
|
811
|
+
}), r;
|
|
812
|
+
}
|
|
813
|
+
function Ke(e) {
|
|
814
|
+
var t = Ge(e);
|
|
815
|
+
return _.reduce(function(e, n) {
|
|
816
|
+
return e.concat(t.filter(function(e) {
|
|
817
|
+
return e.phase === n;
|
|
818
|
+
}));
|
|
819
|
+
}, []);
|
|
820
|
+
}
|
|
821
|
+
function qe(e) {
|
|
822
|
+
var t;
|
|
823
|
+
return function() {
|
|
824
|
+
return t ||= new Promise(function(n) {
|
|
825
|
+
Promise.resolve().then(function() {
|
|
826
|
+
t = void 0, n(e());
|
|
827
|
+
});
|
|
828
|
+
}), t;
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
function Je(e) {
|
|
832
|
+
var t = e.reduce(function(e, t) {
|
|
833
|
+
var n = e[t.name];
|
|
834
|
+
return e[t.name] = n ? Object.assign({}, n, t, {
|
|
835
|
+
options: Object.assign({}, n.options, t.options),
|
|
836
|
+
data: Object.assign({}, n.data, t.data)
|
|
837
|
+
}) : t, e;
|
|
838
|
+
}, {});
|
|
839
|
+
return Object.keys(t).map(function(e) {
|
|
840
|
+
return t[e];
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
var Ye = {
|
|
844
|
+
placement: "bottom",
|
|
845
|
+
modifiers: [],
|
|
846
|
+
strategy: "absolute"
|
|
847
|
+
};
|
|
848
|
+
function Xe() {
|
|
849
|
+
return ![...arguments].some(function(e) {
|
|
850
|
+
return !(e && typeof e.getBoundingClientRect == "function");
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
function Ze(e) {
|
|
854
|
+
e === void 0 && (e = {});
|
|
855
|
+
var t = e, n = t.defaultModifiers, r = n === void 0 ? [] : n, i = t.defaultOptions, a = i === void 0 ? Ye : i;
|
|
856
|
+
return function(e, t, n) {
|
|
857
|
+
n === void 0 && (n = a);
|
|
858
|
+
var i = {
|
|
859
|
+
placement: "bottom",
|
|
860
|
+
orderedModifiers: [],
|
|
861
|
+
options: Object.assign({}, Ye, a),
|
|
862
|
+
modifiersData: {},
|
|
863
|
+
elements: {
|
|
864
|
+
reference: e,
|
|
865
|
+
popper: t
|
|
866
|
+
},
|
|
867
|
+
attributes: {},
|
|
868
|
+
styles: {}
|
|
869
|
+
}, o = [], s = !1, c = {
|
|
870
|
+
state: i,
|
|
871
|
+
setOptions: function(n) {
|
|
872
|
+
var o = typeof n == "function" ? n(i.options) : n;
|
|
873
|
+
u(), i.options = Object.assign({}, a, i.options, o), i.scrollParents = {
|
|
874
|
+
reference: b(e) ? Z(e) : e.contextElement ? Z(e.contextElement) : [],
|
|
875
|
+
popper: Z(t)
|
|
876
|
+
};
|
|
877
|
+
var s = Ke(Je([].concat(r, i.options.modifiers)));
|
|
878
|
+
return i.orderedModifiers = s.filter(function(e) {
|
|
879
|
+
return e.enabled;
|
|
880
|
+
}), l(), c.update();
|
|
881
|
+
},
|
|
882
|
+
forceUpdate: function() {
|
|
883
|
+
if (!s) {
|
|
884
|
+
var e = i.elements, t = e.reference, n = e.popper;
|
|
885
|
+
if (Xe(t, n)) {
|
|
886
|
+
i.rects = {
|
|
887
|
+
reference: We(t, V(n), i.options.strategy === "fixed"),
|
|
888
|
+
popper: N(n)
|
|
889
|
+
}, i.reset = !1, i.placement = i.options.placement, i.orderedModifiers.forEach(function(e) {
|
|
890
|
+
return i.modifiersData[e.name] = Object.assign({}, e.data);
|
|
891
|
+
});
|
|
892
|
+
for (var r = 0; r < i.orderedModifiers.length; r++) {
|
|
893
|
+
if (i.reset === !0) {
|
|
894
|
+
i.reset = !1, r = -1;
|
|
895
|
+
continue;
|
|
896
|
+
}
|
|
897
|
+
var a = i.orderedModifiers[r], o = a.fn, l = a.options, u = l === void 0 ? {} : l, d = a.name;
|
|
898
|
+
typeof o == "function" && (i = o({
|
|
899
|
+
state: i,
|
|
900
|
+
options: u,
|
|
901
|
+
name: d,
|
|
902
|
+
instance: c
|
|
903
|
+
}) || i);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
update: qe(function() {
|
|
909
|
+
return new Promise(function(e) {
|
|
910
|
+
c.forceUpdate(), e(i);
|
|
911
|
+
});
|
|
912
|
+
}),
|
|
913
|
+
destroy: function() {
|
|
914
|
+
u(), s = !0;
|
|
915
|
+
}
|
|
916
|
+
};
|
|
917
|
+
if (!Xe(e, t)) return c;
|
|
918
|
+
c.setOptions(n).then(function(e) {
|
|
919
|
+
!s && n.onFirstUpdate && n.onFirstUpdate(e);
|
|
920
|
+
});
|
|
921
|
+
function l() {
|
|
922
|
+
i.orderedModifiers.forEach(function(e) {
|
|
923
|
+
var t = e.name, n = e.options, r = n === void 0 ? {} : n, a = e.effect;
|
|
924
|
+
if (typeof a == "function") {
|
|
925
|
+
var s = a({
|
|
926
|
+
state: i,
|
|
927
|
+
name: t,
|
|
928
|
+
instance: c,
|
|
929
|
+
options: r
|
|
930
|
+
});
|
|
931
|
+
o.push(s || function() {});
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
function u() {
|
|
936
|
+
o.forEach(function(e) {
|
|
937
|
+
return e();
|
|
938
|
+
}), o = [];
|
|
939
|
+
}
|
|
940
|
+
return c;
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
Ze();
|
|
944
|
+
var Qe = Ze({ defaultModifiers: [
|
|
945
|
+
me,
|
|
946
|
+
Le,
|
|
947
|
+
fe,
|
|
948
|
+
T,
|
|
949
|
+
Fe,
|
|
950
|
+
Oe,
|
|
951
|
+
Be,
|
|
952
|
+
se,
|
|
953
|
+
Me
|
|
954
|
+
] }), $e = (e) => Object.prototype.toString.call(e) === "[object String]", et = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, tt = (e, t) => et(e) ? (Object.keys(t).forEach((n) => e[n] = et(t[n]) ? tt(e[n] || {}, t[n]) : t[n]), e) : t;
|
|
955
|
+
function nt(e, { target: t = "#placekit", ...r } = {}) {
|
|
956
|
+
let i = $e(t) ? document.querySelector(t) : t;
|
|
957
|
+
if (!i) throw "Error: target not found.";
|
|
958
|
+
if (i.tagName !== "INPUT" || !["text", "search"].includes(i.getAttribute("type"))) throw "Error: target must be an HTML input of type \"text\" or \"search\".";
|
|
959
|
+
let a = n(e), o = /* @__PURE__ */ new Map(), s = [], c = null, l = null, u = null, d = !1, f = {}, p = {
|
|
960
|
+
empty: !i.value,
|
|
961
|
+
dirty: !1,
|
|
962
|
+
freeForm: !0,
|
|
963
|
+
geolocation: !1,
|
|
964
|
+
countryMode: !1
|
|
965
|
+
}, m = {
|
|
966
|
+
panel: {
|
|
967
|
+
className: "",
|
|
968
|
+
offset: 4,
|
|
969
|
+
strategy: "absolute",
|
|
970
|
+
flip: !1
|
|
971
|
+
},
|
|
972
|
+
format: {
|
|
973
|
+
flag: (e) => `<img class="pka-flag" src="https://flagcdn.com/64x48/${e?.toLowerCase()}.png" alt="${e}" loading="lazy" />`,
|
|
974
|
+
icon: (e, t) => `<span class="pka-icon pka-icon-${e}" role="img" aria-label="${t || "icon"}"></span>`,
|
|
975
|
+
sub: (e) => {
|
|
976
|
+
switch (e.type) {
|
|
977
|
+
case "administrative": return [e.country].filter((e) => e).join(" ");
|
|
978
|
+
case "city": return [e.zipcode.sort()[0], e.country].filter((e) => e).join(" ");
|
|
979
|
+
case "country": return "";
|
|
980
|
+
case "county": return [e.administrative, e.country].filter((e) => e).join(" ");
|
|
981
|
+
default: return [e.city, e.county].filter((e) => e).join(", ");
|
|
982
|
+
}
|
|
983
|
+
},
|
|
984
|
+
noResults: (e) => `No results for ${e}`,
|
|
985
|
+
value: (e) => e.name,
|
|
986
|
+
applySuggestion: "Apply suggestion",
|
|
987
|
+
suggestions: "Address suggestions",
|
|
988
|
+
changeCountry: "Change country",
|
|
989
|
+
cancel: "Cancel"
|
|
990
|
+
},
|
|
991
|
+
countryAutoFill: !0,
|
|
992
|
+
countrySelect: !0
|
|
993
|
+
};
|
|
994
|
+
i.setAttribute("autocomplete", "off"), i.setAttribute("aria-autocomplete", "list"), i.setAttribute("aria-expanded", !1), i.setAttribute("role", "combobox");
|
|
995
|
+
let h = document.createElement("div");
|
|
996
|
+
h.classList.add("pka-panel"), h.innerHTML = `
|
|
997
|
+
<div class="pka-panel-loading" role="progressbar" aria-hidden="true">${m.format.icon("loading")}</div>
|
|
998
|
+
<div class="pka-panel-suggestions" role="listbox" aria-label="${m.format.suggestions}"></div>
|
|
999
|
+
<div class="pka-panel-footer">
|
|
1000
|
+
<div class="pka-panel-country">
|
|
1001
|
+
<input type="checkbox" id="pka-panel-country-mode" class="pka-sr-only" />
|
|
1002
|
+
<label for="pka-panel-country-mode" class="pka-panel-country-open" aria-label="${m.format.changeCountry}">
|
|
1003
|
+
</label>
|
|
1004
|
+
<label for="pka-panel-country-mode" class="pka-panel-country-close">
|
|
1005
|
+
${m.format.icon("cancel")}
|
|
1006
|
+
<span class="pka-panel-country-label">${m.format.cancel}</span>
|
|
1007
|
+
</label>
|
|
1008
|
+
</div>
|
|
1009
|
+
<div class="pka-panel-credits">
|
|
1010
|
+
<span class="pka-panel-credits-text">Powered by</span>
|
|
1011
|
+
<a href="https://placekit.io/?utm_source=${encodeURI(window.location.hostname)}" target="_blank" class="pka-panel-credits-link" aria-label="PlaceKit.io">
|
|
1012
|
+
<svg viewBox="0 0 98 24" fill-rule="evenodd" fill="currentColor" height="14">
|
|
1013
|
+
<path d="M10.618 20.336a.506.506 0 0 1 .558-.414 8.009 8.009 0 0 0 1.867 0 .506.506 0 0 1 .557.414l.177 1a.504.504 0 0 1-.435.59 10.227 10.227 0 0 1-2.465 0 .51.51 0 0 1-.434-.59l.175-1Zm-6.577-5.521a.506.506 0 0 1 .639.28 8.12 8.12 0 0 0 2.971 3.542.504.504 0 0 1 .164.675c-.152.268-.35.612-.507.884a.508.508 0 0 1-.71.174 10.181 10.181 0 0 1-3.807-4.539.502.502 0 0 1 .293-.665c.294-.109.667-.245.957-.351Zm15.5.281a.504.504 0 0 1 .637-.278c.29.103.664.239.958.346a.503.503 0 0 1 .295.668 10.19 10.19 0 0 1-3.811 4.536.5.5 0 0 1-.707-.174c-.158-.27-.357-.614-.511-.88a.508.508 0 0 1 .165-.679 8.107 8.107 0 0 0 2.974-3.539Zm-11.003-.391-.008-.007a5.064 5.064 0 0 1 0-7.158 5.064 5.064 0 0 1 7.158 0 5.064 5.064 0 0 1 .001 7.157l.006.007-2.863 2.864a1.013 1.013 0 0 1-1.432 0l-2.862-2.863Zm3.575-5.601a2.015 2.015 0 0 1 0 4.028 2.015 2.015 0 0 1 0-4.028Zm9.023-.511a.507.507 0 0 1 .656.324c.236.775.382 1.591.426 2.433a.504.504 0 0 1-.505.527c-.312.002-.709.002-1.016.002a.507.507 0 0 1-.505-.481 7.986 7.986 0 0 0-.321-1.833.505.505 0 0 1 .31-.623l.955-.349Zm-18.707.324a.505.505 0 0 1 .654-.323c.295.106.667.242.956.347.253.092.39.367.311.624a7.988 7.988 0 0 0-.323 1.833.505.505 0 0 1-.504.479c-.308.002-.704.002-1.017.002a.508.508 0 0 1-.505-.529c.044-.842.191-1.658.428-2.433Zm11.349-6.499a.504.504 0 0 1 .607-.406 10.143 10.143 0 0 1 5.128 2.967.507.507 0 0 1-.049.726c-.238.203-.542.458-.778.656a.506.506 0 0 1-.697-.045 8.071 8.071 0 0 0-4.001-2.315.504.504 0 0 1-.385-.579c.051-.304.12-.695.175-1.004Zm-3.942-.404a.502.502 0 0 1 .604.405c.056.308.125.699.179 1.003a.506.506 0 0 1-.387.581 8.07 8.07 0 0 0-4.003 2.312.504.504 0 0 1-.694.044c-.237-.196-.541-.451-.781-.653a.506.506 0 0 1-.049-.728 10.136 10.136 0 0 1 5.131-2.964Z" />
|
|
1014
|
+
<path d="M30.315 20.5v-5.028c.597.868 1.483 1.321 2.55 1.321 2.496 0 4.087-1.845 4.087-5.137 0-3.165-1.555-5.1-4.087-5.1-1.067 0-1.935.489-2.55 1.375V6.828H28V20.5h2.315Zm61.146-6.999c0 2.17.94 3.292 2.911 3.292.633 0 1.158-.109 1.411-.236v-1.7h-.434c-1.284 0-1.573-.542-1.573-1.555V8.618h2.043v-1.79h-2.043V4.603h-2.315v2.225h-1.248v1.79h1.248v4.883Zm-28.412-3.237c-.326-2.478-2.062-3.708-4.268-3.708-2.785 0-4.576 1.845-4.576 5.137 0 3.146 1.736 5.1 4.594 5.1 2.188 0 3.888-1.14 4.322-3.563h-2.333c-.235 1.103-.94 1.646-1.935 1.646-1.465 0-2.26-1.14-2.26-3.183 0-2.08.759-3.22 2.188-3.22.976 0 1.736.525 1.953 1.791h2.315Zm-17.018-.253c.145-.923.741-1.538 1.845-1.538 1.284 0 1.88.67 1.88 1.917v.236c-1.627.018-2.875.126-4.159.56-1.483.488-2.225 1.483-2.225 2.803 0 1.863 1.357 2.804 3.256 2.804 1.157 0 2.351-.471 3.146-1.592.019.525.073.995.199 1.32h2.406c-.181-.506-.29-1.175-.29-2.369V10.39c0-2.242-1.374-3.834-4.069-3.834-2.441 0-4.015 1.303-4.322 3.455h2.333Zm27.905 3.345h-2.441c-.308 1.031-1.049 1.538-2.134 1.538-1.411 0-2.225-.977-2.333-2.749h6.836v-.543c0-3.129-1.754-5.046-4.594-5.046-2.821 0-4.63 1.845-4.63 5.137 0 3.164 1.791 5.1 4.721 5.1 2.315 0 4.051-1.194 4.575-3.437Zm12.425 3.165h2.315V6.828h-2.315v9.693Zm-47.365 0h2.315V3.5h-2.315v13.021Zm36.966 0h2.315v-4.684l3.653 4.684h2.839l-4.178-5.389 3.907-4.304h-2.713l-3.508 4.051V3.5h-2.315v13.021Zm-30.257-2.658c0-.977.76-1.754 4.051-1.809v.416c0 1.447-1.103 2.604-2.532 2.604-.94 0-1.519-.47-1.519-1.211Zm-13.256-5.39c1.356 0 2.116 1.14 2.116 3.183 0 2.08-.742 3.22-2.116 3.22-1.356 0-2.134-1.158-2.134-3.22 0-2.061.741-3.183 2.134-3.183Zm36.821-.018c1.212 0 1.953.796 2.17 2.243h-4.358c.217-1.465.958-2.243 2.188-2.243Zm17.091-2.712h2.315V3.5h-2.315v2.243Z" />
|
|
1015
|
+
</svg>
|
|
1016
|
+
</a>
|
|
1017
|
+
</div>
|
|
1018
|
+
</div>
|
|
1019
|
+
`, document.body.append(h);
|
|
1020
|
+
let g = h.querySelector(".pka-panel-loading"), _ = h.querySelector(".pka-panel-suggestions"), v = h.querySelector("#pka-panel-country-mode"), y = Qe(i, h);
|
|
1021
|
+
function b(e, ...t) {
|
|
1022
|
+
o.has(e) && o.get(e).apply(f, t);
|
|
1023
|
+
}
|
|
1024
|
+
function x(e, t = !1) {
|
|
1025
|
+
if (!et(e)) throw "TypeError: setState first argument must be a key/value object.";
|
|
1026
|
+
let n = !1;
|
|
1027
|
+
for (let r in p) r in e && e[r] !== p[r] && (p[r] = e[r], n = !0, t || b(r, p[r]));
|
|
1028
|
+
n && b("state", p);
|
|
1029
|
+
}
|
|
1030
|
+
function S(e, { notify: t = !1, focus: n = !0 } = {}) {
|
|
1031
|
+
$e(e) && (Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value").set.call(i, e), x({ empty: !i.value }), t && (c = null, i.dispatchEvent(new Event("input", { bubbles: !0 })), i.dispatchEvent(new Event("change", { bubbles: !0 }))), n && i.focus());
|
|
1032
|
+
}
|
|
1033
|
+
function C() {
|
|
1034
|
+
S("", {
|
|
1035
|
+
notify: !0,
|
|
1036
|
+
focus: !0
|
|
1037
|
+
}), T(!1), p.geolocation ? j() : s = [];
|
|
1038
|
+
}
|
|
1039
|
+
function w(e = !1) {
|
|
1040
|
+
c !== null && (S(c, { focus: !1 }), e && (c = null));
|
|
1041
|
+
}
|
|
1042
|
+
function T(e) {
|
|
1043
|
+
let t = h.classList.contains("pka-open"), n = e === void 0 ? !t : e;
|
|
1044
|
+
h.classList.toggle("pka-open", n), i.setAttribute("aria-expanded", n), t !== n && (n || E(), b(n ? "open" : "close"));
|
|
1045
|
+
}
|
|
1046
|
+
function E() {
|
|
1047
|
+
h.querySelectorAll("[role=\"option\"]").forEach((e) => e.classList.remove("pka-active"));
|
|
1048
|
+
}
|
|
1049
|
+
function D(e) {
|
|
1050
|
+
c === null && (c = i.value);
|
|
1051
|
+
let t = Array.from(_.children), n = t.findIndex((e) => e.classList.contains("pka-active"));
|
|
1052
|
+
E();
|
|
1053
|
+
let r = t.length + 1, a = (n + 1 + e + r) % r;
|
|
1054
|
+
if (a === 0) w();
|
|
1055
|
+
else {
|
|
1056
|
+
let e = t[a - 1];
|
|
1057
|
+
e.classList.add("pka-active"), _.scrollTo({ top: e.offsetTop }), S(m.format.value(s[a - 1]));
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
function O(e) {
|
|
1061
|
+
let t = Array.from(_.children);
|
|
1062
|
+
if (e === void 0 && (e = t.findIndex((e) => e.classList.contains("pka-active"))), !t[e]) return;
|
|
1063
|
+
let n = s[e];
|
|
1064
|
+
p.countryMode ? (M(n), N(!1)) : (t.forEach((t, n) => {
|
|
1065
|
+
t.classList.toggle("pka-selected", n === e), t.setAttribute("aria-selected", n === e);
|
|
1066
|
+
}), S(m.format.value(n), { notify: !0 }), x({
|
|
1067
|
+
dirty: !0,
|
|
1068
|
+
freeForm: !1
|
|
1069
|
+
}), T(!1), b("pick", i.value, n, e));
|
|
1070
|
+
}
|
|
1071
|
+
let k;
|
|
1072
|
+
function A(e) {
|
|
1073
|
+
clearTimeout(k), g.setAttribute("aria-hidden", !0), e && (k = setTimeout(() => {
|
|
1074
|
+
g.setAttribute("aria-hidden", !1);
|
|
1075
|
+
}, 300));
|
|
1076
|
+
}
|
|
1077
|
+
async function j() {
|
|
1078
|
+
c = null;
|
|
1079
|
+
let e = i.value;
|
|
1080
|
+
x({
|
|
1081
|
+
empty: !e,
|
|
1082
|
+
dirty: !0,
|
|
1083
|
+
freeForm: !0
|
|
1084
|
+
}), A(!0), v.disabled || await P();
|
|
1085
|
+
let t = d ? ["city", "country"] : ["country"];
|
|
1086
|
+
a.search(e, {
|
|
1087
|
+
countries: u ? [u.countrycode] : m.countries,
|
|
1088
|
+
types: p.countryMode ? ["country"] : m.types,
|
|
1089
|
+
maxResults: p.countryMode ? 20 : m.maxResults
|
|
1090
|
+
}).then(({ results: n }) => {
|
|
1091
|
+
A(!1), i.value === e && (s = n, _.innerHTML = n.length > 0 ? n.map((e) => `
|
|
1092
|
+
<div class="pka-panel-suggestion" role="option" tabindex="-1" aria-selected="false">
|
|
1093
|
+
${t.includes(e.type) ? m.format.flag(e.countrycode) : m.format.icon(e.type || "pin", e.type)}
|
|
1094
|
+
<span class="pka-panel-suggestion-label">
|
|
1095
|
+
<span class="pka-panel-suggestion-label-name">${e.highlight}</span>
|
|
1096
|
+
<span class="pka-panel-suggestion-label-sub">${m.format.sub(e)}</span>
|
|
1097
|
+
</span>
|
|
1098
|
+
<button type="button" class="pka-panel-suggestion-action" aria-label="${m.format.applySuggestion}" />
|
|
1099
|
+
</div>
|
|
1100
|
+
`).join("") : `
|
|
1101
|
+
<div class="pka-panel-suggestion" role="option" tabindex="-1" aria-selected="false" aria-disabled="true">
|
|
1102
|
+
${m.format.icon("noresults")}
|
|
1103
|
+
<span class="pka-panel-suggestion-label">
|
|
1104
|
+
<span class="pka-panel-suggestion-label-name">
|
|
1105
|
+
${m.format.noResults?.call ? m.format.noResults(e) : m.format.noResults}
|
|
1106
|
+
</span>
|
|
1107
|
+
</span>
|
|
1108
|
+
</div>
|
|
1109
|
+
`, y.update(), b("results", e, n));
|
|
1110
|
+
}).catch((e) => b("error", e));
|
|
1111
|
+
}
|
|
1112
|
+
function M(e) {
|
|
1113
|
+
h.querySelector(".pka-panel-country-open").innerHTML = e === null ? "" : `
|
|
1114
|
+
${m.format.flag(e.countrycode)}
|
|
1115
|
+
<span class="pka-panel-country-label">${e.name}</span>
|
|
1116
|
+
${m.format.icon("switch")}
|
|
1117
|
+
`, e?.countrycode !== u?.countrycode && (u = e, b("countryChange", u));
|
|
1118
|
+
}
|
|
1119
|
+
function N(e) {
|
|
1120
|
+
v.checked = !v.disabled && (e === void 0 ? !v.checked : e), x({ countryMode: v.checked }), p.countryMode ? (l = i.value, S(u.name), i.select(), j()) : l !== null && (S(l), l = null, j());
|
|
1121
|
+
}
|
|
1122
|
+
function P() {
|
|
1123
|
+
return u ? Promise.resolve(u) : a.reverse({
|
|
1124
|
+
maxResults: 1,
|
|
1125
|
+
types: ["country"]
|
|
1126
|
+
}).then(({ results: e }) => e.length ? (M(e[0]), e[0]) : null).catch((e) => b("error", e));
|
|
1127
|
+
}
|
|
1128
|
+
h.addEventListener("mousemove", (e) => {
|
|
1129
|
+
!e.movementX && !e.movementY || (E(), e.target.closest("[role=\"option\"]")?.classList.add("pka-active"));
|
|
1130
|
+
}), h.addEventListener("click", (e) => {
|
|
1131
|
+
let t = e.target.closest("[role=\"option\"]");
|
|
1132
|
+
if (!t) return;
|
|
1133
|
+
e.stopPropagation();
|
|
1134
|
+
let n = Array.from(_.children).indexOf(t);
|
|
1135
|
+
if (e.target.closest(".pka-panel-suggestion-action")) {
|
|
1136
|
+
let e = s[n];
|
|
1137
|
+
e && (S(`${m.format.value(e)} `, { notify: !0 }), x({
|
|
1138
|
+
dirty: !0,
|
|
1139
|
+
freeForm: !1
|
|
1140
|
+
}));
|
|
1141
|
+
} else O(n);
|
|
1142
|
+
}), v.addEventListener("change", (e) => {
|
|
1143
|
+
N(e.target.checked);
|
|
1144
|
+
});
|
|
1145
|
+
function F(e) {
|
|
1146
|
+
e instanceof InputEvent && (T(!!i.value.trim() || p.countryMode), j());
|
|
1147
|
+
}
|
|
1148
|
+
i.addEventListener("input", F);
|
|
1149
|
+
function I() {
|
|
1150
|
+
!p.dirty && i.value ? (T(!0), j()) : T(!!i.value.trim() || p.geolocation || p.countryMode);
|
|
1151
|
+
}
|
|
1152
|
+
i.addEventListener("click", I), i.addEventListener("focus", I);
|
|
1153
|
+
function L(e) {
|
|
1154
|
+
![i, h].includes(e.target) && !h.contains(e.target) && (T(!1), w(!0));
|
|
1155
|
+
}
|
|
1156
|
+
window.addEventListener("click", L);
|
|
1157
|
+
function R(e) {
|
|
1158
|
+
if (i === document.activeElement) {
|
|
1159
|
+
let t = h.classList.contains("pka-open");
|
|
1160
|
+
switch (e.key) {
|
|
1161
|
+
case "Up":
|
|
1162
|
+
case "ArrowUp":
|
|
1163
|
+
t && (e.preventDefault(), e.altKey ? T(!1) : D(-1));
|
|
1164
|
+
break;
|
|
1165
|
+
case "Down":
|
|
1166
|
+
case "ArrowDown":
|
|
1167
|
+
s.length > 0 && (t ? e.altKey || (e.preventDefault(), D(1)) : (e.preventDefault(), T(!0)));
|
|
1168
|
+
break;
|
|
1169
|
+
case "Enter":
|
|
1170
|
+
t && (e.preventDefault(), O());
|
|
1171
|
+
break;
|
|
1172
|
+
case "Esc":
|
|
1173
|
+
case "Escape":
|
|
1174
|
+
e.preventDefault(), t ? p.countryMode ? N(!1) : (T(!1), w(!0)) : C();
|
|
1175
|
+
break;
|
|
1176
|
+
case "Tab":
|
|
1177
|
+
T(!1);
|
|
1178
|
+
break;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
window.addEventListener("keydown", R);
|
|
1183
|
+
function z() {
|
|
1184
|
+
window.requestAnimationFrame(() => {
|
|
1185
|
+
h.style.width = `${i.offsetWidth}px`, y.update();
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
z();
|
|
1189
|
+
let B = new ResizeObserver(z);
|
|
1190
|
+
B.observe(i);
|
|
1191
|
+
function V(e = {}) {
|
|
1192
|
+
delete e.target;
|
|
1193
|
+
let { panel: t, format: n, countryAutoFill: r, countrySelect: o, ...s } = tt(m, e);
|
|
1194
|
+
a.configure(s), h.setAttribute("class", `pka-panel ${m.panel.className}`.trim()), y.setOptions({
|
|
1195
|
+
placement: "bottom-start",
|
|
1196
|
+
strategy: m.panel.strategy,
|
|
1197
|
+
modifiers: [{
|
|
1198
|
+
name: "flip",
|
|
1199
|
+
enabled: m.panel.flip
|
|
1200
|
+
}, {
|
|
1201
|
+
name: "offset",
|
|
1202
|
+
options: { offset: [0, m.panel.offset] }
|
|
1203
|
+
}]
|
|
1204
|
+
});
|
|
1205
|
+
let c = m.types?.join(",").toLowerCase() ?? "";
|
|
1206
|
+
v.disabled = m.countries || !m.countrySelect || c === "country", h.querySelector(".pka-panel-country").setAttribute("aria-hidden", v.disabled), d = !m.countries && !m.countrySelect && [
|
|
1207
|
+
"city",
|
|
1208
|
+
"city,country",
|
|
1209
|
+
"country,city",
|
|
1210
|
+
"country"
|
|
1211
|
+
].includes(c), m.countryAutoFill && c === "country" && !p.dirty && !i.value.trim() && P().then((e) => {
|
|
1212
|
+
S(e.name, {
|
|
1213
|
+
notify: !0,
|
|
1214
|
+
focus: !1
|
|
1215
|
+
}), x({ freeForm: !1 }), b("pick", e.name, e, 0);
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
return V(r), Object.defineProperty(f, "input", { get: () => i }), Object.defineProperty(f, "options", { get: () => ({
|
|
1219
|
+
target: t,
|
|
1220
|
+
...m,
|
|
1221
|
+
...a.options
|
|
1222
|
+
}) }), Object.defineProperty(f, "handlers", { get: () => Object.fromEntries(o) }), Object.defineProperty(f, "state", { get: () => p }), f.setValue = (e, t = !1) => (S(e, {
|
|
1223
|
+
notify: t,
|
|
1224
|
+
focus: !1
|
|
1225
|
+
}), f), f.clear = C, f.on = (e, t) => {
|
|
1226
|
+
if (!$e(e)) throw "Error: first argument 'event' must be a string.";
|
|
1227
|
+
if (t !== void 0 && !t.call) throw "Error: second argument 'handler' must be a function if defined.";
|
|
1228
|
+
return t ? o.set(e, t) : o.has(e) && o.delete(e), f;
|
|
1229
|
+
}, f.open = () => (T(!0), f), f.close = () => (T(!1), f), f.configure = (e = {}) => (V(e), f), f.requestGeolocation = (e = {}) => a.requestGeolocation(e).then((e) => (x({ geolocation: !0 }, !0), b("geolocation", !0, e), M(null), i.focus(), j(), e)).catch((e) => {
|
|
1230
|
+
x({ geolocation: !1 }, !0), b("geolocation", !1, void 0, e.message);
|
|
1231
|
+
}), f.clearGeolocation = () => (a.clearGeolocation(), x({ geolocation: !1 }), f), f.destroy = () => {
|
|
1232
|
+
i.removeEventListener("input", F), i.removeEventListener("click", I), i.removeEventListener("focus", I), window.removeEventListener("keydown", R), window.removeEventListener("click", L), B.unobserve(i), h.remove();
|
|
1233
|
+
}, f;
|
|
1234
|
+
}
|
|
1235
|
+
//#endregion
|
|
1236
|
+
export { nt as default };
|