@verbb/formie-browser 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/chunks/{address-country-Dn71jroa.js → address-country-BcEQKw0T.js} +1 -1
  3. package/dist/chunks/{address-finder-O49uDRoR.js → address-finder-BWGINCSA.js} +1 -1
  4. package/dist/chunks/{address-state-ByYatUur.js → address-state-DI3ndhMU.js} +98 -88
  5. package/dist/chunks/{api-DYYsVIub.js → api-BK9b340y.js} +16 -16
  6. package/dist/chunks/{api-D6kJ7kXZ.js → api-Dxl_CKw-.js} +30 -25
  7. package/dist/chunks/{async-nPFRNQ06.js → async-2GdXNFCE.js} +18 -1
  8. package/dist/chunks/{bpoint-D0RKFM4F.js → bpoint-BwtuyN_O.js} +1 -1
  9. package/dist/chunks/{captcha-eu-DERJbXnH.js → captcha-eu-DWLoQFKB.js} +2 -2
  10. package/dist/chunks/{combobox-CWNdx4Fk.js → combobox-Ba08_cHL.js} +259 -258
  11. package/dist/chunks/{conditions-DqNHLTbN.js → conditions-Ceeg6ReZ.js} +113 -110
  12. package/dist/chunks/{date-picker-RUnevF7l.js → date-picker-DaPvMrop.js} +12 -11
  13. package/dist/chunks/{eway-or6dtjoT.js → eway-uw0DzU-L.js} +3 -3
  14. package/dist/chunks/{file-upload-Bm-TXyNB.js → file-upload-B8_mH012.js} +28 -16
  15. package/dist/chunks/{friendly-captcha-v1-GFqCt1Mh.js → friendly-captcha-v1-CVXaXgDO.js} +1 -1
  16. package/dist/chunks/{friendly-captcha-v2-WoW246JG.js → friendly-captcha-v2-DkeIVTKI.js} +1 -1
  17. package/dist/chunks/{go-cardless-DzJ-0FKg.js → go-cardless-c4wLJdOt.js} +1 -1
  18. package/dist/chunks/{google-address-C1P1nTDM.js → google-address-JHYvjwgN.js} +13 -8
  19. package/dist/chunks/{hcaptcha-D0T8aIHz.js → hcaptcha-Dt3ELLlP.js} +2 -2
  20. package/dist/chunks/{loqate-DD1S7PY9.js → loqate-m51iPyO1.js} +1 -1
  21. package/dist/chunks/{mollie-DG8Ju83x.js → mollie-Bn0PX173.js} +1 -1
  22. package/dist/chunks/{moneris-C8m3Fvqu.js → moneris-BRbUvI4t.js} +1 -1
  23. package/dist/chunks/{opayo-B3EvrVxw.js → opayo-BwWdInEP.js} +2 -2
  24. package/dist/chunks/{paddle-BIYR9Um3.js → paddle-CympHVvd.js} +2 -2
  25. package/dist/chunks/{paypal-B_yxIo2d.js → paypal-h75h6wae.js} +2 -2
  26. package/dist/chunks/{payway-CeOzS0sL.js → payway-C9rHTCC_.js} +2 -2
  27. package/dist/chunks/{phone-country-bAqje17P.js → phone-country-B8fv-L5_.js} +1 -1
  28. package/dist/chunks/{place-kit-BE5gi3vo.js → place-kit-BnZGQ-L1.js} +8 -8
  29. package/dist/chunks/{recaptcha-enterprise-CruXddZq.js → recaptcha-enterprise-CUs8BO6V.js} +2 -2
  30. package/dist/chunks/{recaptcha-shared-AQRMDMme.js → recaptcha-shared-DTbTw-MF.js} +2 -2
  31. package/dist/chunks/{recaptcha-v2-checkbox-CCnJYCnG.js → recaptcha-v2-checkbox-P1McW4Pv.js} +2 -2
  32. package/dist/chunks/{recaptcha-v2-invisible-BuVqRRYn.js → recaptcha-v2-invisible-FGDqozSP.js} +2 -2
  33. package/dist/chunks/{recaptcha-v3-CloqhO2A.js → recaptcha-v3-CflUHeZD.js} +2 -2
  34. package/dist/chunks/{repeater-DwE27jI1.js → repeater-CyhDbozO.js} +47 -33
  35. package/dist/chunks/{scripts-CbQ7agX3.js → scripts-DrccjrFv.js} +1 -1
  36. package/dist/chunks/skip-CEW89ExY.js +7 -0
  37. package/dist/chunks/{snaptcha-C04kNGYQ.js → snaptcha-C3QLYxFT.js} +1 -1
  38. package/dist/chunks/{square-DEzxv9D9.js → square-C1z5DPVw.js} +2 -2
  39. package/dist/chunks/{stripe-CVPQGDz3.js → stripe-Dmkdkq1y.js} +2 -2
  40. package/dist/chunks/{summary-BF_8mrXI.js → summary-Bn-g5SDx.js} +1 -1
  41. package/dist/chunks/{table-DnIBdeKF.js → table-j7MlLLCc.js} +1 -1
  42. package/dist/chunks/{turnstile-n9DNyPxi.js → turnstile-ptihQfLl.js} +2 -2
  43. package/dist/chunks/{upload-manager-BbiUosZq.js → upload-manager-BW7l-BhF.js} +248 -236
  44. package/dist/index.js +548 -535
  45. package/dist/js/core/create-formie-client.d.ts.map +1 -1
  46. package/dist/js/core/submit-result-state.d.ts.map +1 -1
  47. package/dist/js/core/submit-result-ui.d.ts +3 -1
  48. package/dist/js/core/submit-result-ui.d.ts.map +1 -1
  49. package/dist/js/modules/address/google-address.d.ts +10 -0
  50. package/dist/js/modules/address/google-address.d.ts.map +1 -1
  51. package/dist/js/modules/address/place-kit.d.ts.map +1 -1
  52. package/dist/js/modules/fields/address-state.d.ts.map +1 -1
  53. package/dist/js/modules/fields/combobox.d.ts.map +1 -1
  54. package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
  55. package/dist/js/modules/fields/conditions.d.ts.map +1 -1
  56. package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
  57. package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
  58. package/dist/js/modules/fields/repeater.d.ts.map +1 -1
  59. package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
  60. package/dist/js/utils/async.d.ts +1 -0
  61. package/dist/js/utils/async.d.ts.map +1 -1
  62. package/dist/js/validation/rules/required.d.ts.map +1 -1
  63. package/dist/js/validation/validator.d.ts.map +1 -1
  64. package/package.json +2 -2
  65. package/src/js/core/create-formie-client.ts +17 -10
  66. package/src/js/core/submit-result-state.ts +17 -0
  67. package/src/js/core/submit-result-ui.ts +4 -3
  68. package/src/js/modules/address/google-address.ts +95 -37
  69. package/src/js/modules/address/place-kit.ts +13 -7
  70. package/src/js/modules/fields/address-country.ts +5 -5
  71. package/src/js/modules/fields/address-state.ts +74 -23
  72. package/src/js/modules/fields/combobox.ts +3 -0
  73. package/src/js/modules/fields/conditions/effects.ts +4 -5
  74. package/src/js/modules/fields/conditions.ts +6 -0
  75. package/src/js/modules/fields/date-picker.ts +6 -3
  76. package/src/js/modules/fields/file-upload.ts +44 -14
  77. package/src/js/modules/fields/phone-country.ts +2 -2
  78. package/src/js/modules/fields/repeater.ts +55 -4
  79. package/src/js/modules/fields/upload-manager.ts +54 -18
  80. package/src/js/utils/async.ts +34 -0
  81. package/src/js/validation/rules/required.ts +12 -0
  82. package/src/js/validation/validator.ts +14 -2
