@verbb/formie-browser 1.0.14 → 1.0.16
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 +66 -0
- package/dist/chunks/{address-country-Dn71jroa.js → address-country-DLJF-OkC.js} +5 -9
- package/dist/chunks/{address-finder-O49uDRoR.js → address-finder-QK1m1eyv.js} +2 -2
- package/dist/chunks/{address-state-ByYatUur.js → address-state-CHKit8AW.js} +113 -112
- package/dist/chunks/{api-DYYsVIub.js → api-BPtH5RBA.js} +162 -130
- package/dist/chunks/{api-D6kJ7kXZ.js → api-BR2Gqy37.js} +313 -303
- package/dist/chunks/{api-ghNr2uxX.js → api-CmuOZ0i3.js} +1 -1
- package/dist/chunks/{async-nPFRNQ06.js → async-2GdXNFCE.js} +18 -1
- package/dist/chunks/{bpoint-D0RKFM4F.js → bpoint-GvYfyPjD.js} +1 -1
- package/dist/chunks/{calculations-YEoVCG2q.js → calculations-DeEmdUDq.js} +5 -7
- package/dist/chunks/{captcha-eu-DERJbXnH.js → captcha-eu-eU_M6snp.js} +2 -2
- package/dist/chunks/{checkbox-radio-gsm8QPJg.js → checkbox-radio-CSXo6svm.js} +4 -12
- package/dist/chunks/{combobox-CWNdx4Fk.js → combobox-CJh2DoSO.js} +323 -363
- package/dist/chunks/{conditions-DqNHLTbN.js → conditions-Dz3068K0.js} +140 -153
- package/dist/chunks/{country-from-ip-DDj_mFki.js → country-from-ip-BqQ-BqLH.js} +1 -1
- package/dist/chunks/{custom-google-maps-C4l2S3GO.js → custom-google-maps-rNm5VFbb.js} +2 -6
- package/dist/chunks/{custom-link-CLazgKYH.js → custom-link-CLqFCssQ.js} +1 -1
- package/dist/chunks/{custom-maps-DqcAlD0v.js → custom-maps-DgjYQDLj.js} +4 -8
- package/dist/chunks/{date-picker-RUnevF7l.js → date-picker-BVJxJVYT.js} +42 -58
- package/dist/chunks/{debug-BV0DvdHx.js → debug-rhzqP1j2.js} +2 -14
- package/dist/chunks/{dist-ZLeW0zZ3.js → dist-CJReDlDK.js} +13 -8
- package/dist/chunks/{eway-or6dtjoT.js → eway-BZuTBAUW.js} +3 -3
- package/dist/chunks/{field-references.resolver-Ca8MguFv.js → field-references.resolver-uSHf5-NP.js} +1 -1
- package/dist/chunks/{file-upload-Bm-TXyNB.js → file-upload-vEUr_EuP.js} +131 -113
- package/dist/chunks/{friendly-captcha-v1-GFqCt1Mh.js → friendly-captcha-v1-C_cF1WD2.js} +2 -2
- package/dist/chunks/{friendly-captcha-v2-WoW246JG.js → friendly-captcha-v2-BenESH-n.js} +2 -2
- package/dist/chunks/{friendly-challenge-DPG9MJb1.js → friendly-challenge-BgPBEMXx.js} +21 -35
- package/dist/chunks/{go-cardless-DzJ-0FKg.js → go-cardless-DWZeB0Bq.js} +2 -6
- package/dist/chunks/{google-address-C1P1nTDM.js → google-address-DQR6rsbh.js} +15 -10
- package/dist/chunks/{hcaptcha-D0T8aIHz.js → hcaptcha-COilLmRT.js} +2 -2
- package/dist/chunks/{hidden-BZhXnNPe.js → hidden-Bc2TpcgF.js} +1 -1
- package/dist/chunks/{http-C2QdHuWO.js → http-Dj_skqaa.js} +1 -1
- package/dist/chunks/{leaflet-src-DE6rv6M-.js → leaflet-src-Cg-LUOD8.js} +74 -122
- package/dist/chunks/{loqate-DD1S7PY9.js → loqate-ZZClcacr.js} +2 -2
- package/dist/chunks/{mollie-DG8Ju83x.js → mollie-8OMXIYa8.js} +2 -6
- package/dist/chunks/{moneris-C8m3Fvqu.js → moneris-qYHJ9EFy.js} +1 -1
- package/dist/chunks/opayo-DlWPEnla.js +159 -0
- package/dist/chunks/{paddle-BIYR9Um3.js → paddle-CArfWih0.js} +2 -2
- package/dist/chunks/{password-validation-C8_uO_c_.js → password-validation-HGOU9kf3.js} +2 -2
- package/dist/chunks/{paypal-B_yxIo2d.js → paypal-BcaMCMGY.js} +2 -2
- package/dist/chunks/{payway-CeOzS0sL.js → payway-vxC7_bfR.js} +4 -12
- package/dist/chunks/{phone-country-bAqje17P.js → phone-country-Bx9EG50h.js} +124 -141
- package/dist/chunks/{place-kit-BE5gi3vo.js → place-kit-BKk8xDXf.js} +10 -10
- package/dist/chunks/{placekit-autocomplete.esm-CZZERYur.js → placekit-autocomplete.esm-D2A_0iVU.js} +2 -5
- package/dist/chunks/{recaptcha-enterprise-CruXddZq.js → recaptcha-enterprise-Cx6HUpMa.js} +6 -12
- package/dist/chunks/recaptcha-shared-CcMI-r8t.js +33 -0
- package/dist/chunks/{recaptcha-v2-checkbox-CCnJYCnG.js → recaptcha-v2-checkbox-DQ9BJzcv.js} +2 -2
- package/dist/chunks/{recaptcha-v2-invisible-BuVqRRYn.js → recaptcha-v2-invisible-BP0T8Pan.js} +2 -2
- package/dist/chunks/recaptcha-v3-DKMGQ27K.js +38 -0
- package/dist/chunks/{repeater-DwE27jI1.js → repeater-BR0RUvTs.js} +50 -40
- package/dist/chunks/{rich-text-uV4o_pGk.js → rich-text-H2A6cm1t.js} +33 -11
- package/dist/chunks/{rolldown-runtime-DtPi1Y-2.js → rolldown-runtime-VHNaYcLd.js} +1 -1
- package/dist/chunks/{scripts-CbQ7agX3.js → scripts-DrccjrFv.js} +1 -1
- package/dist/chunks/{sdk-lkwSvlpM.js → sdk-_cmrRYgp.js} +4 -16
- package/dist/chunks/{shared-OKhSay59.js → shared-CJ1LIEh3.js} +1 -3
- package/dist/chunks/{signature-7cldFbqj.js → signature-CfKA_poI.js} +9 -41
- package/dist/chunks/skip-CEW89ExY.js +7 -0
- package/dist/chunks/{snaptcha-C04kNGYQ.js → snaptcha-P3EoSQud.js} +1 -1
- package/dist/chunks/{square-DEzxv9D9.js → square-Dyz0p_GU.js} +2 -2
- package/dist/chunks/{stripe-CVPQGDz3.js → stripe-Bfd_jp_k.js} +4 -7
- package/dist/chunks/{summary-BF_8mrXI.js → summary-B3CAebLV.js} +45 -37
- package/dist/chunks/{survey-likert-fk1hUPff.js → survey-likert-CEtUceag.js} +1 -1
- package/dist/chunks/{survey-rank-BsLGl2LX.js → survey-rank-Dtt97y6s.js} +3 -7
- package/dist/chunks/{survey-rating-DVS6e6fM.js → survey-rating-mlDMI0uq.js} +9 -23
- package/dist/chunks/{table-DnIBdeKF.js → table-0k6Md0IO.js} +2 -2
- package/dist/chunks/{text-limit-LGMPhFuC.js → text-limit-CTVML6s7.js} +10 -10
- package/dist/chunks/{turnstile-n9DNyPxi.js → turnstile-Sp4ubowK.js} +2 -2
- package/dist/chunks/{upload-manager-BbiUosZq.js → upload-manager-Ccg3d_4I.js} +258 -260
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +743 -734
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/dom-events.d.ts +5 -0
- package/dist/js/core/dom-events.d.ts.map +1 -1
- package/dist/js/core/page-client-event.d.ts.map +1 -1
- package/dist/js/core/submit-result-state.d.ts.map +1 -1
- package/dist/js/core/submit-result-ui.d.ts +3 -1
- package/dist/js/core/submit-result-ui.d.ts.map +1 -1
- package/dist/js/core/validation-focus.d.ts.map +1 -1
- package/dist/js/modules/address/google-address.d.ts +10 -0
- package/dist/js/modules/address/google-address.d.ts.map +1 -1
- package/dist/js/modules/address/place-kit.d.ts.map +1 -1
- package/dist/js/modules/captchas/factories.d.ts.map +1 -1
- package/dist/js/modules/captchas/host.d.ts +4 -1
- package/dist/js/modules/captchas/host.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-shared.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
- package/dist/js/modules/fields/address-state.d.ts.map +1 -1
- package/dist/js/modules/fields/combobox.d.ts +2 -0
- package/dist/js/modules/fields/combobox.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions.d.ts.map +1 -1
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
- package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
- package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
- package/dist/js/modules/fields/repeater.d.ts.map +1 -1
- package/dist/js/modules/fields/rich-text.d.ts.map +1 -1
- package/dist/js/modules/fields/summary.d.ts.map +1 -1
- package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
- package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
- package/dist/js/modules/payments/factories.d.ts.map +1 -1
- package/dist/js/modules/payments/opayo.d.ts.map +1 -1
- package/dist/js/submit/pipeline.d.ts +2 -0
- package/dist/js/submit/pipeline.d.ts.map +1 -1
- package/dist/js/utils/async.d.ts +1 -0
- package/dist/js/utils/async.d.ts.map +1 -1
- package/dist/js/utils/form-started-at.d.ts +1 -0
- package/dist/js/utils/form-started-at.d.ts.map +1 -1
- package/dist/js/utils/unload-warning.d.ts +4 -0
- package/dist/js/utils/unload-warning.d.ts.map +1 -1
- package/dist/js/validation/rules/required.d.ts.map +1 -1
- package/dist/js/validation/submit-readiness.d.ts.map +1 -1
- package/dist/js/validation/validator.d.ts +1 -0
- package/dist/js/validation/validator.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/js/core/create-formie-client.ts +37 -28
- package/src/js/core/dom-events.ts +30 -1
- package/src/js/core/page-client-event.ts +5 -7
- package/src/js/core/submit-result-state.ts +30 -2
- package/src/js/core/submit-result-ui.ts +25 -3
- package/src/js/core/validation-focus.ts +17 -3
- package/src/js/modules/address/google-address.ts +95 -37
- package/src/js/modules/address/place-kit.ts +13 -7
- package/src/js/modules/captchas/factories.ts +241 -101
- package/src/js/modules/captchas/host.ts +16 -0
- package/src/js/modules/captchas/recaptcha-enterprise.ts +1 -1
- package/src/js/modules/captchas/recaptcha-shared.ts +23 -5
- package/src/js/modules/captchas/recaptcha-v3.ts +23 -14
- package/src/js/modules/fields/address-country.ts +5 -5
- package/src/js/modules/fields/address-state.ts +80 -27
- package/src/js/modules/fields/combobox.ts +22 -1
- package/src/js/modules/fields/conditions/effects.ts +4 -5
- package/src/js/modules/fields/conditions.ts +9 -0
- package/src/js/modules/fields/date-picker.ts +6 -3
- package/src/js/modules/fields/file-upload.ts +55 -18
- package/src/js/modules/fields/phone-country.ts +25 -2
- package/src/js/modules/fields/repeater.ts +55 -4
- package/src/js/modules/fields/rich-text.ts +33 -0
- package/src/js/modules/fields/summary.ts +63 -10
- package/src/js/modules/fields/text-limit.ts +11 -0
- package/src/js/modules/fields/upload-manager.ts +54 -18
- package/src/js/modules/payments/factories.ts +87 -54
- package/src/js/modules/payments/opayo.ts +7 -0
- package/src/js/submit/pipeline.ts +16 -9
- package/src/js/utils/async.ts +34 -0
- package/src/js/utils/form-started-at.ts +19 -4
- package/src/js/utils/unload-warning.ts +63 -7
- package/src/js/validation/rules/required.ts +18 -0
- package/src/js/validation/submit-readiness.ts +2 -0
- package/src/js/validation/validator.ts +29 -6
- package/src/vendor.d.ts +2 -0
- package/dist/chunks/opayo-B3EvrVxw.js +0 -188
- package/dist/chunks/recaptcha-shared-AQRMDMme.js +0 -27
- package/dist/chunks/recaptcha-v3-CloqhO2A.js +0 -28
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,72 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Fixed
|
|
6
|
+
- Fixed Opayo re-tokenizing cards and requesting unnecessary merchant sessions after completing a 3D Secure challenge. ([#3048](https://github.com/verbb/formie/issues/3048))
|
|
7
|
+
|
|
8
|
+
## 1.0.16 - 2026-10-28
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Added configurable display limits for searchable dropdowns, defaulting to 100 while searching all options. ([#3059](https://github.com/verbb/formie/issues/3059))
|
|
12
|
+
- Add a keyboard-accessible clear button for single searchable Dropdown fields with placeholders. ([#3058](https://github.com/verbb/formie/issues/3058))
|
|
13
|
+
- Add the `formie:unload-warning:collect-exclusions` event for integrations to exclude automatically updated transport fields from unsaved-changes checks.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Updated the package build toolchain to Vite 8.3.4.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Fixed concurrent payment widget mounts when fields become visible, including duplicate Opayo Drop-in sessions, unhandled mount errors and incomplete teardown during initialization. ([#3048](https://github.com/verbb/formie/issues/3048))
|
|
20
|
+
- Fixed required dropdowns enhanced with third-party libraries such as Choices.js failing validation when options are selected, and preserved custom required messages. ([#3046](https://github.com/verbb/formie/issues/3046))
|
|
21
|
+
- Fixed page-reload submissions stalling when the submit delay is zero.
|
|
22
|
+
- Fixed mounted form lifecycle events omitting the form instance, including submission, page navigation, token refresh and teardown hooks. ([#3032](https://github.com/verbb/formie/issues/3032))
|
|
23
|
+
- Fixed “Scroll To Top” having no effect after successful AJAX submissions. ([#3023](https://github.com/verbb/formie/issues/3023))
|
|
24
|
+
- Fixed summary fields remaining blank after AJAX page navigation.
|
|
25
|
+
- Fixed summary fields repeatedly retrying failed requests.
|
|
26
|
+
- Fixed text counters and phone countries not returning to their initial values when forms reset.
|
|
27
|
+
- Fixed rich-text validation errors failing to focus and describe the editable control.
|
|
28
|
+
- Fixed required table fields incorrectly requiring every cell to have a value.
|
|
29
|
+
- Fixed dependent calculations using number prefixes or suffixes returning incorrect results.
|
|
30
|
+
- Fixed fresh visits and completed submissions retaining an earlier spam-protection timer.
|
|
31
|
+
- Fixed forms freezing when live validation and disabling the submit button until valid are both enabled.
|
|
32
|
+
- Fixed native file input metadata requests omitting CSRF tokens and form context after navigating between pages.
|
|
33
|
+
- Fixed reCAPTCHA loading the wrong SDK or readiness queue when standard and Enterprise APIs share a page, and v3 failing when an existing script has not loaded the configured site key.
|
|
34
|
+
- Fixed reCAPTCHA v3 inline badges rendering outside the form. ([#3016](https://github.com/verbb/formie/issues/3016))
|
|
35
|
+
- Fixed CAPTCHA token updates triggering unsaved-changes warnings on untouched forms, including custom or changing token field names. ([#3008](https://github.com/verbb/formie/issues/3008))
|
|
36
|
+
- Fixed initial conditional field visibility triggering an unsaved-changes warning after native submissions.
|
|
37
|
+
- Fixed edits made immediately after mounting a form being treated as saved.
|
|
38
|
+
- Fixed CAPTCHA teardown leaving widgets or callbacks active after failed setup, pending mounts or provider cleanup errors.
|
|
39
|
+
- Fixed CAPTCHA widgets with a numeric zero handle failing to challenge or reset.
|
|
40
|
+
|
|
41
|
+
## 1.0.15 - 2026-10-15
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
- Rename field module settings to `allowedCountryCodes`, `maxFiles`, `minFileSize` and `maxFileSize` to match the PHP field API.
|
|
45
|
+
- Remove the unused legacy frontend-theme attribute from mounted forms.
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
- Fixed adding or removing repeater rows with the mouse automatically focusing fields in the submission editor, and keyboard focus targeting field wrappers instead of controls.
|
|
49
|
+
- Fixed hiding an unused state field triggering an unsaved-changes warning when opening a submission.
|
|
50
|
+
- Fixed PlaceKit autocomplete clearing the selected state when using a dynamic State / Province dropdown.
|
|
51
|
+
- Fixed dynamic state dropdowns using control-panel markup, including country changes and preservation of historical saved values.
|
|
52
|
+
- Fixed browser event compatibility not inheriting the setting from forms loaded into a wrapper through REST or GraphQL.
|
|
53
|
+
- Fixed resetting forms leaving added repeater rows or failing to restore removed rows and dynamic address state values.
|
|
54
|
+
- Fixed dynamic address state fields failing to reappear after selecting a country that uses states.
|
|
55
|
+
- Fixed dynamic address state fields remaining visible before a country was selected.
|
|
56
|
+
- Fixed required searchable dropdowns rejecting selected values during browser validation.
|
|
57
|
+
- Fixed address state fields becoming unresponsive when changing countries after selecting a state.
|
|
58
|
+
- Fixed date pickers displaying prefilled dates and date ranges one day early in time zones west of UTC.
|
|
59
|
+
- Fixed live validation error descriptions referencing another form when multiple forms used the same field handles.
|
|
60
|
+
- Fixed keyboard focus skipping newly added repeater rows and being lost when removing the focused row.
|
|
61
|
+
- Fixed correcting a spam-rejected submission causing a stale-session error and clearing entered values.
|
|
62
|
+
- Fixed payment checkout redirects showing an unsaved-changes warning and leaving forms disabled when cancelled.
|
|
63
|
+
- Fixed completed forms with conditional fields showing an unsaved-changes warning when leaving the page.
|
|
64
|
+
- Fixed required simple upload fields rejecting retained files when returning to an earlier page.
|
|
65
|
+
- Fixed simple file uploads losing attachment capabilities after a failed submission.
|
|
66
|
+
- Fixed Upload Manager silently rejecting files that exceed file type, size, or count restrictions.
|
|
67
|
+
- Fixed failed uploads continuing to display an active processing status.
|
|
68
|
+
- Fixed saving progress hiding unfinished forms when Hide Form was enabled for completion.
|
|
69
|
+
- Fixed matching page conditions revealing inactive pages in multi-page forms.
|
|
70
|
+
|
|
5
71
|
## 1.0.14 - 2026-10-08
|
|
6
72
|
|
|
7
73
|
### Added
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./debug-
|
|
1
|
+
import { t as e } from "./debug-rhzqP1j2.js";
|
|
2
2
|
import { i as t, n } from "./constants-DVcJAvc5.js";
|
|
3
|
-
import { i as r } from "./shared-
|
|
4
|
-
import { n as i } from "./country-from-ip-
|
|
3
|
+
import { i as r } from "./shared-CJ1LIEh3.js";
|
|
4
|
+
import { n as i } from "./country-from-ip-BqQ-BqLH.js";
|
|
5
5
|
//#region src/js/modules/fields/address-country.ts
|
|
6
6
|
var a = "address-country", o = n.country, s = e("fields", "address-country");
|
|
7
7
|
function c(e, t, n) {
|
|
@@ -37,16 +37,12 @@ async function f(e, n) {
|
|
|
37
37
|
if (r.value.trim()) return;
|
|
38
38
|
let a = await i(n.countryFromIpAction, e.closest("form"));
|
|
39
39
|
if (!a?.countryCode) return;
|
|
40
|
-
if (!l(a.countryCode, n.
|
|
40
|
+
if (!l(a.countryCode, n.allowedCountryCodes)) {
|
|
41
41
|
s.log("Detected country is not in the allowed list; skipping preselect.", { countryCode: a.countryCode });
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
let o = n.countryOptionValue === "full" ? "full" : "short", f = c(a.countryCode, a.countryName, o);
|
|
45
|
-
|
|
46
|
-
s.warn("Detected country is not available in the country dropdown; skipping preselect.", { selectValue: f });
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
await d(r, f), s.log("Preselected country from IP.", { selectValue: f });
|
|
45
|
+
u(r, f) ? (await d(r, f), s.log("Preselected country from IP.", { selectValue: f })) : s.warn("Detected country is not available in the country dropdown; skipping preselect.", { selectValue: f });
|
|
50
46
|
}
|
|
51
47
|
var p = {
|
|
52
48
|
moduleId: `formie:${a}`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as e } from "./event-names-BCI2FLD8.js";
|
|
2
|
-
import { t } from "./api-
|
|
3
|
-
import { r as n } from "./scripts-
|
|
2
|
+
import { t } from "./api-CmuOZ0i3.js";
|
|
3
|
+
import { r as n } from "./scripts-DrccjrFv.js";
|
|
4
4
|
//#region src/js/modules/address/address-finder.ts
|
|
5
5
|
var r = "FORMIE_ADDRESS_FINDER_SCRIPT", i = t({
|
|
6
6
|
moduleId: "formie:address-finder",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as e } from "./request-profile-DhwkeCpS.js";
|
|
2
|
-
import { t } from "./dist-
|
|
3
|
-
import { t as n } from "./debug-
|
|
2
|
+
import { t } from "./dist-CJReDlDK.js";
|
|
3
|
+
import { t as n } from "./debug-rhzqP1j2.js";
|
|
4
4
|
import { a as r, n as i } from "./theme-classes-DAQuEqdP.js";
|
|
5
5
|
import { n as a } from "./constants-DVcJAvc5.js";
|
|
6
|
-
import { i as o, n as s } from "./shared-
|
|
7
|
-
import { initFormieCombobox as c } from "./combobox-
|
|
6
|
+
import { i as o, n as s } from "./shared-CJ1LIEh3.js";
|
|
7
|
+
import { initFormieCombobox as c } from "./combobox-CJh2DoSO.js";
|
|
8
8
|
//#region src/js/modules/fields/address-state.ts
|
|
9
9
|
var l = "[data-formie-address-state-dynamic]", u = "[data-formie-address-state-input]", d = "[data-formie-address-state-autofill-anchor]", f = "formie-address-autofill-start", p = a.country, m = "address-state", h = "formie/address/subdivisions", g = ["formie-select", "formie-dropdown-input"], _ = [
|
|
10
10
|
0,
|
|
@@ -23,7 +23,7 @@ function C(e) {
|
|
|
23
23
|
return t instanceof HTMLInputElement || t instanceof HTMLSelectElement ? t : null;
|
|
24
24
|
}
|
|
25
25
|
function w(e) {
|
|
26
|
-
return e.querySelector("[data-formie-field-label]");
|
|
26
|
+
return e.querySelector("[data-formie-field-label]") || (e.querySelector("[data-formie-address-state-cp]") ? e.querySelector(":scope > .heading > label") : null);
|
|
27
27
|
}
|
|
28
28
|
function T(e) {
|
|
29
29
|
e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
@@ -34,11 +34,8 @@ function E(e, t) {
|
|
|
34
34
|
n && n.getValue() !== t && n.setValue(t, !0);
|
|
35
35
|
}
|
|
36
36
|
function D(e, t) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
E(e, t);
|
|
37
|
+
let n = e.value;
|
|
38
|
+
e.value = t, E(e, e.value), e.value !== n && T(e);
|
|
42
39
|
}
|
|
43
40
|
function O(e, t) {
|
|
44
41
|
e.autofillAnchor && (e.autofillAnchor.value = t);
|
|
@@ -50,28 +47,28 @@ function k(e) {
|
|
|
50
47
|
function A(e) {
|
|
51
48
|
return e.pendingStateValue?.trim() || e.autofillAnchor?.value?.trim() || e.stateControl.value?.trim() || "";
|
|
52
49
|
}
|
|
53
|
-
function
|
|
50
|
+
function ee(e) {
|
|
54
51
|
if (e.autofillAnchor) return e.autofillAnchor;
|
|
55
52
|
let t = e.addressRoot.querySelector(d);
|
|
56
53
|
if (t instanceof HTMLInputElement) e.autofillAnchor = t;
|
|
57
54
|
else {
|
|
58
55
|
let t = document.createElement("input");
|
|
59
|
-
t.type = "text", t.setAttribute("data-formie-address-state-autofill-anchor", "true"), t.setAttribute("autocomplete", "address-level1"), t.setAttribute("tabindex", "-1"), t.setAttribute("aria-hidden", "true"), t.className = "formie-sr-only", e.addressRoot.appendChild(t), e.autofillAnchor = t;
|
|
56
|
+
t.type = "text", t.setAttribute("data-formie-address-state-autofill-anchor", "true"), t.setAttribute("autocomplete", "address-level1"), t.setAttribute("tabindex", "-1"), t.setAttribute("aria-hidden", "true"), t.className = "formie-sr-only", t.hidden = e.isCpEdit, e.addressRoot.appendChild(t), e.autofillAnchor = t;
|
|
60
57
|
}
|
|
61
58
|
return e.stateControl.setAttribute("autocomplete", "off"), e.stateControl.value && !e.autofillAnchor.value && (e.autofillAnchor.value = e.stateControl.value), e.autofillAnchor;
|
|
62
59
|
}
|
|
63
|
-
function
|
|
60
|
+
function j(e) {
|
|
64
61
|
k(e);
|
|
65
62
|
let t = A(e);
|
|
66
63
|
if (!t) return;
|
|
67
|
-
let n = e.lastSubdivisions, r =
|
|
68
|
-
|
|
64
|
+
let n = e.lastSubdivisions, r = e.stateControl instanceof HTMLSelectElement ? I(t, n) || "" : t;
|
|
65
|
+
O(e, r), e.pendingStateValue = r, D(e.stateControl, r);
|
|
69
66
|
}
|
|
70
|
-
function
|
|
67
|
+
function M(e, t, n, r) {
|
|
71
68
|
let i = new URL(/^https?:\/\//.test(e) || e.startsWith("/") ? e : `/actions/${e}`, window.location.origin);
|
|
72
69
|
return i.searchParams.set("country", t), i.searchParams.set("optionLabel", n), i.searchParams.set("optionValue", r), i.toString();
|
|
73
70
|
}
|
|
74
|
-
function
|
|
71
|
+
function N(e, t, n, r) {
|
|
75
72
|
return [
|
|
76
73
|
e,
|
|
77
74
|
t,
|
|
@@ -79,14 +76,14 @@ function P(e, t, n, r) {
|
|
|
79
76
|
r
|
|
80
77
|
].join("|");
|
|
81
78
|
}
|
|
82
|
-
function
|
|
79
|
+
function P(e) {
|
|
83
80
|
return y.has(e);
|
|
84
81
|
}
|
|
85
|
-
async function
|
|
86
|
-
let o =
|
|
82
|
+
async function F(e, n, r, i, a) {
|
|
83
|
+
let o = N(e, n, r, i);
|
|
87
84
|
return y.has(o) ? y.get(o) || null : (b.has(o) || b.set(o, (async () => {
|
|
88
85
|
try {
|
|
89
|
-
let s = await t(
|
|
86
|
+
let s = await t(M(i, e, n, r), { headers: { Accept: "application/json" } }, a);
|
|
90
87
|
if (!s.ok) return y.set(o, null), null;
|
|
91
88
|
let c = await s.json();
|
|
92
89
|
return y.set(o, c), c;
|
|
@@ -100,13 +97,13 @@ async function I(e, n, r, i, a) {
|
|
|
100
97
|
}
|
|
101
98
|
})()), b.get(o) || null);
|
|
102
99
|
}
|
|
103
|
-
function
|
|
100
|
+
function I(e, t) {
|
|
104
101
|
let n = e.trim().toLowerCase();
|
|
105
102
|
if (!n) return null;
|
|
106
103
|
for (let e of t) if (e.value.toLowerCase() === n || (e.name || "").toLowerCase() === n || (e.short || "").toLowerCase() === n || e.label.toLowerCase() === n) return e.value;
|
|
107
104
|
return null;
|
|
108
105
|
}
|
|
109
|
-
function
|
|
106
|
+
function L(e, t) {
|
|
110
107
|
[
|
|
111
108
|
"id",
|
|
112
109
|
"name",
|
|
@@ -118,6 +115,7 @@ function R(e, t) {
|
|
|
118
115
|
"data-formie-input-type",
|
|
119
116
|
"data-formie-input-error-state",
|
|
120
117
|
"data-formie-address-state-dynamic",
|
|
118
|
+
"data-formie-address-state-cp",
|
|
121
119
|
"data-formie-address-state-hide-when-unused",
|
|
122
120
|
"data-formie-address-state-use-searchable",
|
|
123
121
|
"data-formie-address-state-use-datalist",
|
|
@@ -125,42 +123,38 @@ function R(e, t) {
|
|
|
125
123
|
"data-formie-address-state-option-value"
|
|
126
124
|
].forEach((n) => {
|
|
127
125
|
let r = e.getAttribute(n);
|
|
128
|
-
|
|
129
|
-
t.removeAttribute(n);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
t.setAttribute(n, r);
|
|
126
|
+
r === null ? t.removeAttribute(n) : t.setAttribute(n, r);
|
|
133
127
|
});
|
|
134
128
|
}
|
|
135
|
-
function
|
|
136
|
-
t.className = e.className;
|
|
129
|
+
function R(e, t) {
|
|
130
|
+
t.className = e.hasAttribute("data-formie-address-state-cp") ? "text fullwidth" : e.className;
|
|
137
131
|
}
|
|
138
|
-
function
|
|
132
|
+
function z(e, t) {
|
|
139
133
|
let n = [...g];
|
|
140
134
|
i(e, "fieldControlError").forEach((t) => {
|
|
141
135
|
e.classList.contains(t) && n.push(t);
|
|
142
136
|
}), t.className = n.join(" ");
|
|
143
137
|
}
|
|
144
|
-
function
|
|
138
|
+
function B(e, t) {
|
|
145
139
|
return e.parentNode?.replaceChild(t, e), t;
|
|
146
140
|
}
|
|
147
|
-
function
|
|
141
|
+
function V(e, t) {
|
|
148
142
|
let n = document.createElement("input");
|
|
149
|
-
return n.type = "text",
|
|
143
|
+
return n.type = "text", L(e, n), R(e, n), n.setAttribute("data-formie-input-type", "text"), n.setAttribute("data-formie-address-state-input", "true"), n.setAttribute("data-formie-single-line-text-input", "true"), n.setAttribute("autocomplete", "off"), n.removeAttribute("data-formie-combobox-input"), n.value = t, n;
|
|
150
144
|
}
|
|
151
|
-
function
|
|
145
|
+
function H(e, t, n, r = "") {
|
|
152
146
|
e.innerHTML = "";
|
|
153
147
|
let i = document.createElement("option");
|
|
154
148
|
i.value = "", i.textContent = n || "", e.appendChild(i), t.forEach((t) => {
|
|
155
149
|
let n = document.createElement("option");
|
|
156
150
|
n.value = t.value, n.textContent = t.label, e.appendChild(n);
|
|
157
|
-
}), e.value =
|
|
151
|
+
}), e.value = I(r, t) || r;
|
|
158
152
|
}
|
|
159
|
-
function
|
|
153
|
+
function U(e, t, n, r) {
|
|
160
154
|
let i = document.createElement("select");
|
|
161
|
-
return
|
|
155
|
+
return L(e, i), z(e, i), i.setAttribute("data-formie-input-type", "select"), i.setAttribute("data-formie-address-state-input", "true"), i.setAttribute("data-formie-select", "true"), i.setAttribute("data-formie-dropdown-input", "true"), i.removeAttribute("data-formie-single-line-text-input"), i.setAttribute("autocomplete", "off"), H(i, n, r, t), i;
|
|
162
156
|
}
|
|
163
|
-
function
|
|
157
|
+
function W(e, t, n, r) {
|
|
164
158
|
let i = e.list;
|
|
165
159
|
if (!r || n.length === 0) {
|
|
166
160
|
e.removeAttribute("list"), i && i.remove();
|
|
@@ -172,86 +166,96 @@ function G(e, t, n, r) {
|
|
|
172
166
|
n.value = t.label, a?.appendChild(n);
|
|
173
167
|
}), e.setAttribute("list", t);
|
|
174
168
|
}
|
|
175
|
-
function
|
|
169
|
+
function G(e, t) {
|
|
176
170
|
let { stateField: n, stateControl: i, required: a } = e;
|
|
177
|
-
|
|
178
|
-
i.required = !1, i.disabled = !0;
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
i.disabled = !1, i.required = a;
|
|
171
|
+
r(n, n, "conditionalHidden", !t), n.toggleAttribute("data-formie-address-state-hidden", !t), t ? (i.disabled = !1, i.required = a) : (i.required = !1, i.disabled = !e.isCpEdit);
|
|
182
172
|
}
|
|
183
|
-
function
|
|
173
|
+
function K(e) {
|
|
184
174
|
if (e.fetchingAnnouncementEl) return e.fetchingAnnouncementEl;
|
|
185
175
|
let t = document.createElement("div");
|
|
186
|
-
return t.className = "formie-sr-only", t.setAttribute("data-formie-address-state-fetching-announce", "true"), t.setAttribute("aria-live", "polite"), t.setAttribute("aria-atomic", "true"), e.addressRoot.appendChild(t), e.fetchingAnnouncementEl = t, t;
|
|
176
|
+
return t.className = e.isCpEdit ? "visually-hidden" : "formie-sr-only", t.setAttribute("data-formie-address-state-fetching-announce", "true"), t.setAttribute("aria-live", "polite"), t.setAttribute("aria-atomic", "true"), e.addressRoot.appendChild(t), e.fetchingAnnouncementEl = t, t;
|
|
187
177
|
}
|
|
188
|
-
function
|
|
178
|
+
function q() {
|
|
189
179
|
let e = document.createElement("div");
|
|
190
180
|
e.className = "formie-address-state-skeleton", e.setAttribute("data-formie-address-state-skeleton", "true"), e.setAttribute("aria-hidden", "true");
|
|
191
181
|
let t = document.createElement("div");
|
|
192
182
|
return t.className = "formie-address-state-skeleton-input", e.appendChild(t), e;
|
|
193
183
|
}
|
|
194
|
-
function
|
|
195
|
-
e.addressRoot.setAttribute("data-formie-address-state-fetching", "true"), e.countryControl?.setAttribute("aria-busy", "true"), e.stateControl.setAttribute("aria-hidden", "true"), e.stateControl.setAttribute("tabindex", "-1"), r(e.stateField, e.stateField, "conditionalHidden", !1), e.stateField.removeAttribute("data-formie-
|
|
184
|
+
function J(e) {
|
|
185
|
+
e.addressRoot.setAttribute("data-formie-address-state-fetching", "true"), e.countryControl?.setAttribute("aria-busy", "true"), e.stateControl.setAttribute("aria-hidden", "true"), e.stateControl.setAttribute("tabindex", "-1"), r(e.stateField, e.stateField, "conditionalHidden", !1), e.stateField.removeAttribute("data-formie-address-state-hidden"), e.stateField.setAttribute("data-formie-address-state-skeleton-active", "true");
|
|
196
186
|
let t = e.stateField.querySelector("[data-formie-field-control]");
|
|
197
|
-
t instanceof HTMLElement && (e.skeletonEl || (e.skeletonEl =
|
|
187
|
+
t instanceof HTMLElement && (e.skeletonEl || (e.skeletonEl = q(), t.appendChild(e.skeletonEl)), e.skeletonEl.removeAttribute("hidden")), K(e).textContent = "Loading state or province options for the selected country.";
|
|
198
188
|
}
|
|
199
|
-
function
|
|
189
|
+
function Y(e) {
|
|
200
190
|
e.addressRoot.removeAttribute("data-formie-address-state-fetching"), e.countryControl?.removeAttribute("aria-busy"), e.stateControl.removeAttribute("aria-hidden"), e.stateControl.removeAttribute("tabindex"), e.stateField.removeAttribute("data-formie-address-state-skeleton-active"), e.skeletonEl?.setAttribute("hidden", "hidden"), e.fetchingAnnouncementEl && (e.fetchingAnnouncementEl.textContent = "");
|
|
201
191
|
}
|
|
202
|
-
function
|
|
192
|
+
function X(e, t) {
|
|
203
193
|
let n = w(e);
|
|
204
194
|
if (!n) return;
|
|
205
|
-
let r = n.querySelector("[data-formie-field-required]");
|
|
195
|
+
let r = n.querySelector("[data-formie-field-required], .required");
|
|
206
196
|
n.textContent = t, r && n.appendChild(r);
|
|
207
197
|
}
|
|
208
|
-
function
|
|
198
|
+
function Z(e, t, n) {
|
|
209
199
|
e.setAttribute("data-formie-combobox-input", "true"), s(e, "combobox", "before-init", {
|
|
210
200
|
select: e,
|
|
211
|
-
options: {
|
|
201
|
+
options: {
|
|
202
|
+
placeholder: t,
|
|
203
|
+
maxOptions: n
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
let r = c(e, {
|
|
207
|
+
placeholder: t,
|
|
208
|
+
maxOptions: n
|
|
212
209
|
});
|
|
213
|
-
let n = c(e, { placeholder: t });
|
|
214
210
|
return s(e, "combobox", "after-init", {
|
|
215
211
|
combobox: e._formieTomSelect,
|
|
216
|
-
options: {
|
|
217
|
-
|
|
212
|
+
options: {
|
|
213
|
+
placeholder: t,
|
|
214
|
+
maxOptions: n
|
|
215
|
+
}
|
|
216
|
+
}), r;
|
|
218
217
|
}
|
|
219
|
-
async function
|
|
218
|
+
async function Q(t, n) {
|
|
220
219
|
let { hideWhenUnused: r = !0, useSearchable: i = !0, useDatalist: a = !0, optionLabel: o = "name", optionValue: s = "name", placeholder: c = null, subdivisionsAction: l = h } = n, u = t.countryControl?.value?.trim() || "";
|
|
221
220
|
k(t);
|
|
222
|
-
let d = A(t), f = ++t.fetchGeneration;
|
|
221
|
+
let d = A(t), f = t.isCpEdit && !!d && u === t.initialCountry && d === t.initialValue, p = ++t.fetchGeneration;
|
|
223
222
|
if (t.comboboxCleanup?.(), t.comboboxCleanup = null, !u) {
|
|
224
|
-
if (
|
|
225
|
-
|
|
223
|
+
if (X(t.stateField, t.stateField.dataset.formieAddressStateDefaultLabel || "State / Province"), Y(t), r && !f) {
|
|
224
|
+
G(t, !1), D(t.stateControl, ""), O(t, ""), t.pendingStateValue = "", t.lastSubdivisions = [];
|
|
226
225
|
return;
|
|
227
226
|
}
|
|
228
|
-
if (
|
|
229
|
-
let e =
|
|
230
|
-
t.stateControl =
|
|
231
|
-
} else t.stateControl.disabled = !
|
|
227
|
+
if (G(t, !0), t.stateControl instanceof HTMLSelectElement) {
|
|
228
|
+
let e = V(t.stateControl, d);
|
|
229
|
+
t.stateControl = B(t.stateControl, e);
|
|
230
|
+
} else t.stateControl.disabled = !t.isCpEdit && !f, t.stateControl.placeholder = c || t.stateControl.placeholder;
|
|
232
231
|
t.lastSubdivisions = [];
|
|
233
232
|
return;
|
|
234
233
|
}
|
|
235
|
-
|
|
236
|
-
let
|
|
237
|
-
if (
|
|
238
|
-
let
|
|
239
|
-
|
|
240
|
-
|
|
234
|
+
P(N(u, o, s, l)) || J(t);
|
|
235
|
+
let m = await F(u, o, s, l, e(t.addressRoot.closest("form")));
|
|
236
|
+
if (p !== t.fetchGeneration) return;
|
|
237
|
+
let g = [...m?.subdivisions || []];
|
|
238
|
+
f && g.length && !I(d, g) && g.push({
|
|
239
|
+
label: d,
|
|
240
|
+
value: d
|
|
241
|
+
});
|
|
242
|
+
let _ = m?.administrativeAreaUsed ?? !0, v = m?.administrativeAreaLabel || "State / Province";
|
|
243
|
+
if (t.lastSubdivisions = g, Y(t), r && !_ && !f) {
|
|
244
|
+
G(t, !1), D(t.stateControl, ""), O(t, ""), t.pendingStateValue = "";
|
|
241
245
|
return;
|
|
242
246
|
}
|
|
243
|
-
if (
|
|
244
|
-
let e = t.stateControl instanceof HTMLSelectElement ? t.stateControl :
|
|
245
|
-
t.stateControl === e ? (
|
|
247
|
+
if (G(t, !0), X(t.stateField, v), g.length > 0) {
|
|
248
|
+
let e = t.stateControl instanceof HTMLSelectElement ? t.stateControl : U(t.stateControl, d, g, c);
|
|
249
|
+
t.stateControl === e ? (z(t.stateControl, e), H(e, g, c, e.value)) : t.stateControl = B(t.stateControl, e), i ? t.comboboxCleanup = Z(e, c, n.searchableOptionLimit) : e.removeAttribute("data-formie-combobox-input"), D(e, I(d, g) || d), j(t);
|
|
246
250
|
return;
|
|
247
251
|
}
|
|
248
|
-
let
|
|
249
|
-
t.stateControl !==
|
|
252
|
+
let y = t.stateControl instanceof HTMLInputElement ? t.stateControl : V(t.stateControl, d);
|
|
253
|
+
t.stateControl !== y && (t.stateControl = B(t.stateControl, y)), y.disabled = !1, W(y, t.datalistId, g, a), D(y, d), j(t);
|
|
250
254
|
}
|
|
251
|
-
function
|
|
255
|
+
function te(e, t) {
|
|
252
256
|
let n = () => {
|
|
253
|
-
k(e), e.countryControl?.value?.trim() && (e.lastCountry = "",
|
|
254
|
-
|
|
257
|
+
k(e), e.countryControl?.value?.trim() && (e.lastCountry = "", Q(e, t).then(() => {
|
|
258
|
+
j(e);
|
|
255
259
|
}));
|
|
256
260
|
};
|
|
257
261
|
_.forEach((t) => {
|
|
@@ -259,7 +263,7 @@ function ee(e, t) {
|
|
|
259
263
|
e.autofillSweepTimers.push(r);
|
|
260
264
|
});
|
|
261
265
|
}
|
|
262
|
-
function
|
|
266
|
+
function $(e) {
|
|
263
267
|
e.countryChangeTimer !== null && (window.clearTimeout(e.countryChangeTimer), e.countryChangeTimer = null), e.autofillSweepTimers.forEach((e) => {
|
|
264
268
|
window.clearTimeout(e);
|
|
265
269
|
}), e.autofillSweepTimers = [];
|
|
@@ -273,6 +277,9 @@ function ne(e, t) {
|
|
|
273
277
|
i && !e.dataset.formieAddressStateDefaultLabel && (e.dataset.formieAddressStateDefaultLabel = i.textContent?.trim() || "State / Province");
|
|
274
278
|
let a = {
|
|
275
279
|
addressRoot: n,
|
|
280
|
+
isCpEdit: r.hasAttribute("data-formie-address-state-cp"),
|
|
281
|
+
initialCountry: S(n)?.value?.trim() || "",
|
|
282
|
+
initialValue: r.value?.trim() || "",
|
|
276
283
|
stateField: e,
|
|
277
284
|
stateControl: r,
|
|
278
285
|
countryControl: S(n),
|
|
@@ -288,50 +295,44 @@ function ne(e, t) {
|
|
|
288
295
|
fetchGeneration: 0,
|
|
289
296
|
required: r.required,
|
|
290
297
|
lastSubdivisions: []
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
let
|
|
298
|
+
}, o = r.value, s = e.closest("form"), c = !1, d = null;
|
|
299
|
+
ee(a);
|
|
300
|
+
let p = (e = !1) => {
|
|
294
301
|
let n = a.countryControl?.value?.trim() || "";
|
|
295
302
|
if (!e && n === a.lastCountry) return;
|
|
296
303
|
let r = a.lastCountry, i = A(a);
|
|
297
|
-
a.lastCountry = n,
|
|
298
|
-
|
|
304
|
+
a.lastCountry = n, Q(a, t).then(() => {
|
|
305
|
+
j(a), r && n && r !== n && !I(i, a.lastSubdivisions) && !A(a) && (D(a.stateControl, ""), O(a, ""));
|
|
299
306
|
});
|
|
300
|
-
},
|
|
307
|
+
}, m = () => {
|
|
301
308
|
a.countryChangeTimer !== null && window.clearTimeout(a.countryChangeTimer), a.countryChangeTimer = window.setTimeout(() => {
|
|
302
|
-
a.countryChangeTimer = null, k(a),
|
|
309
|
+
a.countryChangeTimer = null, k(a), p(!0);
|
|
303
310
|
}, 50);
|
|
304
|
-
},
|
|
311
|
+
}, h = (e) => {
|
|
305
312
|
let n = e.target;
|
|
306
313
|
if (!(n instanceof HTMLInputElement || n instanceof HTMLSelectElement)) return;
|
|
307
314
|
let r = n === a.autofillAnchor, i = n.matches(l) || n.matches(u);
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
a.lastCountry = "", $(a, t).then(() => {
|
|
314
|
-
M(a);
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
}, d = (e) => {
|
|
315
|
+
(r || i) && (i && !r && (O(a, n.value), a.pendingStateValue = n.value), k(a), a.countryControl?.value?.trim() && (a.lastSubdivisions.length > 0 ? j(a) : (a.lastCountry = "", Q(a, t).then(() => {
|
|
316
|
+
j(a);
|
|
317
|
+
}))));
|
|
318
|
+
}, g = (e) => {
|
|
318
319
|
if (e.animationName !== f) return;
|
|
319
320
|
let r = e.target;
|
|
320
|
-
(r instanceof HTMLInputElement || r instanceof HTMLSelectElement) && n.contains(r) && (k(a), a.countryControl?.value?.trim() && (a.lastCountry = "",
|
|
321
|
-
|
|
321
|
+
(r instanceof HTMLInputElement || r instanceof HTMLSelectElement) && n.contains(r) && (k(a), a.countryControl?.value?.trim() && (a.lastCountry = "", Q(a, t).then(() => {
|
|
322
|
+
j(a);
|
|
322
323
|
})));
|
|
323
|
-
},
|
|
324
|
+
}, _ = (e) => {
|
|
324
325
|
let n = e.detail?.state?.trim();
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
});
|
|
326
|
+
n ? (a.pendingStateValue = n, O(a, n), Q(a, t).then(() => {
|
|
327
|
+
j(a), a.lastCountry = a.countryControl?.value?.trim() || "";
|
|
328
|
+
})) : p();
|
|
329
|
+
}, y = (e) => {
|
|
330
|
+
d !== null && window.clearTimeout(d), d = window.setTimeout(() => {
|
|
331
|
+
d = null, !(e.defaultPrevented || c) && ($(a), a.stateControl.value = "", a.pendingStateValue = o, O(a, o), p(!0));
|
|
332
|
+
}, 0);
|
|
332
333
|
};
|
|
333
|
-
return a.countryControl?.addEventListener("change",
|
|
334
|
-
|
|
334
|
+
return s?.addEventListener("reset", y), a.countryControl?.addEventListener("change", m), a.countryControl?.addEventListener("input", m), n.addEventListener("input", h), n.addEventListener("change", h), n.addEventListener("animationstart", g), n.addEventListener("formie:address:google:populate", _), n.addEventListener("formie:address:address-finder:populate", _), n.addEventListener("formie:address:loqate:populate", _), n.addEventListener("formie:address:place-kit:populate", _), p(!0), te(a, t), () => {
|
|
335
|
+
c = !0, d !== null && window.clearTimeout(d), a.fetchGeneration++, s?.removeEventListener("reset", y), $(a), Y(a), a.skeletonEl?.remove(), a.fetchingAnnouncementEl?.remove(), a.autofillAnchor?.remove(), a.comboboxCleanup?.(), a.countryControl?.removeEventListener("change", m), a.countryControl?.removeEventListener("input", m), n.removeEventListener("input", h), n.removeEventListener("change", h), n.removeEventListener("animationstart", g), n.removeEventListener("formie:address:google:populate", _), n.removeEventListener("formie:address:address-finder:populate", _), n.removeEventListener("formie:address:loqate:populate", _), n.removeEventListener("formie:address:place-kit:populate", _);
|
|
335
336
|
};
|
|
336
337
|
}
|
|
337
338
|
var re = {
|