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