@verbb/formie-browser 1.0.6 → 1.0.7
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 +11 -0
- package/dist/chunks/{address-finder-yXU5yMjG.js → address-finder-k7_BXaRe.js} +1 -1
- package/dist/chunks/{api-DMK8NSUI.js → api-BUb6P-xu.js} +57 -51
- package/dist/chunks/{api-CmwLRq_n.js → api-DztsCJ4r.js} +178 -170
- package/dist/chunks/{bpoint-DSjqRv63.js → bpoint-2qDxlKD9.js} +1 -1
- package/dist/chunks/{captcha-eu-CWJb64_j.js → captcha-eu-CGm8Lbrj.js} +2 -2
- package/dist/chunks/{conditions-DjZOtHfS.js → conditions-B6_nzpeE.js} +95 -83
- package/dist/chunks/{eway-D3ctTbEk.js → eway-CImXrB4g.js} +2 -2
- package/dist/chunks/{friendly-captcha-v1-ByXzENYZ.js → friendly-captcha-v1-C_2reOXr.js} +1 -1
- package/dist/chunks/{friendly-captcha-v2-BPdlmhQu.js → friendly-captcha-v2-CLSAbkqx.js} +1 -1
- package/dist/chunks/{go-cardless-BwASSYSK.js → go-cardless-Bz7HHtH0.js} +1 -1
- package/dist/chunks/{google-address-OhKilPWE.js → google-address-BH3Zhi06.js} +1 -1
- package/dist/chunks/{hcaptcha-CdCd9oEi.js → hcaptcha-CGLAmgjO.js} +2 -2
- package/dist/chunks/{loqate-Cp2zvwpE.js → loqate-CJPzBmSm.js} +1 -1
- package/dist/chunks/{mollie-COG-ko2D.js → mollie-BtnB3KGh.js} +1 -1
- package/dist/chunks/{moneris-CMH8PlRc.js → moneris-Bd4vUk8b.js} +1 -1
- package/dist/chunks/{opayo-D2jsR5vh.js → opayo-B-eRIXo-.js} +4 -4
- package/dist/chunks/{paddle-DxF88RfC.js → paddle-BUFeEU4d.js} +2 -2
- package/dist/chunks/{paypal-b5pnwrA2.js → paypal-8Euw7Hrn.js} +2 -2
- package/dist/chunks/{payway-BJYu9DIR.js → payway-dV0SzJxy.js} +2 -2
- package/dist/chunks/{recaptcha-enterprise-BSwi8IVX.js → recaptcha-enterprise-XPId5-bS.js} +19 -20
- package/dist/chunks/{recaptcha-shared-B4zAescW.js → recaptcha-shared-CLYJvojk.js} +15 -3
- package/dist/chunks/{recaptcha-v2-checkbox-CnDQmsKa.js → recaptcha-v2-checkbox-Cy-0PEPc.js} +2 -2
- package/dist/chunks/{recaptcha-v2-invisible-Cz5uIlp-.js → recaptcha-v2-invisible-BwRH540O.js} +2 -2
- package/dist/chunks/recaptcha-v3-No4Ykrhk.js +28 -0
- package/dist/chunks/scripts-CbQ7agX3.js +30 -0
- package/dist/chunks/{snaptcha-vz1RnZ15.js → snaptcha-DKx98oon.js} +1 -1
- package/dist/chunks/{square-BP8RWAKB.js → square-reyJukb7.js} +2 -2
- package/dist/chunks/{stripe-MihN63uC.js → stripe-BC-2PBvY.js} +2 -2
- package/dist/chunks/{turnstile-D_Pi1CKM.js → turnstile-DJakPzQD.js} +3 -3
- package/dist/index.js +624 -574
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/error-aria-live.d.ts +6 -0
- package/dist/js/core/error-aria-live.d.ts.map +1 -0
- 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/modules/captchas/factories.d.ts.map +1 -1
- package/dist/js/modules/captchas/host.d.ts +1 -0
- package/dist/js/modules/captchas/host.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-shared.d.ts +1 -0
- 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/captchas/turnstile.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
- package/dist/js/utils/form-started-at.d.ts +2 -0
- package/dist/js/utils/form-started-at.d.ts.map +1 -0
- package/dist/js/utils/scripts.d.ts.map +1 -1
- package/dist/js/utils/unload-warning.d.ts.map +1 -1
- package/dist/js/validation/enter-key-guard.d.ts +2 -0
- package/dist/js/validation/enter-key-guard.d.ts.map +1 -0
- package/dist/js/validation/types.d.ts +1 -0
- package/dist/js/validation/types.d.ts.map +1 -1
- package/dist/js/validation/validator.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/js/core/create-formie-client.ts +7 -0
- package/src/js/core/error-aria-live.ts +45 -0
- package/src/js/core/submit-result-state.ts +4 -0
- package/src/js/core/submit-result-ui.ts +8 -4
- package/src/js/modules/captchas/factories.ts +4 -0
- package/src/js/modules/captchas/host.ts +14 -2
- package/src/js/modules/captchas/recaptcha-enterprise.ts +14 -11
- package/src/js/modules/captchas/recaptcha-shared.ts +14 -0
- package/src/js/modules/captchas/recaptcha-v3.ts +7 -4
- package/src/js/modules/captchas/turnstile.ts +9 -3
- package/src/js/modules/fields/conditions/effects.ts +42 -0
- package/src/js/utils/form-started-at.ts +25 -0
- package/src/js/utils/scripts.ts +16 -0
- package/src/js/utils/unload-warning.ts +1 -0
- package/src/js/validation/enter-key-guard.ts +63 -0
- package/src/js/validation/types.ts +1 -0
- package/src/js/validation/validator.ts +14 -5
- package/dist/chunks/recaptcha-v3-BtbbP111.js +0 -27
- package/dist/chunks/scripts-6CYSUGKQ.js +0 -24
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e, t } from "./api-
|
|
2
|
-
import { r as n } from "./scripts-
|
|
1
|
+
import { a as e, t } from "./api-BUb6P-xu.js";
|
|
2
|
+
import { r as n } from "./scripts-CbQ7agX3.js";
|
|
3
3
|
//#region src/js/modules/captchas/captcha-eu.ts
|
|
4
4
|
async function r(t) {
|
|
5
5
|
return n("KROT", {
|
|
@@ -52,20 +52,32 @@ function c(e) {
|
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region src/js/modules/fields/conditions/effects.ts
|
|
55
|
-
var l = "data-formie-conditions-disabled", u = "data-formie-preserve-disabled", d = "data-formie-conditionally-hidden", f = "data-formie-page-hidden", p = "formie-conditionally-hidden", m = "fui-cp-muted-conditional-field", h = "fui-cp-muted-conditional-field--expanded", g = "data-formie-cp-muted", _ = "formie-page-hidden", v = "data-formie-row-hidden", y = "formie-row-hidden", b = "data-formie-field-count", x = "[data-formie-row], [data-formie-subfield-row], [data-formie-nested-field-row]",
|
|
56
|
-
function
|
|
55
|
+
var l = "data-formie-conditions-disabled", u = "data-formie-preserve-disabled", d = "data-formie-conditionally-hidden", f = "data-formie-page-hidden", p = "formie-conditionally-hidden", m = "fui-cp-muted-conditional-field", h = "fui-cp-muted-conditional-field--expanded", g = "data-formie-cp-muted", _ = "formie-page-hidden", v = "data-formie-row-hidden", y = "formie-row-hidden", b = "data-formie-field-count", x = "[data-formie-row], [data-formie-subfield-row], [data-formie-nested-field-row]", ee = ":scope > [data-formie-field]";
|
|
56
|
+
function S(e) {
|
|
57
57
|
e.querySelectorAll("input, select, textarea").forEach((e) => {
|
|
58
58
|
!(e instanceof HTMLInputElement) && !(e instanceof HTMLSelectElement) && !(e instanceof HTMLTextAreaElement) || (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio" ? e.checked = !1 : e.type !== "hidden" && (e.value = "")), e instanceof HTMLSelectElement && (e.multiple ? Array.from(e.options).forEach((e) => {
|
|
59
59
|
e.selected = !1;
|
|
60
60
|
}) : e.selectedIndex = 0), e instanceof HTMLTextAreaElement && (e.value = ""));
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function te(e, t) {
|
|
64
64
|
let n = e.hasAttribute("data-formie-page"), r = n ? f : d, i = n ? _ : p, a = e.hasAttribute(r);
|
|
65
65
|
return t ? (a || e.setAttribute(r, "true"), e.classList.contains(i) || e.classList.add(i)) : (a && e.removeAttribute(r), e.classList.contains(i) && e.classList.remove(i)), a !== t;
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
var C = "button[type=\"submit\"], button[data-formie-action], input[type=\"submit\"]";
|
|
68
|
+
function w(e, t) {
|
|
69
|
+
if (e instanceof HTMLButtonElement || e instanceof HTMLInputElement) {
|
|
70
|
+
if (t) {
|
|
71
|
+
e.hasAttribute(l) || (e.hasAttribute("disabled") && e.setAttribute(u, "true"), e.setAttribute(l, "true")), e.setAttribute("disabled", "true");
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
e.hasAttribute(l) && (e.hasAttribute(u) ? (e.setAttribute("disabled", "true"), e.removeAttribute(u)) : e.removeAttribute("disabled"), e.removeAttribute(l));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function T(e, t) {
|
|
78
|
+
e.matches(C) && w(e, t), e.querySelectorAll(C).forEach((e) => {
|
|
79
|
+
w(e, t);
|
|
80
|
+
}), e.querySelectorAll("input, textarea, select").forEach((e) => {
|
|
69
81
|
if (t) {
|
|
70
82
|
e.hasAttribute(l) || (e.hasAttribute("disabled") && e.setAttribute(u, "true"), e.setAttribute(l, "true")), e.setAttribute("disabled", "true");
|
|
71
83
|
return;
|
|
@@ -73,11 +85,11 @@ function ee(e, t) {
|
|
|
73
85
|
e.hasAttribute(l) && (e.hasAttribute(u) ? (e.setAttribute("disabled", "true"), e.removeAttribute(u)) : e.removeAttribute("disabled"), e.removeAttribute(l));
|
|
74
86
|
});
|
|
75
87
|
}
|
|
76
|
-
function
|
|
88
|
+
function ne(e) {
|
|
77
89
|
return !e.hasAttribute(d) && !e.hasAttribute(f) && !e.hasAttribute(v) && !e.hasAttribute("hidden");
|
|
78
90
|
}
|
|
79
|
-
function
|
|
80
|
-
let t = Array.from(e.querySelectorAll(
|
|
91
|
+
function E(e) {
|
|
92
|
+
let t = Array.from(e.querySelectorAll(ee)).filter((e) => ne(e)).length;
|
|
81
93
|
if (t > 0) {
|
|
82
94
|
let n = String(t);
|
|
83
95
|
e.getAttribute(b) !== n && e.setAttribute(b, n), e.hasAttribute(v) && e.removeAttribute(v), e.classList.contains(y) && e.classList.remove(y);
|
|
@@ -85,93 +97,93 @@ function ne(e) {
|
|
|
85
97
|
}
|
|
86
98
|
e.hasAttribute(b) && e.removeAttribute(b), e.hasAttribute(v) || e.setAttribute(v, "true"), e.classList.contains(y) || e.classList.add(y);
|
|
87
99
|
}
|
|
88
|
-
function
|
|
100
|
+
function D(e) {
|
|
89
101
|
e.removeAttribute(g), e.classList.remove(m), e.classList.remove(h);
|
|
90
102
|
}
|
|
91
|
-
function
|
|
103
|
+
function O(e) {
|
|
92
104
|
e.removeAttribute(d), e.removeAttribute(f), e.classList.remove(p), e.classList.remove(_);
|
|
93
105
|
}
|
|
94
|
-
function
|
|
106
|
+
function k(e) {
|
|
95
107
|
let t = e.closest(x);
|
|
96
|
-
for (; t;)
|
|
108
|
+
for (; t;) E(t), t = t.parentElement?.closest(x) || null;
|
|
97
109
|
}
|
|
98
|
-
function
|
|
99
|
-
if (r.displayMode === "muted") return
|
|
110
|
+
function A(e, t, n, r = {}) {
|
|
111
|
+
if (r.displayMode === "muted") return j(e, t);
|
|
100
112
|
let i = !1;
|
|
101
|
-
return (e.hasAttribute(g) || e.classList.contains(m) || e.classList.contains(h)) && (
|
|
113
|
+
return (e.hasAttribute(g) || e.classList.contains(m) || e.classList.contains(h)) && (D(e), i = !0), i = te(e, t) || i, T(e, t), k(e), t && n && i && S(e), i;
|
|
102
114
|
}
|
|
103
|
-
function
|
|
115
|
+
function j(e, t) {
|
|
104
116
|
let n = !1;
|
|
105
|
-
return t ? ((e.hasAttribute(d) || e.hasAttribute(f) || e.classList.contains(p) || e.classList.contains(_)) && (
|
|
117
|
+
return t ? ((e.hasAttribute(d) || e.hasAttribute(f) || e.classList.contains(p) || e.classList.contains(_)) && (O(e), n = !0), e.hasAttribute(g) || (e.setAttribute(g, "true"), n = !0), e.classList.contains(m) || (e.classList.add(m), n = !0)) : ((e.hasAttribute(g) || e.classList.contains(m) || e.classList.contains(h)) && (D(e), n = !0), (e.hasAttribute(d) || e.hasAttribute(f) || e.classList.contains(p) || e.classList.contains(_)) && (O(e), n = !0)), k(e), n;
|
|
106
118
|
}
|
|
107
119
|
//#endregion
|
|
108
120
|
//#region src/js/modules/fields/conditions/references.ts
|
|
109
|
-
var
|
|
110
|
-
function
|
|
121
|
+
var M = "input, select, textarea", re = "[data-formie-repeater-item], [data-formie-table-row]";
|
|
122
|
+
function N(e) {
|
|
111
123
|
return e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement;
|
|
112
124
|
}
|
|
113
|
-
function
|
|
114
|
-
let t = e.querySelector(
|
|
125
|
+
function ie(e) {
|
|
126
|
+
let t = e.querySelector(M);
|
|
115
127
|
if (!t) return null;
|
|
116
128
|
let n = t.getAttribute("name") || "", r = Array.from(n.matchAll(/\[(\d+)\]/g));
|
|
117
129
|
return r.length && r[r.length - 1]?.[1] || null;
|
|
118
130
|
}
|
|
119
|
-
function
|
|
120
|
-
return e.closest(
|
|
131
|
+
function P(e) {
|
|
132
|
+
return e.closest(re);
|
|
121
133
|
}
|
|
122
|
-
function
|
|
123
|
-
return Array.from(e.querySelectorAll(
|
|
134
|
+
function F(e) {
|
|
135
|
+
return Array.from(e.querySelectorAll(M)).filter((e) => N(e));
|
|
124
136
|
}
|
|
125
|
-
function
|
|
137
|
+
function I(e) {
|
|
126
138
|
let t = e.getAttribute("name") || "";
|
|
127
139
|
return Array.from(t.matchAll(/\[([^\]]+)\]/g)).map((e) => e[1] || "").filter(Boolean);
|
|
128
140
|
}
|
|
129
|
-
function
|
|
141
|
+
function L(e, t) {
|
|
130
142
|
if (!t) return !0;
|
|
131
143
|
let n = t.split(/[.:]/).filter(Boolean);
|
|
132
144
|
if (!n.length) return !0;
|
|
133
|
-
let r =
|
|
145
|
+
let r = I(e);
|
|
134
146
|
return r.length < n.length ? !1 : n.every((e, t) => r[r.length - n.length + t] === e);
|
|
135
147
|
}
|
|
136
|
-
function
|
|
148
|
+
function R(e, t) {
|
|
137
149
|
if (!t) return e;
|
|
138
|
-
let n = e.filter((e) =>
|
|
150
|
+
let n = e.filter((e) => L(e, t));
|
|
139
151
|
return n.length ? n : e;
|
|
140
152
|
}
|
|
141
|
-
function
|
|
142
|
-
let n =
|
|
153
|
+
function z(e, t) {
|
|
154
|
+
let n = P(e);
|
|
143
155
|
if (!n) return t;
|
|
144
|
-
let r = t.filter((e) =>
|
|
156
|
+
let r = t.filter((e) => P(e) === n);
|
|
145
157
|
return r.length ? r : t;
|
|
146
158
|
}
|
|
147
|
-
function
|
|
159
|
+
function B(e) {
|
|
148
160
|
return e.source?.target === "field" && e.source.handle ? e.source : null;
|
|
149
161
|
}
|
|
150
|
-
function
|
|
151
|
-
let a =
|
|
162
|
+
function V(e, r, i) {
|
|
163
|
+
let a = B(i);
|
|
152
164
|
if (!a || a.target !== "field" || !a.handle) return [];
|
|
153
165
|
let o = n(a.handle), s = Array.from(e.querySelectorAll(`[data-formie-field-handle="${o}"]`));
|
|
154
|
-
if (s.length) return
|
|
155
|
-
let c = n(t(a.handle)), l = Array.from(e.querySelectorAll(`[name="${c}"]`)).filter((e) =>
|
|
156
|
-
if (l.length || u.length) return
|
|
166
|
+
if (s.length) return z(r, s).flatMap((e) => R(F(e), a.selector));
|
|
167
|
+
let c = n(t(a.handle)), l = Array.from(e.querySelectorAll(`[name="${c}"]`)).filter((e) => N(e)), u = Array.from(e.querySelectorAll(`[name="${c}[]"]`)).filter((e) => N(e));
|
|
168
|
+
if (l.length || u.length) return z(r, [...l, ...u]);
|
|
157
169
|
if (!a.handle.includes("__ROW__")) return [];
|
|
158
|
-
let d =
|
|
170
|
+
let d = ie(r);
|
|
159
171
|
if (d) {
|
|
160
|
-
let r = n(t(a.handle.replace(/__ROW__/g, d))), i = Array.from(e.querySelectorAll(`[name="${r}"]`)).filter((e) =>
|
|
172
|
+
let r = n(t(a.handle.replace(/__ROW__/g, d))), i = Array.from(e.querySelectorAll(`[name="${r}"]`)).filter((e) => N(e)), o = Array.from(e.querySelectorAll(`[name="${r}[]"]`)).filter((e) => N(e));
|
|
161
173
|
if (i.length || o.length) return [...i, ...o];
|
|
162
174
|
}
|
|
163
175
|
let f = t(a.handle).replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/__ROW__/g, "\\d+"), p = new RegExp(f);
|
|
164
|
-
return Array.from(e.querySelectorAll("[name]")).filter((e) =>
|
|
176
|
+
return Array.from(e.querySelectorAll("[name]")).filter((e) => N(e) && p.test(e.getAttribute("name") || ""));
|
|
165
177
|
}
|
|
166
178
|
//#endregion
|
|
167
179
|
//#region src/js/modules/fields/conditions/transforms.ts
|
|
168
|
-
function
|
|
180
|
+
function H(e) {
|
|
169
181
|
return e == null ? "" : String(e);
|
|
170
182
|
}
|
|
171
|
-
function
|
|
183
|
+
function U(e) {
|
|
172
184
|
if (typeof e == "boolean") return e;
|
|
173
185
|
if (typeof e == "number") return e !== 0;
|
|
174
|
-
let t =
|
|
186
|
+
let t = H(e).trim().toLowerCase();
|
|
175
187
|
return !(!t || [
|
|
176
188
|
"0",
|
|
177
189
|
"false",
|
|
@@ -179,30 +191,30 @@ function B(e) {
|
|
|
179
191
|
"off"
|
|
180
192
|
].includes(t));
|
|
181
193
|
}
|
|
182
|
-
function
|
|
194
|
+
function W(e) {
|
|
183
195
|
return e.toLowerCase().replace(/\b\w/g, (e) => e.toUpperCase());
|
|
184
196
|
}
|
|
185
|
-
function
|
|
197
|
+
function G(e, t) {
|
|
186
198
|
let n = Number.isFinite(Number(t.decimals)) ? Number(t.decimals) : 0, r = t.decimalPoint ?? ".", i = t.thousandsSeparator ?? ",", [a, o = ""] = e.toFixed(n).split("."), s = a.replace(/\B(?=(\d{3})+(?!\d))/g, i);
|
|
187
199
|
return n === 0 ? s : `${s}${r}${o}`;
|
|
188
200
|
}
|
|
189
|
-
function
|
|
201
|
+
function K(e) {
|
|
190
202
|
return String(e).padStart(2, "0");
|
|
191
203
|
}
|
|
192
|
-
function
|
|
204
|
+
function q(e, t) {
|
|
193
205
|
return [
|
|
194
206
|
["Y", String(e.getFullYear())],
|
|
195
|
-
["m",
|
|
196
|
-
["d",
|
|
207
|
+
["m", K(e.getMonth() + 1)],
|
|
208
|
+
["d", K(e.getDate())],
|
|
197
209
|
["j", String(e.getDate())],
|
|
198
|
-
["H",
|
|
199
|
-
["h",
|
|
200
|
-
["i",
|
|
210
|
+
["H", K(e.getHours())],
|
|
211
|
+
["h", K((e.getHours() + 11) % 12 + 1)],
|
|
212
|
+
["i", K(e.getMinutes())],
|
|
201
213
|
["A", e.getHours() >= 12 ? "PM" : "AM"],
|
|
202
214
|
["F", e.toLocaleString(void 0, { month: "long" })]
|
|
203
215
|
].reduce((e, [t, n]) => e.replaceAll(t, n), t);
|
|
204
216
|
}
|
|
205
|
-
function
|
|
217
|
+
function J(e) {
|
|
206
218
|
switch (e) {
|
|
207
219
|
case "datetimeUs12": return "m/d/Y h:i A";
|
|
208
220
|
case "datetimeEu12": return "d/m/Y h:i A";
|
|
@@ -217,7 +229,7 @@ function G(e) {
|
|
|
217
229
|
default: return "";
|
|
218
230
|
}
|
|
219
231
|
}
|
|
220
|
-
function
|
|
232
|
+
function ae(e, t) {
|
|
221
233
|
let n = t.transformerId, r = t.transformerParams;
|
|
222
234
|
switch (n) {
|
|
223
235
|
case "round":
|
|
@@ -228,15 +240,15 @@ function K(e, t) {
|
|
|
228
240
|
}
|
|
229
241
|
case "format": {
|
|
230
242
|
let t = Number(e);
|
|
231
|
-
if (Number.isFinite(t) && e.trim() !== "") return
|
|
232
|
-
let n = r.preset || "", i = n === "custom" ? r.pattern || "" :
|
|
243
|
+
if (Number.isFinite(t) && e.trim() !== "") return G(t, r);
|
|
244
|
+
let n = r.preset || "", i = n === "custom" ? r.pattern || "" : J(n);
|
|
233
245
|
if (!i) return e;
|
|
234
246
|
let a = new Date(e);
|
|
235
|
-
return Number.isNaN(a.getTime()) ? e :
|
|
247
|
+
return Number.isNaN(a.getTime()) ? e : q(a, i);
|
|
236
248
|
}
|
|
237
249
|
case "lower": return e.toLowerCase();
|
|
238
250
|
case "upper": return e.toUpperCase();
|
|
239
|
-
case "title": return
|
|
251
|
+
case "title": return W(e);
|
|
240
252
|
case "capitalize": return e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
241
253
|
case "replace": {
|
|
242
254
|
let t = r.search || "";
|
|
@@ -246,61 +258,61 @@ function K(e, t) {
|
|
|
246
258
|
let t = Math.max(1, Number.parseInt(r.length || "50", 10) || 50), n = r.suffix || "...";
|
|
247
259
|
return e.length <= t ? e : `${e.slice(0, Math.max(0, t - n.length))}${n}`;
|
|
248
260
|
}
|
|
249
|
-
case "map": return
|
|
261
|
+
case "map": return U(e) ? r.trueLabel || "Yes" : r.falseLabel || "No";
|
|
250
262
|
default: return e;
|
|
251
263
|
}
|
|
252
264
|
}
|
|
253
|
-
function
|
|
265
|
+
function oe(e, t) {
|
|
254
266
|
if (!t) return e;
|
|
255
|
-
let n = t.transformerId ? e.map((e) =>
|
|
267
|
+
let n = t.transformerId ? e.map((e) => ae(e, t)) : e;
|
|
256
268
|
return (n.length === 0 || n.every((e) => e.trim() === "")) && t.defaultValue ? [t.defaultValue] : n;
|
|
257
269
|
}
|
|
258
270
|
//#endregion
|
|
259
271
|
//#region src/js/modules/fields/conditions/values.ts
|
|
260
|
-
function
|
|
272
|
+
function se(e, t) {
|
|
261
273
|
return e.name || `__condition_input_${t}`;
|
|
262
274
|
}
|
|
263
|
-
function
|
|
275
|
+
function Y(e) {
|
|
264
276
|
return (e.id ? e.ownerDocument.querySelector(`label[for="${e.id}"]`)?.textContent?.trim() : "") || e.closest("label")?.textContent?.trim() || "";
|
|
265
277
|
}
|
|
266
|
-
function
|
|
278
|
+
function ce(e, t = "") {
|
|
267
279
|
let n = e[0];
|
|
268
280
|
if (!n) return [];
|
|
269
281
|
if (n instanceof HTMLInputElement) {
|
|
270
282
|
if (n.type === "checkbox") {
|
|
271
283
|
let n = e.filter((e) => e instanceof HTMLInputElement && e.checked);
|
|
272
|
-
return t === "label" ? n.map((e) =>
|
|
284
|
+
return t === "label" ? n.map((e) => Y(e)).filter(Boolean) : n.map((e) => e.value);
|
|
273
285
|
}
|
|
274
286
|
if (n.type === "radio") {
|
|
275
287
|
let n = e.filter((e) => e instanceof HTMLInputElement && e.checked);
|
|
276
|
-
return t === "label" ? n.map((e) =>
|
|
288
|
+
return t === "label" ? n.map((e) => Y(e)).filter(Boolean) : n.map((e) => e.value);
|
|
277
289
|
}
|
|
278
290
|
if (n.type === "file") return Array.from(n.files || []).map((e) => e.name);
|
|
279
291
|
}
|
|
280
292
|
return n instanceof HTMLSelectElement && n.multiple ? t === "label" ? Array.from(n.selectedOptions).map((e) => e.label || e.text) : Array.from(n.selectedOptions).map((e) => e.value) : n instanceof HTMLSelectElement && t === "label" ? Array.from(n.selectedOptions).map((e) => e.label || e.text) : e.map((e) => e.value);
|
|
281
293
|
}
|
|
282
|
-
function
|
|
294
|
+
function X(e) {
|
|
283
295
|
return ["input", "change"];
|
|
284
296
|
}
|
|
285
|
-
function
|
|
297
|
+
function le(e, t = null) {
|
|
286
298
|
let n = /* @__PURE__ */ new Map();
|
|
287
299
|
return e.forEach((e, t) => {
|
|
288
|
-
let r =
|
|
300
|
+
let r = se(e, t), i = n.get(r) || [];
|
|
289
301
|
i.push(e), n.set(r, i);
|
|
290
|
-
}),
|
|
302
|
+
}), oe(Array.from(n.values()).flatMap((e) => ce(e, t?.selector || "")), t);
|
|
291
303
|
}
|
|
292
304
|
//#endregion
|
|
293
305
|
//#region src/js/modules/fields/conditions/evaluator.ts
|
|
294
|
-
function
|
|
306
|
+
function ue(e) {
|
|
295
307
|
return e.closest("[data-formie-conditionally-hidden]") || e.closest("[data-formie-page-hidden]") || e.closest("[hidden]") || e.closest("[aria-hidden=\"true\"]") ? !1 : !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length);
|
|
296
308
|
}
|
|
297
|
-
function
|
|
298
|
-
return e.length ? e.some((e) =>
|
|
309
|
+
function de(e) {
|
|
310
|
+
return e.length ? e.some((e) => ue(e)) : null;
|
|
299
311
|
}
|
|
300
|
-
function
|
|
312
|
+
function fe(e, t) {
|
|
301
313
|
return r(e, e.conditions.map((e) => {
|
|
302
314
|
let n = t(e);
|
|
303
|
-
return i(e,
|
|
315
|
+
return i(e, le(n, B(e)), { visibility: de(n) });
|
|
304
316
|
}));
|
|
305
317
|
}
|
|
306
318
|
//#endregion
|
|
@@ -310,7 +322,7 @@ function $(e) {
|
|
|
310
322
|
let t = /* @__PURE__ */ new Set();
|
|
311
323
|
return e.filter((e) => t.has(e) ? !1 : (t.add(e), !0));
|
|
312
324
|
}
|
|
313
|
-
var
|
|
325
|
+
var pe = {
|
|
314
326
|
id: "conditions",
|
|
315
327
|
kind: "field",
|
|
316
328
|
match: (e) => e.target instanceof HTMLElement && (e.target.matches("[data-formie-conditions]") || !!e.target.querySelector("[data-formie-conditions]")),
|
|
@@ -329,12 +341,12 @@ var de = {
|
|
|
329
341
|
return !n || !n.conditions.length ? [] : [{
|
|
330
342
|
node: e,
|
|
331
343
|
settings: n,
|
|
332
|
-
sourceInputs: $(n.conditions.flatMap((n) =>
|
|
344
|
+
sourceInputs: $(n.conditions.flatMap((n) => V(t, e, n)))
|
|
333
345
|
}];
|
|
334
346
|
}), u = e.options?.cpDisplayMode === "muted" ? "muted" : "hide", d = !1, f = () => {
|
|
335
347
|
let n = !1;
|
|
336
348
|
return r.forEach((r) => {
|
|
337
|
-
let i =
|
|
349
|
+
let i = fe(r.settings, (e) => V(t, r.node, e)), a = r.node.hasAttribute("data-formie-page") ? "hide" : u, o = A(r.node, i.shouldHide, r.settings.clearOnHide, { displayMode: a });
|
|
338
350
|
n ||= o, Q.log("Condition evaluated.", {
|
|
339
351
|
shouldHide: i.shouldHide,
|
|
340
352
|
finalResult: i.finalResult,
|
|
@@ -364,10 +376,10 @@ var de = {
|
|
|
364
376
|
let t = () => {
|
|
365
377
|
m();
|
|
366
378
|
};
|
|
367
|
-
|
|
379
|
+
X(e).forEach((n) => {
|
|
368
380
|
e.addEventListener(n, t);
|
|
369
381
|
}), n.push(() => {
|
|
370
|
-
|
|
382
|
+
X(e).forEach((n) => {
|
|
371
383
|
e.removeEventListener(n, t);
|
|
372
384
|
});
|
|
373
385
|
});
|
|
@@ -409,4 +421,4 @@ var de = {
|
|
|
409
421
|
}
|
|
410
422
|
};
|
|
411
423
|
//#endregion
|
|
412
|
-
export {
|
|
424
|
+
export { pe as conditionsModule };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "./api-
|
|
1
|
+
import { t as e } from "./api-DztsCJ4r.js";
|
|
2
2
|
import { r as t } from "./async-nPFRNQ06.js";
|
|
3
|
-
import { r as n } from "./scripts-
|
|
3
|
+
import { r as n } from "./scripts-CbQ7agX3.js";
|
|
4
4
|
//#region src/js/modules/payments/eway.ts
|
|
5
5
|
var r = [{
|
|
6
6
|
id: "FORMIE_EWAY_SCRIPT_MIN",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as e } from "./event-names-BCI2FLD8.js";
|
|
2
2
|
import { t } from "./api-sPqGbOww.js";
|
|
3
|
-
import { n, t as r } from "./scripts-
|
|
3
|
+
import { n, t as r } from "./scripts-CbQ7agX3.js";
|
|
4
4
|
//#region src/js/modules/address/google-address.ts
|
|
5
5
|
var i = "FORMIE_GOOGLE_ADDRESS_SCRIPT", a = "formieGoogleMapsReady", o = null;
|
|
6
6
|
async function s(e) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e, r as t, t as n } from "./api-
|
|
2
|
-
import { n as r, t as i } from "./scripts-
|
|
1
|
+
import { a as e, r as t, t as n } from "./api-BUb6P-xu.js";
|
|
2
|
+
import { n as r, t as i } from "./scripts-CbQ7agX3.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-sPqGbOww.js";
|
|
3
|
-
import { r as n } from "./scripts-
|
|
3
|
+
import { r as n } from "./scripts-CbQ7agX3.js";
|
|
4
4
|
//#region src/js/modules/address/loqate.ts
|
|
5
5
|
var r = "FORMIE_LOQATE_SCRIPT", i = t({
|
|
6
6
|
id: "loqate",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { s as e } from "./event-names-BCI2FLD8.js";
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { t as n } from "./
|
|
4
|
-
import { r } from "./scripts-
|
|
2
|
+
import { t } from "./api-DztsCJ4r.js";
|
|
3
|
+
import { t as n } from "./debug-BV0DvdHx.js";
|
|
4
|
+
import { r } from "./scripts-CbQ7agX3.js";
|
|
5
5
|
//#region src/js/modules/payments/opayo.ts
|
|
6
|
-
var i = "FORMIE_OPAYO_SCRIPT", a = "https://live.opayo.eu.elavon.com/api/v1/js/sagepay.js", o = "https://sandbox.opayo.eu.elavon.com/api/v1/js/sagepay.js", s =
|
|
6
|
+
var i = "FORMIE_OPAYO_SCRIPT", a = "https://live.opayo.eu.elavon.com/api/v1/js/sagepay.js", o = "https://sandbox.opayo.eu.elavon.com/api/v1/js/sagepay.js", s = n("payments", "opayo"), c = e("opayo", "challenge"), l = "formie:payment:opayo:challenge:response", u = t({
|
|
7
7
|
id: "opayo",
|
|
8
8
|
defaultRequiredInputSuffixes: ["opayoTokenId"],
|
|
9
9
|
load: async (e) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as e } from "./event-names-BCI2FLD8.js";
|
|
2
|
-
import { t } from "./api-
|
|
3
|
-
import { r as n } from "./scripts-
|
|
2
|
+
import { t } from "./api-DztsCJ4r.js";
|
|
3
|
+
import { r as n } from "./scripts-CbQ7agX3.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
|
id: "paddle",
|
|
@@ -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-DztsCJ4r.js";
|
|
2
|
+
import { r as t } from "./scripts-CbQ7agX3.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-
|
|
2
|
-
import { r as t } from "./scripts-
|
|
1
|
+
import { t as e } from "./api-DztsCJ4r.js";
|
|
2
|
+
import { r as t } from "./scripts-CbQ7agX3.js";
|
|
3
3
|
import { t as n } from "./styles-BfoIZwJp.js";
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region src/js/modules/payments/payway.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as e } from "./api-
|
|
2
|
-
import { t } from "./recaptcha-shared-
|
|
1
|
+
import { t as e } from "./api-BUb6P-xu.js";
|
|
2
|
+
import { n as t, t as n } from "./recaptcha-shared-CLYJvojk.js";
|
|
3
3
|
//#region src/js/modules/captchas/recaptcha-enterprise.ts
|
|
4
|
-
var
|
|
4
|
+
var r = e({
|
|
5
5
|
id: "recaptcha-enterprise",
|
|
6
6
|
defaultPlaceholderSelector: "[data-recaptcha-placeholder]",
|
|
7
7
|
defaultTokenFieldNames: ["g-recaptcha-response"],
|
|
8
|
-
load: ({ options: e }) =>
|
|
8
|
+
load: ({ options: e }) => n(e.provider, !0, (e.provider.enterpriseType === "score" || e.provider.enterpriseType === "policy") && e.provider.siteKey || void 0),
|
|
9
9
|
mount: ({ api: e, container: t, provider: n, services: r }) => {
|
|
10
10
|
let i = e.enterprise || e;
|
|
11
11
|
return new Promise((e) => {
|
|
@@ -33,23 +33,22 @@ var n = e({
|
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
},
|
|
36
|
-
screen: async ({ api: e, widget:
|
|
37
|
-
let
|
|
38
|
-
if (
|
|
39
|
-
if (
|
|
40
|
-
let e =
|
|
41
|
-
|
|
36
|
+
screen: async ({ api: e, widget: n, provider: r, placeholder: i, services: a, stageCtx: o }) => {
|
|
37
|
+
let s = e.enterprise || e;
|
|
38
|
+
if (r.enterpriseType === "checkbox") {
|
|
39
|
+
if (a.tokens.has()) return;
|
|
40
|
+
let e = a.errors.getDefaultMessage();
|
|
41
|
+
a.errors.show(e, i), o.abort(e);
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
if (!
|
|
45
|
-
if (
|
|
46
|
-
let e = await
|
|
47
|
-
typeof e == "string" && e.trim() !== "" &&
|
|
48
|
-
} else
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
44
|
+
if (!a.tokens.has() && (await t(e, async () => {
|
|
45
|
+
if (r.enterpriseType === "score" || r.enterpriseType === "policy") {
|
|
46
|
+
let e = await s.execute(r.siteKey || "", { action: r.action || "submit" });
|
|
47
|
+
typeof e == "string" && e.trim() !== "" && a.tokens.write(e.trim());
|
|
48
|
+
} else s.execute(n);
|
|
49
|
+
}), !await a.tokens.wait(12e4))) {
|
|
50
|
+
let e = a.errors.getDefaultMessage();
|
|
51
|
+
a.errors.show(e, i), o.abort(e);
|
|
53
52
|
}
|
|
54
53
|
},
|
|
55
54
|
reset: ({ api: e, widget: t, provider: n, services: r }) => {
|
|
@@ -62,4 +61,4 @@ var n = e({
|
|
|
62
61
|
}
|
|
63
62
|
});
|
|
64
63
|
//#endregion
|
|
65
|
-
export {
|
|
64
|
+
export { r as recaptchaEnterpriseModule };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e, r as t } from "./api-
|
|
2
|
-
import { r as n } from "./scripts-
|
|
1
|
+
import { a as e, r as t } from "./api-BUb6P-xu.js";
|
|
2
|
+
import { r as n } from "./scripts-CbQ7agX3.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);
|
|
@@ -11,5 +11,17 @@ async function r(r, i = !1, a) {
|
|
|
11
11
|
timeoutMs: e
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
+
function i(e, t) {
|
|
15
|
+
let n = e.enterprise || e;
|
|
16
|
+
return new Promise((e, r) => {
|
|
17
|
+
try {
|
|
18
|
+
n.ready(() => {
|
|
19
|
+
Promise.resolve(t()).then(e).catch(r);
|
|
20
|
+
});
|
|
21
|
+
} catch (e) {
|
|
22
|
+
r(e);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
14
26
|
//#endregion
|
|
15
|
-
export { r as t };
|
|
27
|
+
export { i as n, r as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./api-
|
|
2
|
-
import { t } from "./recaptcha-shared-
|
|
1
|
+
import { t as e } from "./api-BUb6P-xu.js";
|
|
2
|
+
import { t } from "./recaptcha-shared-CLYJvojk.js";
|
|
3
3
|
//#region src/js/modules/captchas/recaptcha-v2-checkbox.ts
|
|
4
4
|
var n = e({
|
|
5
5
|
id: "recaptcha-v2-checkbox",
|
package/dist/chunks/{recaptcha-v2-invisible-Cz5uIlp-.js → recaptcha-v2-invisible-BwRH540O.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./api-
|
|
2
|
-
import { t } from "./recaptcha-shared-
|
|
1
|
+
import { t as e } from "./api-BUb6P-xu.js";
|
|
2
|
+
import { t } from "./recaptcha-shared-CLYJvojk.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;
|