@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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./debug-
|
|
2
|
-
import { n as t } from "./async-
|
|
1
|
+
import { t as e } from "./debug-rhzqP1j2.js";
|
|
2
|
+
import { n as t } from "./async-2GdXNFCE.js";
|
|
3
3
|
import { t as n } from "./styles-BfoIZwJp.js";
|
|
4
|
-
import { n as r, o as i, s as a } from "./shared-
|
|
4
|
+
import { n as r, o as i, s as a } from "./shared-CJ1LIEh3.js";
|
|
5
5
|
//#region src/css/theme/fields/_repeater.css?inline
|
|
6
6
|
var o = "@layer formie-theme{.formie-repeater-container{gap:var(--formie-space-4);display:grid}.formie-repeater-item-wrapper{gap:var(--formie-space-4);padding:var(--formie-space-4);border:var(--formie-border-width) solid var(--formie-color-border-control);border-radius:var(--formie-radius-md);transition:border-color .15s,box-shadow .15s,background-color .15s;display:grid;position:relative}.formie-repeater-item-wrapper:focus-within{border-color:var(--formie-focus-ring-border-color);box-shadow:var(--formie-shadow-focus)}.formie-field-has-error .formie-repeater-item-wrapper{border-color:var(--formie-color-danger)}.formie-field-has-error .formie-repeater-item-wrapper:focus-within{box-shadow:var(--formie-shadow-danger-focus)}.formie-repeater-item-wrapper>.formie-repeater-remove-button{top:var(--formie-repeater-remove-button-top);right:var(--formie-repeater-remove-button-right);transform:var(--formie-repeater-remove-button-transform);font-size:0;line-height:0;position:absolute}.formie-button.formie-repeater-add-button{width:auto;max-width:100%;padding-left:var(--formie-repeater-add-button-padding-left);justify-content:center;justify-self:start;align-items:center;display:inline-flex;position:relative}.formie-button.formie-repeater-add-button:before{content:\"\";width:var(--formie-repeater-add-button-width);height:var(--formie-repeater-add-button-height);left:var(--formie-repeater-add-button-left);-webkit-mask-image:var(--formie-repeater-add-button-icon-mask);-webkit-mask-image:var(--formie-repeater-add-button-icon-mask);mask-image:var(--formie-repeater-add-button-icon-mask);background-color:currentColor;display:block;position:absolute;top:50%;transform:translateY(-50%);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}}", s = "[data-formie-repeater-field-layout]", c = "[data-formie-repeater-container]", l = "[data-formie-repeater-item]", u = "[data-formie-repeater-add]", d = "[data-formie-repeater-remove]", f = "data-formie-template-id", p = "repeater", m = e("fields", "repeater");
|
|
7
7
|
n(p, [o]);
|
|
@@ -15,76 +15,86 @@ function g(e, t) {
|
|
|
15
15
|
function _(e) {
|
|
16
16
|
return e.querySelectorAll(l).length;
|
|
17
17
|
}
|
|
18
|
-
function v(e
|
|
18
|
+
function v(e) {
|
|
19
|
+
let t = Array.from(e?.querySelectorAll("input:not([type=\"hidden\"]), select, textarea, button, a[href], [role=\"button\"], [role=\"combobox\"], [role=\"textbox\"], [contenteditable=\"true\"]") || []).find((e) => e.tabIndex >= 0 && !e.matches(":disabled") && !e.closest("[hidden], [inert]") && e.getClientRects().length > 0);
|
|
20
|
+
return t?.focus(), !!t;
|
|
21
|
+
}
|
|
22
|
+
function y(e, t) {
|
|
19
23
|
if (!e) return;
|
|
20
24
|
let n = parseInt(e.getAttribute("data-formie-max-rows") || "", 10);
|
|
21
|
-
|
|
22
|
-
e.disabled = !0;
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
e.disabled = !1;
|
|
25
|
+
e.disabled = n > 0 && t >= n;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
if (!(
|
|
30
|
-
let
|
|
27
|
+
function b(e, n) {
|
|
28
|
+
let i = e.matches(c) ? e : e.querySelector(c), o = e.querySelector(u);
|
|
29
|
+
if (!(i instanceof HTMLElement)) return m.warn("Missing repeater container; skipping field."), () => {};
|
|
30
|
+
let s = e.closest("form"), b = !1, x = 0, S = /* @__PURE__ */ new Map(), C = Array.from(e.querySelectorAll(l)).reduce((e, t) => {
|
|
31
31
|
let n = parseInt(t.getAttribute("data-formie-repeater-item-id") || "", 10);
|
|
32
32
|
return Number.isNaN(n) ? e : Math.max(e, n + 1);
|
|
33
|
-
}, 0),
|
|
33
|
+
}, 0), w = () => {
|
|
34
34
|
e.querySelectorAll(d).forEach((t) => {
|
|
35
|
-
if (!(t instanceof HTMLElement) ||
|
|
36
|
-
let
|
|
37
|
-
|
|
35
|
+
if (!(t instanceof HTMLElement) || S.has(t)) return;
|
|
36
|
+
let i = (i) => {
|
|
37
|
+
i.preventDefault();
|
|
38
38
|
let a = t.closest(l);
|
|
39
39
|
if (!(a instanceof HTMLElement)) return;
|
|
40
|
-
let
|
|
41
|
-
|
|
40
|
+
let s = parseInt((o instanceof HTMLButtonElement ? o.getAttribute("data-formie-min-rows") : "") || "", 10);
|
|
41
|
+
if (s > 0 && _(e) <= s) return;
|
|
42
|
+
let c = a.contains(document.activeElement) && (!n || i instanceof MouseEvent && i.detail === 0), u = a.nextElementSibling, d = a.previousElementSibling;
|
|
43
|
+
a.remove(), y(o instanceof HTMLButtonElement ? o : null, _(e)), c && !v(u) && !v(d) && o instanceof HTMLButtonElement && o.focus(), m.log("Row removed.", { rowCount: _(e) }), r(e, p, "remove", {
|
|
42
44
|
repeater: e,
|
|
43
45
|
row: a
|
|
44
|
-
})
|
|
46
|
+
});
|
|
45
47
|
};
|
|
46
|
-
t.addEventListener("click",
|
|
48
|
+
t.addEventListener("click", i), S.set(t, i);
|
|
47
49
|
});
|
|
48
|
-
},
|
|
49
|
-
if (!(
|
|
50
|
-
let
|
|
51
|
-
if (!
|
|
50
|
+
}, T = async (n = !1) => {
|
|
51
|
+
if (!(o instanceof HTMLButtonElement)) return;
|
|
52
|
+
let s = o.getAttribute("data-formie-repeater-add");
|
|
53
|
+
if (!s) {
|
|
52
54
|
m.warn("Add handle missing.");
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
|
-
let c =
|
|
57
|
+
let c = o.getAttribute(f) || e.getAttribute(f), l = parseInt(o.getAttribute("data-formie-max-rows") || "", 10);
|
|
56
58
|
if (l > 0 && _(e) >= l) return;
|
|
57
59
|
let u = h(e, c);
|
|
58
60
|
if (!u) {
|
|
59
|
-
m.warn("Template not found for add action.", { handle:
|
|
61
|
+
m.warn("Template not found for add action.", { handle: s });
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
62
|
-
let d = g(a(u),
|
|
64
|
+
let d = g(a(u), C++);
|
|
63
65
|
if (!d) {
|
|
64
66
|
m.warn("Failed to build row from template.");
|
|
65
67
|
return;
|
|
66
68
|
}
|
|
67
|
-
|
|
69
|
+
let S = x;
|
|
70
|
+
i.appendChild(d), await t(50), !b && S === x && d.isConnected && (w(), n && document.activeElement === o && v(d), y(o, _(e)), m.log("Row appended.", { rowCount: _(e) }), r(e, p, "append", {
|
|
68
71
|
repeater: e,
|
|
69
72
|
row: d
|
|
70
73
|
}), r(e, p, "init-row", {
|
|
71
74
|
repeater: e,
|
|
72
75
|
row: d
|
|
73
|
-
});
|
|
74
|
-
},
|
|
75
|
-
e.preventDefault()
|
|
76
|
+
}));
|
|
77
|
+
}, E = (e) => {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
let t = !n || e instanceof MouseEvent && e.detail === 0;
|
|
80
|
+
T(t);
|
|
76
81
|
};
|
|
77
|
-
if (
|
|
78
|
-
let e = parseInt(
|
|
79
|
-
for (let t = 0; t < e; t += 1)
|
|
82
|
+
if (o instanceof HTMLButtonElement && o.addEventListener("click", E), w(), y(o instanceof HTMLButtonElement ? o : null, _(e)), o instanceof HTMLButtonElement && _(e) === 0) {
|
|
83
|
+
let e = parseInt(o.getAttribute("data-formie-min-rows") || "", 10);
|
|
84
|
+
for (let t = 0; t < e; t += 1) T();
|
|
80
85
|
}
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
let D = Array.from(i.children).map((e) => e.cloneNode(!0)), O = (t) => {
|
|
87
|
+
queueMicrotask(() => {
|
|
88
|
+
t.defaultPrevented || b || (x++, S.forEach((e, t) => t.removeEventListener("click", e)), S.clear(), i.replaceChildren(...D.map((e) => e.cloneNode(!0))), w(), y(o instanceof HTMLButtonElement ? o : null, _(e)));
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
return s?.addEventListener("reset", O), r(e, p, "init", { repeater: e }), m.log("Field initialized.", { rowCount: _(e) }), () => {
|
|
92
|
+
b = !0, s?.removeEventListener("reset", O), o instanceof HTMLButtonElement && o.removeEventListener("click", E), S.forEach((e, t) => {
|
|
83
93
|
t.removeEventListener("click", e);
|
|
84
94
|
});
|
|
85
95
|
};
|
|
86
96
|
}
|
|
87
|
-
var
|
|
97
|
+
var x = {
|
|
88
98
|
moduleId: `formie:${p}`,
|
|
89
99
|
version: 2,
|
|
90
100
|
surfaces: [
|
|
@@ -96,7 +106,7 @@ var b = {
|
|
|
96
106
|
match: (e) => e.target instanceof HTMLElement && (e.target.matches(s) || !!e.target.querySelector(s)),
|
|
97
107
|
setup: async (e) => {
|
|
98
108
|
if (!(e.target instanceof HTMLElement)) return;
|
|
99
|
-
let t = e.target.matches(s) ? [e.target] : Array.from(e.target.querySelectorAll(s)).filter((e) => e instanceof HTMLElement), n = t.map((
|
|
109
|
+
let t = e.target.matches(s) ? [e.target] : Array.from(e.target.querySelectorAll(s)).filter((e) => e instanceof HTMLElement), n = t.map((t) => b(t, e.surface === "cp-edit"));
|
|
100
110
|
return m.log("Module setup.", { fieldCount: t.length }), await e.emit("formie:module:repeater:init", { count: t.length }), { destroy: () => {
|
|
101
111
|
n.forEach((e) => {
|
|
102
112
|
e();
|
|
@@ -105,4 +115,4 @@ var b = {
|
|
|
105
115
|
}
|
|
106
116
|
};
|
|
107
117
|
//#endregion
|
|
108
|
-
export {
|
|
118
|
+
export { x as repeaterModule };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-
|
|
1
|
+
import { t as e } from "./rolldown-runtime-VHNaYcLd.js";
|
|
2
2
|
import { t } from "./styles-BfoIZwJp.js";
|
|
3
|
-
import { i as n, n as r } from "./shared-
|
|
3
|
+
import { i as n, n as r } from "./shared-CJ1LIEh3.js";
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region ../../node_modules/pell/dist/pell.min.css?inline
|
|
6
|
-
var i = (/* @__PURE__ */ e(((e, t) => {
|
|
6
|
+
var i = (/* @__PURE__ */ e(((e, t, n) => {
|
|
7
7
|
(function(n, r) {
|
|
8
8
|
typeof e == "object" && t !== void 0 ? r(e) : typeof define == "function" && define.amd ? define(["exports"], r) : r(n.pell = {});
|
|
9
|
-
})(
|
|
9
|
+
})(n, function(e) {
|
|
10
10
|
var t = Object.assign || function(e) {
|
|
11
11
|
for (var t = 1; t < arguments.length; t++) {
|
|
12
12
|
var n = arguments[t];
|
|
@@ -290,9 +290,7 @@ function M() {
|
|
|
290
290
|
if (e) {
|
|
291
291
|
let t = e.split("\n").join("<br>");
|
|
292
292
|
(0, i.exec)("formatBlock", "<p>"), document.execCommand("insertHTML", !1, t);
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
(0, i.exec)("formatBlock", "<p>");
|
|
293
|
+
} else (0, i.exec)("formatBlock", "<p>");
|
|
296
294
|
}
|
|
297
295
|
}
|
|
298
296
|
];
|
|
@@ -325,14 +323,38 @@ function P(e, t, n) {
|
|
|
325
323
|
options: a
|
|
326
324
|
});
|
|
327
325
|
let o = (0, i.init)(a);
|
|
328
|
-
t.richText = o, o.content.innerHTML = t.value || "";
|
|
329
|
-
let s = t.
|
|
326
|
+
t.richText = o, o.content.innerHTML = t.value || "", o.content.setAttribute("role", "textbox"), o.content.setAttribute("aria-multiline", "true");
|
|
327
|
+
let s = Array.from(t.labels || []), c = [
|
|
328
|
+
"aria-label",
|
|
329
|
+
"aria-labelledby",
|
|
330
|
+
"aria-invalid",
|
|
331
|
+
"aria-describedby",
|
|
332
|
+
"aria-errormessage"
|
|
333
|
+
], l = () => {
|
|
334
|
+
c.forEach((e) => {
|
|
335
|
+
let n = t.getAttribute(e);
|
|
336
|
+
n === null ? o.content.removeAttribute(e) : o.content.setAttribute(e, n);
|
|
337
|
+
}), !t.hasAttribute("aria-label") && !t.hasAttribute("aria-labelledby") && s.length && o.content.setAttribute("aria-label", s.map((e) => e.textContent?.trim() || "").join(" ")), o.content.setAttribute("aria-required", t.getAttribute("aria-required") || String(t.required));
|
|
338
|
+
};
|
|
339
|
+
l();
|
|
340
|
+
let u = new MutationObserver(l);
|
|
341
|
+
u.observe(t, {
|
|
342
|
+
attributes: !0,
|
|
343
|
+
attributeFilter: [
|
|
344
|
+
...c,
|
|
345
|
+
"aria-required",
|
|
346
|
+
"required"
|
|
347
|
+
]
|
|
348
|
+
});
|
|
349
|
+
let d = () => o.content.focus();
|
|
350
|
+
s.forEach((e) => e.addEventListener("click", d));
|
|
351
|
+
let f = t.form, p = (e) => {
|
|
330
352
|
queueMicrotask(() => {
|
|
331
353
|
e.defaultPrevented || (o.content.innerHTML = t.value || "");
|
|
332
354
|
});
|
|
333
355
|
};
|
|
334
|
-
return
|
|
335
|
-
s?.removeEventListener("reset",
|
|
356
|
+
return f?.addEventListener("reset", p), t.placeholder && o.content.setAttribute("data-placeholder", t.placeholder), r(t, k, "after-init", { richText: o }), () => {
|
|
357
|
+
u.disconnect(), s.forEach((e) => e.removeEventListener("click", d)), f?.removeEventListener("reset", p), e.innerHTML = "", delete t.richText;
|
|
336
358
|
};
|
|
337
359
|
}
|
|
338
360
|
var F = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, i, o, s) => {
|
|
3
3
|
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
4
4
|
get: ((e) => i[e]).bind(null, d),
|
|
5
5
|
enumerable: !(s = n(i, d)) || s.enumerable
|
|
@@ -77,11 +77,7 @@ var s = class {
|
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
let n = this.targets[e.to_id];
|
|
80
|
-
|
|
81
|
-
console.error(`[bus] Unexpected message to unknown target ${e.to_id}`, e);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
n.send(e);
|
|
80
|
+
n ? n.send(e) : console.error(`[bus] Unexpected message to unknown target ${e.to_id}`, e);
|
|
85
81
|
}
|
|
86
82
|
onReceive(e) {
|
|
87
83
|
if (!o(e.origin, this.origins)) return;
|
|
@@ -175,11 +171,7 @@ function b(e) {
|
|
|
175
171
|
continue;
|
|
176
172
|
}
|
|
177
173
|
let e = t.parentNode;
|
|
178
|
-
|
|
179
|
-
t = e.host;
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
t = null;
|
|
174
|
+
t = e && e.host ? e.host : null;
|
|
183
175
|
}
|
|
184
176
|
return null;
|
|
185
177
|
}
|
|
@@ -1211,11 +1203,7 @@ var Pe = "/api/v2/captcha/agent", Fe = "/api/v2/captcha/widget", X = "FrcFrameId
|
|
|
1211
1203
|
}
|
|
1212
1204
|
handleStoreMessage(e) {
|
|
1213
1205
|
let t = e.from_id, n = this.agentState.get(t);
|
|
1214
|
-
|
|
1215
|
-
console.error(`Store not found ${t}`);
|
|
1216
|
-
return;
|
|
1217
|
-
}
|
|
1218
|
-
e.type === "root_store_get" ? this.bus.send({
|
|
1206
|
+
n ? e.type === "root_store_get" ? this.bus.send({
|
|
1219
1207
|
type: "root_store_get_reply",
|
|
1220
1208
|
from_id: "",
|
|
1221
1209
|
to_id: t,
|
|
@@ -1230,7 +1218,7 @@ var Pe = "/api/v2/captcha/agent", Fe = "/api/v2/captcha/widget", X = "FrcFrameId
|
|
|
1230
1218
|
_frc: 1,
|
|
1231
1219
|
rid: e.rid,
|
|
1232
1220
|
sa: !0
|
|
1233
|
-
}));
|
|
1221
|
+
})) : console.error(`Store not found ${t}`);
|
|
1234
1222
|
}
|
|
1235
1223
|
ensureAgentIFrame(e) {
|
|
1236
1224
|
let t = 1, n = e[Y(t, e)], r = n + Pe, i = Z, a = this.agents.get(n);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./styles-BfoIZwJp.js";
|
|
2
|
-
import { i as t, n, t as r } from "./shared-
|
|
2
|
+
import { i as t, n, t as r } from "./shared-CJ1LIEh3.js";
|
|
3
3
|
//#region ../../node_modules/signature_pad/dist/signature_pad.js
|
|
4
4
|
var i = class {
|
|
5
5
|
x;
|
|
@@ -196,11 +196,7 @@ var c = class e extends o {
|
|
|
196
196
|
this._isLeftButtonPressed(e, !0) && !this._drawingStroke && this._strokeBegin(this._pointerEventToSignatureEvent(e));
|
|
197
197
|
}
|
|
198
198
|
_handleMouseMove(e) {
|
|
199
|
-
|
|
200
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(e), !1);
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e));
|
|
199
|
+
!this._isLeftButtonPressed(e, !0) || !this._drawingStroke ? this._strokeEnd(this._pointerEventToSignatureEvent(e), !1) : this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e));
|
|
204
200
|
}
|
|
205
201
|
_handleMouseUp(e) {
|
|
206
202
|
this._isLeftButtonPressed(e) || this._strokeEnd(this._pointerEventToSignatureEvent(e));
|
|
@@ -209,13 +205,7 @@ var c = class e extends o {
|
|
|
209
205
|
e.targetTouches.length !== 1 || this._drawingStroke || (e.cancelable && e.preventDefault(), this._strokeBegin(this._touchEventToSignatureEvent(e)));
|
|
210
206
|
}
|
|
211
207
|
_handleTouchMove(e) {
|
|
212
|
-
|
|
213
|
-
if (e.cancelable && e.preventDefault(), !this._drawingStroke) {
|
|
214
|
-
this._strokeEnd(this._touchEventToSignatureEvent(e), !1);
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
this._strokeMoveUpdate(this._touchEventToSignatureEvent(e));
|
|
218
|
-
}
|
|
208
|
+
e.targetTouches.length === 1 && (e.cancelable && e.preventDefault(), this._drawingStroke ? this._strokeMoveUpdate(this._touchEventToSignatureEvent(e)) : this._strokeEnd(this._touchEventToSignatureEvent(e), !1));
|
|
219
209
|
}
|
|
220
210
|
_handleTouchEnd(e) {
|
|
221
211
|
e.targetTouches.length === 0 && (e.cancelable && e.preventDefault(), this._strokeEnd(this._touchEventToSignatureEvent(e)));
|
|
@@ -236,13 +226,7 @@ var c = class e extends o {
|
|
|
236
226
|
!this._drawingStroke && this._isLeftButtonPressed(e) && this._allowPointerId(e, !0) && (this._strokePointerId = this._getPointerId(e), e.preventDefault(), this._strokeBegin(this._pointerEventToSignatureEvent(e)));
|
|
237
227
|
}
|
|
238
228
|
_handlePointerMove(e) {
|
|
239
|
-
|
|
240
|
-
if (!this._isLeftButtonPressed(e, !0) || !this._drawingStroke) {
|
|
241
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(e), !1);
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
e.preventDefault(), this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e));
|
|
245
|
-
}
|
|
229
|
+
this._allowPointerId(e) && (!this._isLeftButtonPressed(e, !0) || !this._drawingStroke ? this._strokeEnd(this._pointerEventToSignatureEvent(e), !1) : (e.preventDefault(), this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e))));
|
|
246
230
|
}
|
|
247
231
|
_handlePointerUp(e) {
|
|
248
232
|
!this._isLeftButtonPressed(e) && this._allowPointerId(e) && (e.preventDefault(), this._strokeEnd(this._pointerEventToSignatureEvent(e)));
|
|
@@ -431,13 +415,7 @@ function x(e) {
|
|
|
431
415
|
}
|
|
432
416
|
function S(e, t, n) {
|
|
433
417
|
let r = b(e);
|
|
434
|
-
|
|
435
|
-
if (n) {
|
|
436
|
-
r.textContent = n, r.hidden = !1, t.setAttribute("aria-hidden", "true"), e.classList.add("formie-signature-has-message");
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
r.textContent = "", r.hidden = !0, t.removeAttribute("aria-hidden"), e.classList.remove("formie-signature-has-message");
|
|
440
|
-
}
|
|
418
|
+
r && (n ? (r.textContent = n, r.hidden = !1, t.setAttribute("aria-hidden", "true"), e.classList.add("formie-signature-has-message")) : (r.textContent = "", r.hidden = !0, t.removeAttribute("aria-hidden"), e.classList.remove("formie-signature-has-message")));
|
|
441
419
|
}
|
|
442
420
|
function C(e) {
|
|
443
421
|
return !e.hasAttribute("hidden") && !e.hasAttribute("data-formie-conditionally-hidden") && !e.hasAttribute("data-formie-page-hidden") && !e.hasAttribute("data-formie-row-hidden") && e.getClientRects().length > 0;
|
|
@@ -502,21 +480,11 @@ function O(e, t, i, a, o, s) {
|
|
|
502
480
|
let r = Math.max(window.devicePixelRatio || 1, 1), o = a.getContext("2d");
|
|
503
481
|
return o ? (a.width = t * r, a.height = n * r, o.setTransform(1, 0, 0, 1, 0, 0), o.scale(r, r), k.clear(), await D(k, a, e), j(), !0) : !1;
|
|
504
482
|
}, P = () => {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
return;
|
|
509
|
-
}
|
|
510
|
-
A(), w = window.setTimeout(() => {
|
|
511
|
-
w = null, b += 1, F();
|
|
512
|
-
}, g);
|
|
513
|
-
}
|
|
483
|
+
T || O || (b >= h ? M() : (A(), w = window.setTimeout(() => {
|
|
484
|
+
w = null, b += 1, F();
|
|
485
|
+
}, g)));
|
|
514
486
|
}, F = async () => {
|
|
515
|
-
|
|
516
|
-
P();
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
A(), b = 0;
|
|
487
|
+
await N() ? (A(), b = 0) : P();
|
|
520
488
|
}, I = (e = 0) => {
|
|
521
489
|
window.setTimeout(() => {
|
|
522
490
|
window.requestAnimationFrame(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./api-
|
|
2
|
-
import { r as t } from "./scripts-
|
|
1
|
+
import { t as e } from "./api-BR2Gqy37.js";
|
|
2
|
+
import { r as t } from "./scripts-DrccjrFv.js";
|
|
3
3
|
//#region src/js/modules/payments/square.ts
|
|
4
4
|
var n = "FORMIE_SQUARE_SCRIPT", r = e({
|
|
5
5
|
moduleId: "formie:square",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as e } from "./event-names-BCI2FLD8.js";
|
|
2
|
-
import { t } from "./api-
|
|
2
|
+
import { t } from "./api-BR2Gqy37.js";
|
|
3
3
|
import { i as n, t as r } from "./theme-classes-DAQuEqdP.js";
|
|
4
|
-
import { r as i } from "./scripts-
|
|
4
|
+
import { r as i } from "./scripts-DrccjrFv.js";
|
|
5
5
|
import { t as a } from "./styles-BfoIZwJp.js";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/js/modules/payments/stripe.ts
|
|
@@ -88,11 +88,8 @@ var m = t({
|
|
|
88
88
|
s.__formieStripeWidget = null, s.__formieStripeElements = void 0, a.innerHTML = "";
|
|
89
89
|
}, v = () => {
|
|
90
90
|
let e = g();
|
|
91
|
-
if (!e.ok)
|
|
92
|
-
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
try {
|
|
91
|
+
if (!e.ok) _(), p(o, l, "error" in e ? e.error : "Unable to resolve payment details.");
|
|
92
|
+
else try {
|
|
96
93
|
if (s.__formieStripeWidget && s.__formieStripeElements) {
|
|
97
94
|
s.__formieStripeElements.update(e.value), d(o, l), o?.setAttribute("hidden", "hidden");
|
|
98
95
|
return;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as e } from "./debug-
|
|
1
|
+
import { t as e } from "./debug-rhzqP1j2.js";
|
|
2
2
|
import { a as t } from "./theme-classes-DAQuEqdP.js";
|
|
3
|
-
import { r as n } from "./http-
|
|
4
|
-
import { t as r } from "./async-
|
|
3
|
+
import { r as n } from "./http-Dj_skqaa.js";
|
|
4
|
+
import { t as r } from "./async-2GdXNFCE.js";
|
|
5
5
|
import { t as i } from "./styles-BfoIZwJp.js";
|
|
6
|
-
import { i as a, n as o } from "./shared-
|
|
6
|
+
import { i as a, n as o } from "./shared-CJ1LIEh3.js";
|
|
7
7
|
//#region src/css/theme/fields/_summary.css?inline
|
|
8
8
|
var s = "@layer formie-theme{.formie-summary-container{padding:var(--formie-summary-padding);border:var(--formie-border-width) solid var(--formie-color-border);border-radius:var(--formie-radius-sm)}.formie-summary-heading{color:var(--formie-color-heading)}.formie-summary-blocks{gap:var(--formie-gap-summary);display:grid}.formie-summary-blocks[data-formie-loading=true]{min-height:calc(var(--formie-loading-size) + var(--formie-space-4));position:relative}.formie-summary-blocks[data-formie-loading=true]>*{opacity:0;pointer-events:none}.formie-summary-blocks[data-formie-loading=true]:before{content:\"\";background:var(--formie-color-bg);border-radius:inherit;z-index:1;display:block;position:absolute;inset:0}.formie-summary-blocks[data-formie-loading=true]:after{width:var(--formie-loading-size);height:var(--formie-loading-size);content:\"\";border:var(--formie-loading-border-width) solid var(--formie-loading-color);border-radius:var(--formie-radius-full);z-index:2;animation:formie-loading-spin var(--formie-loading-speed) linear infinite;border-top-color:#0000;border-right-color:#0000;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}}", c = "[data-formie-summary-blocks]", l = "[data-formie-summary-container]", u = "formie/fields/get-summary-html", d = "summary", f = e("fields", "summary");
|
|
9
9
|
i(d, [s]);
|
|
@@ -12,7 +12,8 @@ function p() {
|
|
|
12
12
|
return e.hash = "", e.toString();
|
|
13
13
|
}
|
|
14
14
|
function m(e) {
|
|
15
|
-
|
|
15
|
+
let t = e.querySelector("[data-formie-summary-token]");
|
|
16
|
+
return { accessToken: (t instanceof HTMLInputElement ? t.value : t?.getAttribute("data-formie-summary-token"))?.trim() || null };
|
|
16
17
|
}
|
|
17
18
|
async function h(e, t, r) {
|
|
18
19
|
if (!t.accessToken) throw Error("Summary field requires an access token.");
|
|
@@ -27,38 +28,33 @@ async function h(e, t, r) {
|
|
|
27
28
|
function g(e, n) {
|
|
28
29
|
let i = e.closest("form");
|
|
29
30
|
if (!(i instanceof HTMLFormElement)) return f.warn("Missing form ancestor; skipping field."), () => {};
|
|
30
|
-
let a = !1, s = !0, u = !1, p = 0, g = 0, _ = null, v = () => {
|
|
31
|
+
let a = !1, s = !0, u = !1, p = 0, g = 0, _ = null, v = !1, y = m(e), b = y.accessToken, x = () => {
|
|
31
32
|
let t = e.querySelector(c);
|
|
32
33
|
return t instanceof HTMLElement ? t : null;
|
|
33
|
-
},
|
|
34
|
+
}, S = () => {
|
|
34
35
|
let t = e.querySelector(l);
|
|
35
36
|
return t instanceof HTMLElement ? t : null;
|
|
36
|
-
},
|
|
37
|
-
let n =
|
|
38
|
-
|
|
39
|
-
if (e) {
|
|
40
|
-
n.setAttribute("data-formie-loading", "true"), n.setAttribute("aria-busy", "true"), t(n, i, "loading", !0);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
n.removeAttribute("data-formie-loading"), n.removeAttribute("aria-busy"), t(n, i, "loading", !1);
|
|
44
|
-
}
|
|
37
|
+
}, C = (e) => {
|
|
38
|
+
let n = x();
|
|
39
|
+
n && (e ? (n.setAttribute("data-formie-loading", "true"), n.setAttribute("aria-busy", "true"), t(n, i, "loading", !0)) : (n.removeAttribute("data-formie-loading"), n.removeAttribute("aria-busy"), t(n, i, "loading", !1)));
|
|
45
40
|
};
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
!u || a && !s || (f.log("Queueing fetch."),
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
C(!!y.accessToken);
|
|
42
|
+
let w = () => {
|
|
43
|
+
v || !u || a && !s || (f.log("Queueing fetch."), T());
|
|
44
|
+
}, T = r(async () => {
|
|
45
|
+
if (v) return;
|
|
46
|
+
let t = { accessToken: b };
|
|
47
|
+
if (!x() || !t.accessToken) {
|
|
48
|
+
f.warn("Missing state for fetch.", t), C(!1);
|
|
53
49
|
return;
|
|
54
50
|
}
|
|
55
51
|
g += 1;
|
|
56
52
|
let n = g, r = p;
|
|
57
|
-
_?.abort(), _ = new AbortController(),
|
|
53
|
+
_?.abort(), _ = new AbortController(), C(!0);
|
|
58
54
|
try {
|
|
59
55
|
let c = await h(i, t, _.signal);
|
|
60
56
|
if (n !== g) return;
|
|
61
|
-
let u =
|
|
57
|
+
let u = S(), m = document.createElement("template");
|
|
62
58
|
m.innerHTML = c.trim();
|
|
63
59
|
let v = m.content.querySelector(l);
|
|
64
60
|
u && v instanceof HTMLElement ? u.replaceWith(v) : u && (u.innerHTML = c), a = !0, s = p !== r, f.log("Fetch complete.", {
|
|
@@ -76,25 +72,37 @@ function g(e, n) {
|
|
|
76
72
|
}
|
|
77
73
|
console.error("[formie] Failed to load summary field HTML.", e);
|
|
78
74
|
} finally {
|
|
79
|
-
n === g && (
|
|
75
|
+
n === g && (C(!1), _ = null, s && p !== r && w());
|
|
80
76
|
}
|
|
81
|
-
}, 300),
|
|
77
|
+
}, 300), E = (t) => {
|
|
82
78
|
let n = t?.target;
|
|
83
79
|
n instanceof Node && e.contains(n) || (s = !0, p += 1, f.log("Marked dirty.", { dirtyVersion: p }));
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
80
|
+
}, D = (e) => {
|
|
81
|
+
E(e), w();
|
|
82
|
+
}, O = (t) => {
|
|
83
|
+
let n = t.detail?.meta?.summaryTokens, r = e.dataset.formieFieldUid;
|
|
84
|
+
if (r && n && typeof n == "object") {
|
|
85
|
+
let e = n[r];
|
|
86
|
+
typeof e == "string" && e && (b = e, S()?.setAttribute("data-formie-summary-token", e));
|
|
87
|
+
}
|
|
88
|
+
E(), f.log("Submit result received; refreshing.", {
|
|
89
|
+
uid: r,
|
|
90
|
+
hasToken: !!b
|
|
91
|
+
}), w();
|
|
92
|
+
}, k = () => {
|
|
93
|
+
E(), f.log("Page navigation received; refreshing."), w();
|
|
94
|
+
}, A = (t) => {
|
|
95
|
+
queueMicrotask(() => {
|
|
96
|
+
t.defaultPrevented || v || (g += 1, _?.abort(), _ = null, b = null, S()?.removeAttribute("data-formie-summary-token"), e.querySelectorAll("input[data-formie-summary-token]").forEach((e) => e.remove()), a = !1, x()?.replaceChildren(), C(!1), E(), w());
|
|
97
|
+
});
|
|
98
|
+
}, j = new IntersectionObserver((t) => {
|
|
99
|
+
u = !!t[0]?.isIntersecting, u && (f.log("Field became visible."), o(e, d, "field-visible", { summary: e }), w());
|
|
92
100
|
}, {
|
|
93
101
|
root: i,
|
|
94
102
|
rootMargin: "50px"
|
|
95
103
|
});
|
|
96
|
-
return
|
|
97
|
-
_?.abort(),
|
|
104
|
+
return j.observe(e), i.addEventListener("input", D), i.addEventListener("change", D), i.addEventListener("reset", A), n.addEventListener("formie:page:navigate:after", k), n.addEventListener("formie:submit:result", O), () => {
|
|
105
|
+
v = !0, g += 1, _?.abort(), j.disconnect(), i.removeEventListener("input", D), i.removeEventListener("change", D), i.removeEventListener("reset", A), n.removeEventListener("formie:page:navigate:after", k), n.removeEventListener("formie:submit:result", O), f.log("Field destroyed.");
|
|
98
106
|
};
|
|
99
107
|
}
|
|
100
108
|
var _ = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "./debug-
|
|
1
|
+
import { t as e } from "./debug-rhzqP1j2.js";
|
|
2
2
|
import { t } from "./styles-BfoIZwJp.js";
|
|
3
|
-
import { n } from "./shared-
|
|
3
|
+
import { n } from "./shared-CJ1LIEh3.js";
|
|
4
4
|
import { t as r } from "./_survey-presentations-RbSqcQph.js";
|
|
5
5
|
//#region src/js/modules/fields/survey-rank.ts
|
|
6
6
|
var i = "[data-formie-survey-rank]", a = "[data-formie-survey-rank-list]", o = "[data-formie-survey-rank-item]", s = "[data-formie-rank-handle]", c = "formie-rank-placeholder", l = .42, u = "survey-rank", d = e("fields", "survey-rank");
|
|
@@ -39,11 +39,7 @@ function v(e, t, n, r) {
|
|
|
39
39
|
}
|
|
40
40
|
function y(e, t, n, r) {
|
|
41
41
|
let i = h(e, t, n)[r] ?? null;
|
|
42
|
-
|
|
43
|
-
e.insertBefore(t, i);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
e.appendChild(t);
|
|
42
|
+
i ? e.insertBefore(t, i) : e.appendChild(t);
|
|
47
43
|
}
|
|
48
44
|
function b(e, t) {
|
|
49
45
|
let n = document.createElement("li");
|