@@ -3,7 +3,7 @@ import { t } from "./dist-ZLeW0zZ3.js";
3
3
  import { n } from "./event-names-BCI2FLD8.js";
4
4
  import { t as r } from "./csrf-DxHg_ZYt.js";
5
5
  import { t as i } from "./api-ghNr2uxX.js";
6
- import { n as a, t as o } from "./scripts-CbQ7agX3.js";
6
+ import { n as a, t as o } from "./scripts-DrccjrFv.js";
7
7
  //#region src/js/modules/address/google-address.ts
8
8
  var s = "FORMIE_GOOGLE_ADDRESS_SCRIPT", c = "formieGoogleMapsReady", l = null;
9
9
  async function u(e) {
@@ -67,10 +67,10 @@ function p(e) {
67
67
  }
68
68
  return n;
69
69
  }
70
- function m(e) {
71
- let t = "";
72
- return (e.street_number || e.route) && (t = [e.street_number, e.route].filter(Boolean).join(" "), e.subpremise && (t = `${e.subpremise}/${t}`)), {
73
- address1: t,
70
+ function m(e, t) {
71
+ let n = (t?.addressLines?.filter((e) => typeof e == "string" && e.trim() !== ""))?.join(", ") || "";
72
+ return !n && (e.street_number || e.route) && (n = [e.street_number, e.route].filter(Boolean).join(" "), e.subpremise && (n = `${e.subpremise}/${n}`)), {
73
+ address1: n,
74
74
  city: e.locality || e.postal_town || "",
75
75
  state: e.administrative_area_level_1 || "",
76
76
  zip: e.postal_code || "",
@@ -128,8 +128,12 @@ var _ = i({
128
128
  let i = e.placePrediction;
129
129
  if (!i) return;
130
130
  let a = await i.toPlace();
131
- await a.fetchFields({ fields: ["addressComponents", "formattedAddress"] }), a.addressComponents && (d(r, {
132
- ...m(p(a.addressComponents)),
131
+ await a.fetchFields({ fields: [
132
+ "addressComponents",
133
+ "formattedAddress",
134
+ "postalAddress"
135
+ ] }), a.addressComponents && (d(r, {
136
+ ...m(p(a.addressComponents), a.postalAddress),
133
137
  formattedAddress: a.formattedAddress
134
138
  }), t.dispatchEvent(new CustomEvent(n("google", "populate"), {
135
139
  bubbles: !0,
@@ -137,7 +141,8 @@ var _ = i({
137
141
  addressProvider: "google",
138
142
  place: a,
139
143
  formattedAddress: a.formattedAddress,
140
- addressComponents: a.addressComponents
144
+ addressComponents: a.addressComponents,
145
+ postalAddress: a.postalAddress
141
146
  }
142
147
  })));
143
148
  }), s;
@@ -1,5 +1,5 @@
1
- import { a as e, r as t, t as n } from "./api-DYYsVIub.js";
2
- import { n as r, t as i } from "./scripts-CbQ7agX3.js";
1
+ import { a as e, r as t, t as n } from "./api-BK9b340y.js";
2
+ import { n as r, t as i } from "./scripts-DrccjrFv.js";
3
3
  //#region src/js/modules/captchas/hcaptcha.ts
4
4
  async function a(n) {
5
5
  let a = typeof n.language == "string" && n.language.trim() !== "" ? n.language.trim() : "en", { async: o, defer: s } = t(n.loadingMethod), c = "FORMIE_HCAPTCHA_ONLOAD", l = window, u = l.hcaptcha;
@@ -1,6 +1,6 @@
1
1
  import { i as e } from "./constants-DVcJAvc5.js";
2
2
  import { t } from "./api-ghNr2uxX.js";
3
- import { r as n } from "./scripts-CbQ7agX3.js";
3
+ import { r as n } from "./scripts-DrccjrFv.js";
4
4
  //#region src/js/modules/address/loqate.ts
5
5
  var r = "FORMIE_LOQATE_SCRIPT", i = t({
6
6
  moduleId: "formie:loqate",
@@ -1,5 +1,5 @@
1
1
  import { s as e } from "./event-names-BCI2FLD8.js";
2
- import { t } from "./api-D6kJ7kXZ.js";
2
+ import { t } from "./api-Dxl_CKw-.js";
3
3
  //#region src/js/modules/payments/mollie.ts
4
4
  var n = e("mollie", "redirect"), r = t({
5
5
  moduleId: "formie:mollie",
@@ -1,4 +1,4 @@
1
- import { t as e } from "./api-D6kJ7kXZ.js";
1
+ import { t as e } from "./api-Dxl_CKw-.js";
2
2
  //#region src/js/modules/payments/moneris.ts
3
3
  var t = {
4
4
  940: "Invalid profile ID (tokenization request).",
@@ -1,11 +1,11 @@
1
1
  import { t as e } from "./request-profile-DhwkeCpS.js";
2
2
  import { t } from "./dist-ZLeW0zZ3.js";
3
3
  import { s as n } from "./event-names-BCI2FLD8.js";
4
- import { t as r } from "./api-D6kJ7kXZ.js";
4
+ import { t as r } from "./api-Dxl_CKw-.js";
5
5
  import { t as i } from "./debug-BV0DvdHx.js";
6
6
  import { a } from "./theme-classes-DAQuEqdP.js";
7
7
  import { t as o } from "./csrf-DxHg_ZYt.js";
8
- import { r as s } from "./scripts-CbQ7agX3.js";
8
+ import { r as s } from "./scripts-DrccjrFv.js";
9
9
  import { t as c } from "./styles-BfoIZwJp.js";
10
10
  //#endregion
11
11
  //#region src/js/modules/payments/opayo.ts
@@ -1,6 +1,6 @@
1
1
  import { s as e } from "./event-names-BCI2FLD8.js";
2
- import { t } from "./api-D6kJ7kXZ.js";
3
- import { r as n } from "./scripts-CbQ7agX3.js";
2
+ import { t } from "./api-Dxl_CKw-.js";
3
+ import { r as n } from "./scripts-DrccjrFv.js";
4
4
  //#region src/js/modules/payments/paddle.ts
5
5
  var r = "FORMIE_PADDLE_SCRIPT", i = e("paddle", "initialize"), a = t({
6
6
  moduleId: "formie:paddle",
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-D6kJ7kXZ.js";
2
- import { r as t } from "./scripts-CbQ7agX3.js";
1
+ import { t as e } from "./api-Dxl_CKw-.js";
2
+ import { r as t } from "./scripts-DrccjrFv.js";
3
3
  import { t as n } from "./styles-BfoIZwJp.js";
4
4
  //#endregion
5
5
  //#region src/js/modules/payments/paypal.ts
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-D6kJ7kXZ.js";
2
- import { r as t } from "./scripts-CbQ7agX3.js";
1
+ import { t as e } from "./api-Dxl_CKw-.js";
2
+ import { r as t } from "./scripts-DrccjrFv.js";
3
3
  import { t as n } from "./styles-BfoIZwJp.js";
4
4
  //#endregion
5
5
  //#region src/js/modules/payments/payway.ts
@@ -2592,7 +2592,7 @@ function Oe(e, t) {
2592
2592
  formatOnDisplay: !1,
2593
2593
  formatAsYouType: !1,
2594
2594
  loadUtils: () => import("./utils-DpUBPadZ.js")
2595
- }, r = (e.countryAllowed || []).map((e) => e.toLowerCase()).filter(Boolean);
2595
+ }, r = (e.allowedCountryCodes || []).map((e) => e.toLowerCase()).filter(Boolean);
2596
2596
  if (r.length && (n.onlyCountries = r, n.initialCountry = r[0], r.length === 1 && (n.allowDropdown = !1, n.separateDialCode = !1, n.nationalMode = !0)), e.countryDefaultValue ? n.initialCountry = e.countryDefaultValue.toLowerCase() : e.countryPreselectFromIp && (n.initialCountry = "auto", n.geoIpLookup = o(e.countryFromIpAction, t)), Array.isArray(n.onlyCountries) && typeof n.initialCountry == "string") {
2597
2597
  let e = n.initialCountry.toLowerCase();
2598
2598
  n.onlyCountries.includes(e) || n.onlyCountries.push(e);
@@ -26,13 +26,6 @@ var r = t({
26
26
  }));
27
27
  let s = t(i.apiKey, o);
28
28
  return s.on("pick", (t, i) => {
29
- n.dispatchEvent(new CustomEvent(e("place-kit", "populate"), {
30
- bubbles: !0,
31
- detail: {
32
- addressProvider: "place-kit",
33
- addressComponents: i
34
- }
35
- }));
36
29
  let a = "";
37
30
  i.street && (a = [
38
31
  i.street.number ?? "",
@@ -40,7 +33,14 @@ var r = t({
40
33
  i.street.suffix ?? ""
41
34
  ].filter(Boolean).join(" "));
42
35
  let o = Array.isArray(i.zipcode) ? i.zipcode[0] : i.zipcode, s = i.countrycode ? i.countrycode.toUpperCase() : i.country || "";
43
- r.input.setValue("address1", a), r.input.setValue("city", i.city || ""), r.input.setValue("state", i.administrative || ""), r.input.setValue("zip", typeof o == "string" ? o : ""), r.input.setValue("country", s || i.country || "");
36
+ r.input.setValue("address1", a), r.input.setValue("city", i.city || ""), r.input.setValue("state", i.administrative || ""), r.input.setValue("zip", typeof o == "string" ? o : ""), r.input.setValue("country", s || i.country || ""), n.dispatchEvent(new CustomEvent(e("place-kit", "populate"), {
37
+ bubbles: !0,
38
+ detail: {
39
+ addressProvider: "place-kit",
40
+ addressComponents: i,
41
+ state: i.administrative || ""
42
+ }
43
+ }));
44
44
  }), s;
45
45
  }
46
46
  });
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-DYYsVIub.js";
2
- import { n as t, t as n } from "./recaptcha-shared-AQRMDMme.js";
1
+ import { t as e } from "./api-BK9b340y.js";
2
+ import { n as t, t as n } from "./recaptcha-shared-DTbTw-MF.js";
3
3
  //#region src/js/modules/captchas/recaptcha-enterprise.ts
4
4
  var r = e({
5
5
  moduleId: "formie:recaptcha-enterprise",
@@ -1,5 +1,5 @@
1
- import { a as e, r as t } from "./api-DYYsVIub.js";
2
- import { r as n } from "./scripts-CbQ7agX3.js";
1
+ import { a as e, r as t } from "./api-BK9b340y.js";
2
+ import { r as n } from "./scripts-DrccjrFv.js";
3
3
  //#region src/js/modules/captchas/recaptcha-shared.ts
4
4
  async function r(r, i = !1, a) {
5
5
  let o = typeof r.language == "string" && r.language.trim() !== "" ? r.language.trim() : "en", { async: s, defer: c } = t(r.loadingMethod), l = i ? "https://www.google.com/recaptcha/enterprise.js" : "https://www.recaptcha.net/recaptcha/api.js", u = typeof a == "string" && a.trim() !== "" ? a.trim() : "explicit", d = new URL(l);
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-DYYsVIub.js";
2
- import { t } from "./recaptcha-shared-AQRMDMme.js";
1
+ import { t as e } from "./api-BK9b340y.js";
2
+ import { t } from "./recaptcha-shared-DTbTw-MF.js";
3
3
  //#region src/js/modules/captchas/recaptcha-v2-checkbox.ts
4
4
  var n = e({
5
5
  moduleId: "formie:recaptcha-v2-checkbox",
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-DYYsVIub.js";
2
- import { t } from "./recaptcha-shared-AQRMDMme.js";
1
+ import { t as e } from "./api-BK9b340y.js";
2
+ import { t } from "./recaptcha-shared-DTbTw-MF.js";
3
3
  //#region src/js/modules/captchas/recaptcha-v2-invisible.ts
4
4
  async function n(e, t, n = 1e3) {
5
5
  let r = Date.now() + n;
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-DYYsVIub.js";
2
- import { n as t, t as n } from "./recaptcha-shared-AQRMDMme.js";
1
+ import { t as e } from "./api-BK9b340y.js";
2
+ import { n as t, t as n } from "./recaptcha-shared-DTbTw-MF.js";
3
3
  //#region src/js/modules/captchas/recaptcha-v3.ts
4
4
  var r = e({
5
5
  moduleId: "formie:recaptcha-v3",
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./debug-BV0DvdHx.js";
2
- import { n as t } from "./async-nPFRNQ06.js";
2
+ import { n as t } from "./async-2GdXNFCE.js";
3
3
  import { t as n } from "./styles-BfoIZwJp.js";
4
4
  import { n as r, o as i, s as a } from "./shared-OKhSay59.js";
5
5
  //#region src/css/theme/fields/_repeater.css?inline
@@ -15,7 +15,11 @@ function g(e, t) {
15
15
  function _(e) {
16
16
  return e.querySelectorAll(l).length;
17
17
  }
18
- function v(e, t) {
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
25
  if (n > 0 && t >= n) {
@@ -24,67 +28,77 @@ function v(e, t) {
24
28
  }
25
29
  e.disabled = !1;
26
30
  }
27
- function y(e) {
28
- let n = e.matches(c) ? e : e.querySelector(c), i = e.querySelector(u);
29
- if (!(n instanceof HTMLElement)) return m.warn("Missing repeater container; skipping field."), () => {};
30
- let o = /* @__PURE__ */ new Map(), s = Array.from(e.querySelectorAll(l)).reduce((e, t) => {
31
+ function b(e, n) {
32
+ let i = e.matches(c) ? e : e.querySelector(c), o = e.querySelector(u);
33
+ if (!(i instanceof HTMLElement)) return m.warn("Missing repeater container; skipping field."), () => {};
34
+ let s = e.closest("form"), b = !1, x = 0, S = /* @__PURE__ */ new Map(), C = Array.from(e.querySelectorAll(l)).reduce((e, t) => {
31
35
  let n = parseInt(t.getAttribute("data-formie-repeater-item-id") || "", 10);
32
36
  return Number.isNaN(n) ? e : Math.max(e, n + 1);
33
- }, 0), y = () => {
37
+ }, 0), w = () => {
34
38
  e.querySelectorAll(d).forEach((t) => {
35
- if (!(t instanceof HTMLElement) || o.has(t)) return;
36
- let n = (n) => {
37
- n.preventDefault();
39
+ if (!(t instanceof HTMLElement) || S.has(t)) return;
40
+ let i = (i) => {
41
+ i.preventDefault();
38
42
  let a = t.closest(l);
39
43
  if (!(a instanceof HTMLElement)) return;
40
- let o = parseInt((i instanceof HTMLButtonElement ? i.getAttribute("data-formie-min-rows") : "") || "", 10);
41
- o > 0 && _(e) <= o || (a.remove(), v(i instanceof HTMLButtonElement ? i : null, _(e)), m.log("Row removed.", { rowCount: _(e) }), r(e, p, "remove", {
44
+ let s = parseInt((o instanceof HTMLButtonElement ? o.getAttribute("data-formie-min-rows") : "") || "", 10);
45
+ if (s > 0 && _(e) <= s) return;
46
+ let c = a.contains(document.activeElement) && (!n || i instanceof MouseEvent && i.detail === 0), u = a.nextElementSibling, d = a.previousElementSibling;
47
+ 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
48
  repeater: e,
43
49
  row: a
44
- }));
50
+ });
45
51
  };
46
- t.addEventListener("click", n), o.set(t, n);
52
+ t.addEventListener("click", i), S.set(t, i);
47
53
  });
48
- }, b = async () => {
49
- if (!(i instanceof HTMLButtonElement)) return;
50
- let o = i.getAttribute("data-formie-repeater-add");
51
- if (!o) {
54
+ }, T = async (n = !1) => {
55
+ if (!(o instanceof HTMLButtonElement)) return;
56
+ let s = o.getAttribute("data-formie-repeater-add");
57
+ if (!s) {
52
58
  m.warn("Add handle missing.");
53
59
  return;
54
60
  }
55
- let c = i.getAttribute(f) || e.getAttribute(f), l = parseInt(i.getAttribute("data-formie-max-rows") || "", 10);
61
+ let c = o.getAttribute(f) || e.getAttribute(f), l = parseInt(o.getAttribute("data-formie-max-rows") || "", 10);
56
62
  if (l > 0 && _(e) >= l) return;
57
63
  let u = h(e, c);
58
64
  if (!u) {
59
- m.warn("Template not found for add action.", { handle: o });
65
+ m.warn("Template not found for add action.", { handle: s });
60
66
  return;
61
67
  }
62
- let d = g(a(u), s++);
68
+ let d = g(a(u), C++);
63
69
  if (!d) {
64
70
  m.warn("Failed to build row from template.");
65
71
  return;
66
72
  }
67
- n.appendChild(d), await t(50), y(), v(i, _(e)), m.log("Row appended.", { rowCount: _(e) }), r(e, p, "append", {
73
+ let S = x;
74
+ 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
75
  repeater: e,
69
76
  row: d
70
77
  }), r(e, p, "init-row", {
71
78
  repeater: e,
72
79
  row: d
73
- });
74
- }, x = (e) => {
75
- e.preventDefault(), b();
80
+ }));
81
+ }, E = (e) => {
82
+ e.preventDefault();
83
+ let t = !n || e instanceof MouseEvent && e.detail === 0;
84
+ T(t);
76
85
  };
77
- if (i instanceof HTMLButtonElement && i.addEventListener("click", x), y(), v(i instanceof HTMLButtonElement ? i : null, _(e)), i instanceof HTMLButtonElement && _(e) === 0) {
78
- let e = parseInt(i.getAttribute("data-formie-min-rows") || "", 10);
79
- for (let t = 0; t < e; t += 1) b();
86
+ if (o instanceof HTMLButtonElement && o.addEventListener("click", E), w(), y(o instanceof HTMLButtonElement ? o : null, _(e)), o instanceof HTMLButtonElement && _(e) === 0) {
87
+ let e = parseInt(o.getAttribute("data-formie-min-rows") || "", 10);
88
+ for (let t = 0; t < e; t += 1) T();
80
89
  }
81
- return r(e, p, "init", { repeater: e }), m.log("Field initialized.", { rowCount: _(e) }), () => {
82
- i instanceof HTMLButtonElement && i.removeEventListener("click", x), o.forEach((e, t) => {
90
+ let D = Array.from(i.children).map((e) => e.cloneNode(!0)), O = (t) => {
91
+ queueMicrotask(() => {
92
+ 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)));
93
+ });
94
+ };
95
+ return s?.addEventListener("reset", O), r(e, p, "init", { repeater: e }), m.log("Field initialized.", { rowCount: _(e) }), () => {
96
+ b = !0, s?.removeEventListener("reset", O), o instanceof HTMLButtonElement && o.removeEventListener("click", E), S.forEach((e, t) => {
83
97
  t.removeEventListener("click", e);
84
98
  });
85
99
  };
86
100
  }
87
- var b = {
101
+ var x = {
88
102
  moduleId: `formie:${p}`,
89
103
  version: 2,
90
104
  surfaces: [
@@ -96,7 +110,7 @@ var b = {
96
110
  match: (e) => e.target instanceof HTMLElement && (e.target.matches(s) || !!e.target.querySelector(s)),
97
111
  setup: async (e) => {
98
112
  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((e) => y(e));
113
+ 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
114
  return m.log("Module setup.", { fieldCount: t.length }), await e.emit("formie:module:repeater:init", { count: t.length }), { destroy: () => {
101
115
  n.forEach((e) => {
102
116
  e();
@@ -105,4 +119,4 @@ var b = {
105
119
  }
106
120
  };
107
121
  //#endregion
108
- export { b as repeaterModule };
122
+ export { x as repeaterModule };
@@ -1,4 +1,4 @@
1
- import { r as e } from "./async-nPFRNQ06.js";
1
+ import { r as e } from "./async-2GdXNFCE.js";
2
2
  //#region src/js/utils/scripts.ts
3
3
  var t = /* @__PURE__ */ new Map();
4
4
  function n() {
@@ -0,0 +1,7 @@
1
+ //#region src/js/validation/skip.ts
2
+ var e = "data-formie-validation-skip";
3
+ function t(e) {
4
+ return !!e && e.hasAttribute("data-formie-validation-skip");
5
+ }
6
+ //#endregion
7
+ export { t as n, e as t };
@@ -1,4 +1,4 @@
1
- import { n as e } from "./api-DYYsVIub.js";
1
+ import { n as e } from "./api-BK9b340y.js";
2
2
  //#region src/js/modules/captchas/snaptcha.ts
3
3
  var t = e({
4
4
  moduleId: "formie:snaptcha",
@@ -1,5 +1,5 @@
1
- import { t as e } from "./api-D6kJ7kXZ.js";
2
- import { r as t } from "./scripts-CbQ7agX3.js";
1
+ import { t as e } from "./api-Dxl_CKw-.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-D6kJ7kXZ.js";
2
+ import { t } from "./api-Dxl_CKw-.js";
3
3
  import { i as n, t as r } from "./theme-classes-DAQuEqdP.js";
4
- import { r as i } from "./scripts-CbQ7agX3.js";
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
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./debug-BV0DvdHx.js";
2
2
  import { a as t } from "./theme-classes-DAQuEqdP.js";
3
3
  import { r as n } from "./http-C2QdHuWO.js";
4
- import { t as r } from "./async-nPFRNQ06.js";
4
+ import { t as r } from "./async-2GdXNFCE.js";
5
5
  import { t as i } from "./styles-BfoIZwJp.js";
6
6
  import { i as a, n as o } from "./shared-OKhSay59.js";
7
7
  //#region src/css/theme/fields/_summary.css?inline
@@ -1,4 +1,4 @@
1
- import { n as e } from "./async-nPFRNQ06.js";
1
+ import { n as e } from "./async-2GdXNFCE.js";
2
2
  import { t } from "./styles-BfoIZwJp.js";
3
3
  import { n, o as r, s as i } from "./shared-OKhSay59.js";
4
4
  //#region src/css/theme/fields/_table.css?inline
@@ -1,5 +1,5 @@
1
- import { a as e, i as t, o as n, r, t as i } from "./api-DYYsVIub.js";
2
- import { r as a } from "./scripts-CbQ7agX3.js";
1
+ import { a as e, i as t, o as n, r, t as i } from "./api-BK9b340y.js";
2
+ import { r as a } from "./scripts-DrccjrFv.js";
3
3
  //#region src/js/modules/captchas/turnstile.ts
4
4
  function o(e) {
5
5
  let r = e.appearance || "always";