@verbb/formie-browser 1.0.15 → 1.0.17-next.6.ge714580bc362
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 +40 -0
- package/dist/chunks/{address-country-BcEQKw0T.js → address-country-DLJF-OkC.js} +4 -8
- package/dist/chunks/{address-finder-BWGINCSA.js → address-finder-QK1m1eyv.js} +1 -1
- package/dist/chunks/{address-state-DI3ndhMU.js → address-state-CHKit8AW.js} +26 -35
- package/dist/chunks/{api-BK9b340y.js → api-BPtH5RBA.js} +152 -120
- package/dist/chunks/{api-Dxl_CKw-.js → api-BR2Gqy37.js} +306 -301
- package/dist/chunks/{api-ghNr2uxX.js → api-CmuOZ0i3.js} +1 -1
- package/dist/chunks/{bpoint-BwtuyN_O.js → bpoint-GvYfyPjD.js} +1 -1
- package/dist/chunks/{calculations-YEoVCG2q.js → calculations-DeEmdUDq.js} +5 -7
- package/dist/chunks/{captcha-eu-DWLoQFKB.js → captcha-eu-eU_M6snp.js} +1 -1
- package/dist/chunks/{checkbox-radio-gsm8QPJg.js → checkbox-radio-CSXo6svm.js} +4 -12
- package/dist/chunks/{combobox-Ba08_cHL.js → combobox-CJh2DoSO.js} +292 -333
- package/dist/chunks/{conditions-Ceeg6ReZ.js → conditions-Dz3068K0.js} +56 -72
- 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-DaPvMrop.js → date-picker-BVJxJVYT.js} +30 -47
- 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-uw0DzU-L.js → eway-BZuTBAUW.js} +1 -1
- package/dist/chunks/{field-references.resolver-Ca8MguFv.js → field-references.resolver-uSHf5-NP.js} +1 -1
- package/dist/chunks/{file-upload-B8_mH012.js → file-upload-vEUr_EuP.js} +114 -108
- package/dist/chunks/{friendly-captcha-v1-CVXaXgDO.js → friendly-captcha-v1-C_cF1WD2.js} +2 -2
- package/dist/chunks/{friendly-captcha-v2-DkeIVTKI.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-c4wLJdOt.js → go-cardless-DWZeB0Bq.js} +2 -6
- package/dist/chunks/{google-address-JHYvjwgN.js → google-address-DQR6rsbh.js} +2 -2
- package/dist/chunks/{hcaptcha-Dt3ELLlP.js → hcaptcha-lseqzFTP.js} +14 -14
- 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-m51iPyO1.js → loqate-ZZClcacr.js} +1 -1
- package/dist/chunks/{mollie-Bn0PX173.js → mollie-8OMXIYa8.js} +2 -6
- package/dist/chunks/{moneris-BRbUvI4t.js → moneris-qYHJ9EFy.js} +1 -1
- package/dist/chunks/opayo-DlWPEnla.js +159 -0
- package/dist/chunks/{paddle-CympHVvd.js → paddle-CArfWih0.js} +1 -1
- package/dist/chunks/{password-validation-C8_uO_c_.js → password-validation-HGOU9kf3.js} +2 -2
- package/dist/chunks/{paypal-h75h6wae.js → paypal-BcaMCMGY.js} +1 -1
- package/dist/chunks/{payway-C9rHTCC_.js → payway-vxC7_bfR.js} +3 -11
- package/dist/chunks/{phone-country-B8fv-L5_.js → phone-country-Bx9EG50h.js} +123 -140
- package/dist/chunks/{place-kit-BnZGQ-L1.js → place-kit-BKk8xDXf.js} +2 -2
- package/dist/chunks/{placekit-autocomplete.esm-CZZERYur.js → placekit-autocomplete.esm-D2A_0iVU.js} +2 -5
- package/dist/chunks/{recaptcha-enterprise-CUs8BO6V.js → recaptcha-enterprise-Cx6HUpMa.js} +6 -12
- package/dist/chunks/recaptcha-shared-CcMI-r8t.js +33 -0
- package/dist/chunks/{recaptcha-v2-checkbox-P1McW4Pv.js → recaptcha-v2-checkbox-DQ9BJzcv.js} +2 -2
- package/dist/chunks/{recaptcha-v2-invisible-FGDqozSP.js → recaptcha-v2-invisible-BP0T8Pan.js} +2 -2
- package/dist/chunks/recaptcha-v3-DKMGQ27K.js +38 -0
- package/dist/chunks/{repeater-CyhDbozO.js → repeater-BR0RUvTs.js} +3 -7
- 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/{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/{snaptcha-C3QLYxFT.js → snaptcha-P3EoSQud.js} +1 -1
- package/dist/chunks/{square-C1z5DPVw.js → square-Dyz0p_GU.js} +1 -1
- package/dist/chunks/{stripe-Dmkdkq1y.js → stripe-Bfd_jp_k.js} +3 -6
- package/dist/chunks/{summary-Bn-g5SDx.js → summary-B3CAebLV.js} +44 -36
- 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-j7MlLLCc.js → table-0k6Md0IO.js} +1 -1
- package/dist/chunks/{text-limit-LGMPhFuC.js → text-limit-CTVML6s7.js} +10 -10
- package/dist/chunks/{turnstile-ptihQfLl.js → turnstile-Sp4ubowK.js} +1 -1
- package/dist/chunks/{upload-manager-BW7l-BhF.js → upload-manager-Ccg3d_4I.js} +11 -25
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +733 -720
- 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.map +1 -1
- package/dist/js/core/validation-focus.d.ts.map +1 -1
- package/dist/js/modules/captchas/factories.d.ts.map +1 -1
- package/dist/js/modules/captchas/hcaptcha.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.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/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/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/theme/message-attributes.d.ts +4 -0
- package/dist/js/theme/message-attributes.d.ts.map +1 -0
- package/dist/js/transport/forms-api.d.ts +1 -1
- package/dist/js/transport/forms-api.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 +7 -5
- package/src/index.ts +1 -0
- package/src/js/core/create-formie-client.ts +35 -21
- 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 +13 -2
- package/src/js/core/submit-result-ui.ts +25 -1
- package/src/js/core/validation-focus.ts +17 -3
- package/src/js/modules/captchas/factories.ts +241 -101
- package/src/js/modules/captchas/hcaptcha.ts +3 -2
- 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-state.ts +6 -4
- package/src/js/modules/fields/combobox.ts +19 -1
- package/src/js/modules/fields/conditions.ts +3 -0
- package/src/js/modules/fields/file-upload.ts +11 -4
- package/src/js/modules/fields/phone-country.ts +23 -0
- 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/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/theme/message-attributes.ts +54 -0
- package/src/js/transport/forms-api.ts +6 -1
- 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 +6 -0
- package/src/js/validation/submit-readiness.ts +2 -0
- package/src/js/validation/validator.ts +15 -4
- package/src/vendor.d.ts +2 -0
- package/dist/chunks/opayo-BwWdInEP.js +0 -188
- package/dist/chunks/recaptcha-shared-DTbTw-MF.js +0 -27
- package/dist/chunks/recaptcha-v3-CflUHeZD.js +0 -28
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Fixed
|
|
6
|
+
- Fixed invisible hCaptcha challenges timing out before they could be completed, requiring a second submit click. ([#3067](https://github.com/verbb/formie/issues/3067))
|
|
7
|
+
- Fixed token refreshes losing the form's site on multisite installations with path-based URLs. ([#3064](https://github.com/verbb/formie/issues/3064))
|
|
8
|
+
- Fixed theme attributes not being applied to AJAX success and error messages. ([#3061](https://github.com/verbb/formie/issues/3061))
|
|
9
|
+
- Fixed nested alert roles in form error messages that could cause duplicate screen reader announcements. ([#3062](https://github.com/verbb/formie/issues/3062))
|
|
10
|
+
- Fixed Opayo re-tokenizing cards and requesting unnecessary merchant sessions after completing a 3D Secure challenge. ([#3048](https://github.com/verbb/formie/issues/3048))
|
|
11
|
+
|
|
12
|
+
## 1.0.16 - 2026-10-28
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- Added configurable display limits for searchable dropdowns, defaulting to 100 while searching all options. ([#3059](https://github.com/verbb/formie/issues/3059))
|
|
16
|
+
- Add a keyboard-accessible clear button for single searchable Dropdown fields with placeholders. ([#3058](https://github.com/verbb/formie/issues/3058))
|
|
17
|
+
- Add the `formie:unload-warning:collect-exclusions` event for integrations to exclude automatically updated transport fields from unsaved-changes checks.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- Updated the package build toolchain to Vite 8.3.4.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- 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))
|
|
24
|
+
- 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))
|
|
25
|
+
- Fixed page-reload submissions stalling when the submit delay is zero.
|
|
26
|
+
- 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))
|
|
27
|
+
- Fixed “Scroll To Top” having no effect after successful AJAX submissions. ([#3023](https://github.com/verbb/formie/issues/3023))
|
|
28
|
+
- Fixed summary fields remaining blank after AJAX page navigation.
|
|
29
|
+
- Fixed summary fields repeatedly retrying failed requests.
|
|
30
|
+
- Fixed text counters and phone countries not returning to their initial values when forms reset.
|
|
31
|
+
- Fixed rich-text validation errors failing to focus and describe the editable control.
|
|
32
|
+
- Fixed required table fields incorrectly requiring every cell to have a value.
|
|
33
|
+
- Fixed dependent calculations using number prefixes or suffixes returning incorrect results.
|
|
34
|
+
- Fixed fresh visits and completed submissions retaining an earlier spam-protection timer.
|
|
35
|
+
- Fixed forms freezing when live validation and disabling the submit button until valid are both enabled.
|
|
36
|
+
- Fixed native file input metadata requests omitting CSRF tokens and form context after navigating between pages.
|
|
37
|
+
- 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.
|
|
38
|
+
- Fixed reCAPTCHA v3 inline badges rendering outside the form. ([#3016](https://github.com/verbb/formie/issues/3016))
|
|
39
|
+
- 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))
|
|
40
|
+
- Fixed initial conditional field visibility triggering an unsaved-changes warning after native submissions.
|
|
41
|
+
- Fixed edits made immediately after mounting a form being treated as saved.
|
|
42
|
+
- Fixed CAPTCHA teardown leaving widgets or callbacks active after failed setup, pending mounts or provider cleanup errors.
|
|
43
|
+
- Fixed CAPTCHA widgets with a numeric zero handle failing to challenge or reset.
|
|
44
|
+
|
|
5
45
|
## 1.0.15 - 2026-10-15
|
|
6
46
|
|
|
7
47
|
### Changed
|
|
@@ -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) {
|
|
@@ -42,11 +42,7 @@ async function f(e, n) {
|
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { n as e } from "./event-names-BCI2FLD8.js";
|
|
2
|
-
import { t } from "./api-
|
|
2
|
+
import { t } from "./api-CmuOZ0i3.js";
|
|
3
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({
|
|
@@ -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,
|
|
@@ -123,11 +123,7 @@ function L(e, t) {
|
|
|
123
123
|
"data-formie-address-state-option-value"
|
|
124
124
|
].forEach((n) => {
|
|
125
125
|
let r = e.getAttribute(n);
|
|
126
|
-
|
|
127
|
-
t.removeAttribute(n);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
t.setAttribute(n, r);
|
|
126
|
+
r === null ? t.removeAttribute(n) : t.setAttribute(n, r);
|
|
131
127
|
});
|
|
132
128
|
}
|
|
133
129
|
function R(e, t) {
|
|
@@ -172,11 +168,7 @@ function W(e, t, n, r) {
|
|
|
172
168
|
}
|
|
173
169
|
function G(e, t) {
|
|
174
170
|
let { stateField: n, stateControl: i, required: a } = e;
|
|
175
|
-
|
|
176
|
-
i.required = !1, i.disabled = !e.isCpEdit;
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
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);
|
|
180
172
|
}
|
|
181
173
|
function K(e) {
|
|
182
174
|
if (e.fetchingAnnouncementEl) return e.fetchingAnnouncementEl;
|
|
@@ -203,16 +195,25 @@ function X(e, t) {
|
|
|
203
195
|
let r = n.querySelector("[data-formie-field-required], .required");
|
|
204
196
|
n.textContent = t, r && n.appendChild(r);
|
|
205
197
|
}
|
|
206
|
-
function Z(e, t) {
|
|
198
|
+
function Z(e, t, n) {
|
|
207
199
|
e.setAttribute("data-formie-combobox-input", "true"), s(e, "combobox", "before-init", {
|
|
208
200
|
select: e,
|
|
209
|
-
options: {
|
|
201
|
+
options: {
|
|
202
|
+
placeholder: t,
|
|
203
|
+
maxOptions: n
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
let r = c(e, {
|
|
207
|
+
placeholder: t,
|
|
208
|
+
maxOptions: n
|
|
210
209
|
});
|
|
211
|
-
let n = c(e, { placeholder: t });
|
|
212
210
|
return s(e, "combobox", "after-init", {
|
|
213
211
|
combobox: e._formieTomSelect,
|
|
214
|
-
options: {
|
|
215
|
-
|
|
212
|
+
options: {
|
|
213
|
+
placeholder: t,
|
|
214
|
+
maxOptions: n
|
|
215
|
+
}
|
|
216
|
+
}), r;
|
|
216
217
|
}
|
|
217
218
|
async function Q(t, n) {
|
|
218
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() || "";
|
|
@@ -245,7 +246,7 @@ async function Q(t, n) {
|
|
|
245
246
|
}
|
|
246
247
|
if (G(t, !0), X(t.stateField, v), g.length > 0) {
|
|
247
248
|
let e = t.stateControl instanceof HTMLSelectElement ? t.stateControl : U(t.stateControl, d, g, c);
|
|
248
|
-
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) : e.removeAttribute("data-formie-combobox-input"), D(e, I(d, g) || d), j(t);
|
|
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);
|
|
249
250
|
return;
|
|
250
251
|
}
|
|
251
252
|
let y = t.stateControl instanceof HTMLInputElement ? t.stateControl : V(t.stateControl, d);
|
|
@@ -311,15 +312,9 @@ function ne(e, t) {
|
|
|
311
312
|
let n = e.target;
|
|
312
313
|
if (!(n instanceof HTMLInputElement || n instanceof HTMLSelectElement)) return;
|
|
313
314
|
let r = n === a.autofillAnchor, i = n.matches(l) || n.matches(u);
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
a.lastCountry = "", Q(a, t).then(() => {
|
|
320
|
-
j(a);
|
|
321
|
-
});
|
|
322
|
-
}
|
|
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
|
+
}))));
|
|
323
318
|
}, g = (e) => {
|
|
324
319
|
if (e.animationName !== f) return;
|
|
325
320
|
let r = e.target;
|
|
@@ -328,13 +323,9 @@ function ne(e, t) {
|
|
|
328
323
|
})));
|
|
329
324
|
}, _ = (e) => {
|
|
330
325
|
let n = e.detail?.state?.trim();
|
|
331
|
-
|
|
332
|
-
p();
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
a.pendingStateValue = n, O(a, n), Q(a, t).then(() => {
|
|
326
|
+
n ? (a.pendingStateValue = n, O(a, n), Q(a, t).then(() => {
|
|
336
327
|
j(a), a.lastCountry = a.countryControl?.value?.trim() || "";
|
|
337
|
-
});
|
|
328
|
+
})) : p();
|
|
338
329
|
}, y = (e) => {
|
|
339
330
|
d !== null && window.clearTimeout(d), d = window.setTimeout(() => {
|
|
340
331
|
d = null, !(e.defaultPrevented || c) && ($(a), a.stateControl.value = "", a.pendingStateValue = o, O(a, o), p(!0));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e } from "./event-names-BCI2FLD8.js";
|
|
2
|
-
import { t } from "./debug-
|
|
2
|
+
import { t } from "./debug-rhzqP1j2.js";
|
|
3
3
|
import { t as n } from "./theme-classes-DAQuEqdP.js";
|
|
4
4
|
import { n as r, t as i } from "./async-2GdXNFCE.js";
|
|
5
5
|
import { i as a } from "./i18n-BY1ds1BL.js";
|
|
@@ -98,17 +98,18 @@ function O(e, t) {
|
|
|
98
98
|
return !n || typeof n != "object" ? null : n;
|
|
99
99
|
}
|
|
100
100
|
function k(e, t, n, r) {
|
|
101
|
-
let a = /* @__PURE__ */ new Set(), o = () => {
|
|
102
|
-
|
|
101
|
+
let a = /* @__PURE__ */ new Set(), o = !0, s = () => {
|
|
102
|
+
if (!o) return;
|
|
103
|
+
let i = x(e, t), s = new Set(i.filter((e) => S(e)));
|
|
103
104
|
i.forEach((e) => {
|
|
104
|
-
|
|
105
|
+
s.has(e) && !a.has(e) && (a.add(e), n(e));
|
|
105
106
|
}), Array.from(a).forEach((e) => {
|
|
106
|
-
|
|
107
|
+
s.has(e) || (a.delete(e), r(e));
|
|
107
108
|
});
|
|
108
|
-
},
|
|
109
|
-
|
|
109
|
+
}, c = i(s, 20), l = new MutationObserver(() => {
|
|
110
|
+
c();
|
|
110
111
|
});
|
|
111
|
-
|
|
112
|
+
l.observe(e, {
|
|
112
113
|
childList: !0,
|
|
113
114
|
subtree: !0,
|
|
114
115
|
attributes: !0,
|
|
@@ -120,25 +121,21 @@ function k(e, t, n, r) {
|
|
|
120
121
|
"data-formie-page-hidden"
|
|
121
122
|
]
|
|
122
123
|
});
|
|
123
|
-
let
|
|
124
|
-
|
|
124
|
+
let u = [b(window, "resize", () => {
|
|
125
|
+
c();
|
|
125
126
|
}), ...v.map((t) => b(e, t, () => {
|
|
126
|
-
|
|
127
|
-
o();
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
s();
|
|
127
|
+
y.has(t) ? s() : c();
|
|
131
128
|
}))];
|
|
132
|
-
return
|
|
129
|
+
return s(), {
|
|
133
130
|
cleanup: () => {
|
|
134
|
-
|
|
131
|
+
o && (o = !1, l.disconnect(), u.forEach((e) => {
|
|
135
132
|
e();
|
|
136
133
|
}), Array.from(a).forEach((e) => {
|
|
137
134
|
r(e);
|
|
138
|
-
}), a.clear();
|
|
135
|
+
}), a.clear());
|
|
139
136
|
},
|
|
140
|
-
reconcile:
|
|
141
|
-
reconcileImmediate:
|
|
137
|
+
reconcile: c,
|
|
138
|
+
reconcileImmediate: s,
|
|
142
139
|
getVisible: () => x(e, t).filter((e) => S(e))
|
|
143
140
|
};
|
|
144
141
|
}
|
|
@@ -162,15 +159,15 @@ function j(e, t, { defaultPlaceholderSelector: n, defaultTokenFieldNames: r = []
|
|
|
162
159
|
provider: c
|
|
163
160
|
};
|
|
164
161
|
}
|
|
165
|
-
function M(e, t) {
|
|
166
|
-
let
|
|
162
|
+
function M(e, t, n = {}) {
|
|
163
|
+
let r = e.form || e.root, i = t.ui.placeholderSelector, a = t.handle;
|
|
167
164
|
return {
|
|
168
165
|
form: e.form,
|
|
169
166
|
root: e.root,
|
|
170
167
|
placeholder: {
|
|
171
|
-
query: () => x(e.root,
|
|
172
|
-
getPrimary: () => C(e.root,
|
|
173
|
-
observe: (t, n) => k(e.root,
|
|
168
|
+
query: () => x(e.root, i),
|
|
169
|
+
getPrimary: () => C(e.root, i),
|
|
170
|
+
observe: (t, n) => k(e.root, i, t, n),
|
|
174
171
|
createContainer: (e) => w(e),
|
|
175
172
|
clear: (e) => {
|
|
176
173
|
e && (T(e), e.innerHTML = "");
|
|
@@ -178,35 +175,35 @@ function M(e, t) {
|
|
|
178
175
|
},
|
|
179
176
|
errors: {
|
|
180
177
|
getDefaultMessage: () => t.ui.errorMessage,
|
|
181
|
-
show: (
|
|
182
|
-
E(
|
|
178
|
+
show: (r, a) => {
|
|
179
|
+
n.isActive?.() !== !1 && E(a || C(e.root, i), r || t.ui.errorMessage, e.form || e.root);
|
|
183
180
|
},
|
|
184
181
|
clear: (t) => {
|
|
185
|
-
T(t || C(e.root,
|
|
182
|
+
n.isActive?.() !== !1 && T(t || C(e.root, i));
|
|
186
183
|
}
|
|
187
184
|
},
|
|
188
185
|
tokens: {
|
|
189
186
|
names: t.transport.tokenFieldNames,
|
|
190
|
-
has: (e = t.transport.tokenFieldNames,
|
|
191
|
-
read: (e = t.transport.tokenFieldNames[0],
|
|
192
|
-
write: (
|
|
193
|
-
|
|
194
|
-
m(
|
|
195
|
-
value:
|
|
196
|
-
container:
|
|
187
|
+
has: (e = t.transport.tokenFieldNames, n = r) => f(n, e),
|
|
188
|
+
read: (e = t.transport.tokenFieldNames[0], n = r) => e ? d(n, e) : "",
|
|
189
|
+
write: (i, { names: a = t.transport.tokenFieldNames, root: o = r, container: s = e.form } = {}) => {
|
|
190
|
+
n.isActive?.() !== !1 && (n.onTokenFieldNames?.(a), a.forEach((e) => {
|
|
191
|
+
m(o, e, {
|
|
192
|
+
value: i,
|
|
193
|
+
container: s
|
|
197
194
|
});
|
|
198
|
-
});
|
|
195
|
+
}));
|
|
199
196
|
},
|
|
200
|
-
clear: (e = t.transport.tokenFieldNames,
|
|
201
|
-
p(
|
|
197
|
+
clear: (e = t.transport.tokenFieldNames, i = r) => {
|
|
198
|
+
n.isActive?.() !== !1 && p(i, e);
|
|
202
199
|
},
|
|
203
|
-
wait: (e = t.transport.waitForValueMs,
|
|
200
|
+
wait: (e = t.transport.waitForValueMs, n = t.transport.tokenFieldNames, i = r) => h(i, n, e)
|
|
204
201
|
},
|
|
205
202
|
refresh: {
|
|
206
|
-
providerHandle:
|
|
203
|
+
providerHandle: a,
|
|
207
204
|
onTokensRefreshed: (t) => {
|
|
208
205
|
let n = ["formie:refresh-tokens:after", "formie:refresh-tokens:refreshed"].map((n) => b(e.root, n, (e) => {
|
|
209
|
-
let n = O(D(e),
|
|
206
|
+
let n = O(D(e), a);
|
|
210
207
|
n && t(n);
|
|
211
208
|
}));
|
|
212
209
|
return () => {
|
|
@@ -249,22 +246,45 @@ function P({ moduleId: e, defaultPlaceholderSelector: t, defaultTokenFieldNames:
|
|
|
249
246
|
if (!e) throw Error("The CAPTCHA needs a supported placeholder in the client-rendered form.");
|
|
250
247
|
s = document.createElement("div"), s.setAttribute(e, ""), (a.form ?? a.root).append(s);
|
|
251
248
|
}
|
|
252
|
-
let c =
|
|
253
|
-
|
|
254
|
-
options: o,
|
|
255
|
-
services: c
|
|
256
|
-
});
|
|
257
|
-
if (!l) {
|
|
258
|
-
s?.remove();
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
let u = l.destroy;
|
|
262
|
-
return {
|
|
263
|
-
...l,
|
|
264
|
-
destroy: async () => {
|
|
265
|
-
await u(), s?.remove();
|
|
266
|
-
}
|
|
249
|
+
let c = new Set(o.transport.tokenFieldNames), l = !0, u = (e) => {
|
|
250
|
+
e.filter(Boolean).forEach((e) => c.add(e));
|
|
267
251
|
};
|
|
252
|
+
u(o.transport.sessionKey ? [o.transport.sessionKey] : []);
|
|
253
|
+
let d = M(a, o, {
|
|
254
|
+
onTokenFieldNames: u,
|
|
255
|
+
isActive: () => l
|
|
256
|
+
}), f = d.events.onForm("formie:unload-warning:collect-exclusions", (e) => {
|
|
257
|
+
let t = e.detail;
|
|
258
|
+
t?.form === a.form && t.exclude(...c);
|
|
259
|
+
}), p = d.refresh.onTokensRefreshed((e) => {
|
|
260
|
+
typeof e.sessionKey == "string" && e.sessionKey.trim() !== "" && u([e.sessionKey.trim()]);
|
|
261
|
+
}), m = () => {
|
|
262
|
+
l = !1, f(), p(), s?.remove();
|
|
263
|
+
};
|
|
264
|
+
try {
|
|
265
|
+
let e = await i({
|
|
266
|
+
...a,
|
|
267
|
+
options: o,
|
|
268
|
+
services: d
|
|
269
|
+
});
|
|
270
|
+
if (!e) {
|
|
271
|
+
m();
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
let t = e.destroy;
|
|
275
|
+
return {
|
|
276
|
+
...e,
|
|
277
|
+
destroy: async () => {
|
|
278
|
+
try {
|
|
279
|
+
await t();
|
|
280
|
+
} finally {
|
|
281
|
+
m();
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
} catch (e) {
|
|
286
|
+
throw m(), e;
|
|
287
|
+
}
|
|
268
288
|
}
|
|
269
289
|
};
|
|
270
290
|
}
|
|
@@ -316,28 +336,38 @@ function I(t) {
|
|
|
316
336
|
defaultPlaceholderSelector: t.defaultPlaceholderSelector,
|
|
317
337
|
defaultTokenFieldNames: t.defaultTokenFieldNames,
|
|
318
338
|
setup: async (n) => {
|
|
319
|
-
let r = [], i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = n.services.placeholder.getPrimary(),
|
|
320
|
-
let r =
|
|
321
|
-
if (
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
339
|
+
let r = [], i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = null, c = n.services.placeholder.getPrimary(), l = !1, u, d = null, f = async () => (d ||= (N.log("Loading captcha provider API.", { moduleId: t.moduleId }), t.load(n)), d), p = (e) => {
|
|
340
|
+
let r = o.get(e);
|
|
341
|
+
if (r) return r;
|
|
342
|
+
let s = (async () => {
|
|
343
|
+
await a.get(e)?.catch(() => {}), n.services.errors.clear(e);
|
|
344
|
+
let r = i.has(e), o = i.get(e);
|
|
345
|
+
i.delete(e);
|
|
346
|
+
try {
|
|
347
|
+
if (r && t.unmount) {
|
|
348
|
+
let r = await f();
|
|
349
|
+
await t.unmount({
|
|
350
|
+
api: r,
|
|
351
|
+
widget: o,
|
|
352
|
+
placeholder: e,
|
|
353
|
+
services: n.services,
|
|
354
|
+
options: n.options,
|
|
355
|
+
provider: n.options.provider
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
} finally {
|
|
359
|
+
e.innerHTML = "", n.services.tokens.clear(), c === e && (c = n.services.placeholder.getPrimary());
|
|
360
|
+
}
|
|
361
|
+
})().finally(() => o.delete(e));
|
|
362
|
+
return o.set(e, s), s;
|
|
363
|
+
}, m = async (e) => {
|
|
364
|
+
let r = o.get(e);
|
|
365
|
+
if (r && await r, l || i.has(e)) return;
|
|
336
366
|
if (a.has(e)) return a.get(e);
|
|
337
|
-
let
|
|
338
|
-
let r = await
|
|
339
|
-
if (
|
|
340
|
-
let a = n.services.placeholder.createContainer(e),
|
|
367
|
+
let s = (async () => {
|
|
368
|
+
let r = await f();
|
|
369
|
+
if (l || i.has(e)) return;
|
|
370
|
+
let a = n.services.placeholder.createContainer(e), o = await t.mount({
|
|
341
371
|
api: r,
|
|
342
372
|
placeholder: e,
|
|
343
373
|
container: a,
|
|
@@ -345,30 +375,29 @@ function I(t) {
|
|
|
345
375
|
options: n.options,
|
|
346
376
|
provider: n.options.provider
|
|
347
377
|
});
|
|
348
|
-
i.set(e,
|
|
378
|
+
i.set(e, o), c = e, N.log("Mounted captcha placeholder widget.", { moduleId: t.moduleId });
|
|
349
379
|
})().finally(() => {
|
|
350
380
|
a.delete(e);
|
|
351
381
|
});
|
|
352
|
-
a.set(e,
|
|
353
|
-
},
|
|
354
|
-
|
|
355
|
-
|
|
382
|
+
a.set(e, s), await s;
|
|
383
|
+
}, h = n.services.placeholder.observe((e) => {
|
|
384
|
+
c = e, m(e).catch((e) => {
|
|
385
|
+
u = e;
|
|
356
386
|
});
|
|
357
387
|
}, (e) => {
|
|
358
|
-
|
|
388
|
+
l || p(e).catch((e) => {
|
|
389
|
+
u = e;
|
|
390
|
+
});
|
|
359
391
|
});
|
|
360
|
-
r.push(
|
|
361
|
-
let
|
|
362
|
-
|
|
392
|
+
r.push(h.cleanup);
|
|
393
|
+
let g = async (e) => {
|
|
394
|
+
if (l) return;
|
|
395
|
+
let r = h.getVisible();
|
|
363
396
|
if (t.reset) {
|
|
364
|
-
let a = await
|
|
397
|
+
let a = await f();
|
|
365
398
|
for (let o of r) {
|
|
366
399
|
let r = i.get(o);
|
|
367
|
-
|
|
368
|
-
await f(o);
|
|
369
|
-
continue;
|
|
370
|
-
}
|
|
371
|
-
await t.reset({
|
|
400
|
+
i.has(o) ? (await t.reset({
|
|
372
401
|
api: a,
|
|
373
402
|
widget: r,
|
|
374
403
|
placeholder: o,
|
|
@@ -376,55 +405,58 @@ function I(t) {
|
|
|
376
405
|
options: n.options,
|
|
377
406
|
provider: n.options.provider,
|
|
378
407
|
reason: e
|
|
379
|
-
}), n.services.tokens.clear(), n.services.errors.clear(o);
|
|
408
|
+
}), n.services.tokens.clear(), n.services.errors.clear(o)) : await m(o);
|
|
380
409
|
}
|
|
381
|
-
|
|
382
|
-
|
|
410
|
+
h.reconcile();
|
|
411
|
+
} else {
|
|
412
|
+
for (let e of Array.from(i.keys())) await p(e);
|
|
413
|
+
for (let e of r) await m(e);
|
|
414
|
+
h.reconcile();
|
|
383
415
|
}
|
|
384
|
-
for (let e of Array.from(i.keys())) await d(e);
|
|
385
|
-
for (let e of r) await f(e);
|
|
386
|
-
p.reconcile();
|
|
387
416
|
};
|
|
388
417
|
r.push(n.services.events.onRoot("formie:submit:result", (e) => {
|
|
389
418
|
let t = e instanceof CustomEvent ? e.detail : null;
|
|
390
|
-
t?.stage !== "validate" && (t?.ok !== !1 || t?.stage !== "challenge") && t?.ok !== !0 &&
|
|
419
|
+
t?.stage !== "validate" && (t?.ok !== !1 || t?.stage !== "challenge") && t?.ok !== !0 && g("submit-result");
|
|
391
420
|
})), n.form && r.push(n.services.events.onForm(e("reset"), () => {
|
|
392
|
-
|
|
393
|
-
|
|
421
|
+
c = n.services.placeholder.getPrimary() || c, window.setTimeout(() => {
|
|
422
|
+
g("reset-state");
|
|
394
423
|
}, 0);
|
|
395
|
-
}))
|
|
424
|
+
}));
|
|
425
|
+
let _ = () => s || (l = !0, s = (async () => {
|
|
426
|
+
r.forEach((e) => e()), await Promise.allSettled([...a.values()]);
|
|
427
|
+
let e = (await Promise.allSettled(/* @__PURE__ */ new Set([...o.values(), ...Array.from(i.keys(), p)]))).flatMap((e) => e.status === "rejected" ? [e.reason] : []);
|
|
428
|
+
if (e.length) throw AggregateError(e, "CAPTCHA widgets could not clean up.");
|
|
429
|
+
})(), s);
|
|
430
|
+
h.reconcileImmediate();
|
|
396
431
|
try {
|
|
397
|
-
if (await Promise.all([...a.values()]),
|
|
432
|
+
if (await Promise.all([...a.values()]), u) throw u;
|
|
398
433
|
} catch (e) {
|
|
399
|
-
throw
|
|
434
|
+
throw await _().catch((e) => {
|
|
435
|
+
N.warn("Captcha cleanup after failed setup.", { error: e });
|
|
436
|
+
}), e;
|
|
400
437
|
}
|
|
401
438
|
return {
|
|
402
439
|
assertReady: () => {
|
|
403
|
-
if (
|
|
404
|
-
},
|
|
405
|
-
destroy: async () => {
|
|
406
|
-
s = !0, r.forEach((e) => {
|
|
407
|
-
e();
|
|
408
|
-
});
|
|
409
|
-
for (let e of Array.from(i.keys())) await d(e);
|
|
440
|
+
if (u) throw u;
|
|
410
441
|
},
|
|
442
|
+
destroy: _,
|
|
411
443
|
beforeSubmit: async (e) => {
|
|
412
444
|
if (e.action !== "submit") return;
|
|
413
|
-
|
|
414
|
-
let r =
|
|
445
|
+
h.reconcileImmediate();
|
|
446
|
+
let r = h.getVisible();
|
|
415
447
|
if (r.length === 0) return;
|
|
416
|
-
let a = r.find((e) => e ===
|
|
417
|
-
await
|
|
418
|
-
let
|
|
419
|
-
if (!
|
|
448
|
+
let a = r.find((e) => e === c) || r[0];
|
|
449
|
+
await m(a), a = c || a, n.services.errors.clear(a);
|
|
450
|
+
let o = i.get(a);
|
|
451
|
+
if (!i.has(a)) {
|
|
420
452
|
let r = n.services.errors.getDefaultMessage();
|
|
421
453
|
n.services.errors.show(r, a), N.warn("Captcha widget unavailable at challenge stage.", { moduleId: t.moduleId }), e.abort(r);
|
|
422
454
|
return;
|
|
423
455
|
}
|
|
424
|
-
let
|
|
456
|
+
let s = await f();
|
|
425
457
|
await t.challenge({
|
|
426
|
-
api:
|
|
427
|
-
widget:
|
|
458
|
+
api: s,
|
|
459
|
+
widget: o,
|
|
428
460
|
placeholder: a,
|
|
429
461
|
services: n.services,
|
|
430
462
|
options: n.options,
|