@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,9 +1,9 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-
|
|
1
|
+
import { t as e } from "./rolldown-runtime-VHNaYcLd.js";
|
|
2
2
|
//#region ../../node_modules/leaflet/dist/leaflet-src.js
|
|
3
|
-
var t = /* @__PURE__ */ e(((e, t) => {
|
|
3
|
+
var t = /* @__PURE__ */ e(((e, t, n) => {
|
|
4
4
|
(function(n, r) {
|
|
5
5
|
typeof e == "object" && t !== void 0 ? r(e) : typeof define == "function" && define.amd ? define(["exports"], r) : (n = typeof globalThis < "u" ? globalThis : n || self, r(n.leaflet = {}));
|
|
6
|
-
})(
|
|
6
|
+
})(n, (function(e) {
|
|
7
7
|
var t = "1.9.4";
|
|
8
8
|
function n(e) {
|
|
9
9
|
for (var t, n = 1, r = arguments.length, i; n < r; n++) for (t in i = arguments[n], i) e[t] = i[t];
|
|
@@ -146,7 +146,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
146
146
|
return this.prototype._initHooks = this.prototype._initHooks || [], this.prototype._initHooks.push(n), this;
|
|
147
147
|
};
|
|
148
148
|
function le(e) {
|
|
149
|
-
if (
|
|
149
|
+
if (typeof L < "u" && L && L.Mixin) {
|
|
150
150
|
e = g(e) ? e : [e];
|
|
151
151
|
for (var t = 0; t < e.length; t++) e[t] === L.Mixin.Events && console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.", (/* @__PURE__ */ Error()).stack);
|
|
152
152
|
}
|
|
@@ -170,11 +170,8 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
170
170
|
return this;
|
|
171
171
|
},
|
|
172
172
|
_on: function(e, t, n, r) {
|
|
173
|
-
if (typeof t != "function")
|
|
174
|
-
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
if (this._listens(e, t, n) === !1) {
|
|
173
|
+
if (typeof t != "function") console.warn("wrong listener type: " + typeof t);
|
|
174
|
+
else if (this._listens(e, t, n) === !1) {
|
|
178
175
|
n === this && (n = void 0);
|
|
179
176
|
var i = {
|
|
180
177
|
fn: t,
|
|
@@ -189,16 +186,13 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
189
186
|
if (arguments.length === 1) {
|
|
190
187
|
if (this._firingCount) for (i = 0, a = r.length; i < a; i++) r[i].fn = l;
|
|
191
188
|
delete this._events[e];
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
if (o !== !1) {
|
|
200
|
-
var s = r[o];
|
|
201
|
-
this._firingCount && (s.fn = l, this._events[e] = r = r.slice()), r.splice(o, 1);
|
|
189
|
+
} else if (typeof t != "function") console.warn("wrong listener type: " + typeof t);
|
|
190
|
+
else {
|
|
191
|
+
var o = this._listens(e, t, n);
|
|
192
|
+
if (o !== !1) {
|
|
193
|
+
var s = r[o];
|
|
194
|
+
this._firingCount && (s.fn = l, this._events[e] = r = r.slice()), r.splice(o, 1);
|
|
195
|
+
}
|
|
202
196
|
}
|
|
203
197
|
}
|
|
204
198
|
},
|
|
@@ -568,11 +562,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
568
562
|
})()
|
|
569
563
|
};
|
|
570
564
|
function me(e, t, n, r) {
|
|
571
|
-
|
|
572
|
-
this._a = e[0], this._b = e[1], this._c = e[2], this._d = e[3];
|
|
573
|
-
return;
|
|
574
|
-
}
|
|
575
|
-
this._a = e, this._b = t, this._c = n, this._d = r;
|
|
565
|
+
g(e) ? (this._a = e[0], this._b = e[1], this._c = e[2], this._d = e[3]) : (this._a = e, this._b = t, this._c = n, this._d = r);
|
|
576
566
|
}
|
|
577
567
|
me.prototype = {
|
|
578
568
|
transform: function(e, t) {
|
|
@@ -684,11 +674,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
684
674
|
return t === "touchstart" && gt(), ct[t] ? (n = ct[t].bind(this, n), e.addEventListener(st[t], n, !1), n) : (console.warn("wrong event specified:", t), l);
|
|
685
675
|
}
|
|
686
676
|
function ft(e, t, n) {
|
|
687
|
-
|
|
688
|
-
console.warn("wrong event specified:", t);
|
|
689
|
-
return;
|
|
690
|
-
}
|
|
691
|
-
e.removeEventListener(st[t], n, !1);
|
|
677
|
+
st[t] ? e.removeEventListener(st[t], n, !1) : console.warn("wrong event specified:", t);
|
|
692
678
|
}
|
|
693
679
|
function pt(e) {
|
|
694
680
|
lt[e.pointerId] = e;
|
|
@@ -721,11 +707,8 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
721
707
|
e.addEventListener("dblclick", t);
|
|
722
708
|
var n = 0, r;
|
|
723
709
|
function i(e) {
|
|
724
|
-
if (e.detail !== 1)
|
|
725
|
-
|
|
726
|
-
return;
|
|
727
|
-
}
|
|
728
|
-
if (!(e.pointerType === "mouse" || e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents)) {
|
|
710
|
+
if (e.detail !== 1) r = e.detail;
|
|
711
|
+
else if (!(e.pointerType === "mouse" || e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents)) {
|
|
729
712
|
var i = on(e);
|
|
730
713
|
if (!i.some(function(e) {
|
|
731
714
|
return e instanceof HTMLLabelElement && e.attributes.for;
|
|
@@ -1614,7 +1597,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
1614
1597
|
return F(t, "leaflet-control"), n.indexOf("bottom") === -1 ? r.appendChild(t) : r.insertBefore(t, r.firstChild), this._map.on("unload", this.remove, this), this;
|
|
1615
1598
|
},
|
|
1616
1599
|
remove: function() {
|
|
1617
|
-
return this._map
|
|
1600
|
+
return this._map &&= (P(this._container), this.onRemove && this.onRemove(this._map), this._map.off("unload", this.remove, this), null), this;
|
|
1618
1601
|
},
|
|
1619
1602
|
_refocusOnMap: function(e) {
|
|
1620
1603
|
this._map && e && e.screenX > 0 && e.screenY > 0 && this._map.getContainer().focus();
|
|
@@ -1874,7 +1857,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
1874
1857
|
return this.options.prefix = e, this._update(), this;
|
|
1875
1858
|
},
|
|
1876
1859
|
addAttribution: function(e) {
|
|
1877
|
-
return e
|
|
1860
|
+
return e && (this._attributions[e] || (this._attributions[e] = 0), this._attributions[e]++, this._update()), this;
|
|
1878
1861
|
},
|
|
1879
1862
|
removeAttribution: function(e) {
|
|
1880
1863
|
return e && this._attributions[e] && (this._attributions[e]--, this._update()), this;
|
|
@@ -1898,10 +1881,10 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
1898
1881
|
this._map = e;
|
|
1899
1882
|
},
|
|
1900
1883
|
enable: function() {
|
|
1901
|
-
return this._enabled
|
|
1884
|
+
return this._enabled || (this._enabled = !0, this.addHooks()), this;
|
|
1902
1885
|
},
|
|
1903
1886
|
disable: function() {
|
|
1904
|
-
return this._enabled
|
|
1887
|
+
return this._enabled && (this._enabled = !1, this.removeHooks()), this;
|
|
1905
1888
|
},
|
|
1906
1889
|
enabled: function() {
|
|
1907
1890
|
return !!this._enabled;
|
|
@@ -1923,11 +1906,8 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
1923
1906
|
},
|
|
1924
1907
|
_onDown: function(e) {
|
|
1925
1908
|
if (this._enabled && (this._moved = !1, !jt(this._element, "leaflet-zoom-anim"))) {
|
|
1926
|
-
if (e.touches && e.touches.length !== 1)
|
|
1927
|
-
|
|
1928
|
-
return;
|
|
1929
|
-
}
|
|
1930
|
-
if (!(wn._dragging || e.shiftKey || e.which !== 1 && e.button !== 1 && !e.touches) && (wn._dragging = this, this._preventOutline && Kt(this._element), Ht(), Rt(), !this._moving)) {
|
|
1909
|
+
if (e.touches && e.touches.length !== 1) wn._dragging === this && this.finishDrag();
|
|
1910
|
+
else if (!(wn._dragging || e.shiftKey || e.which !== 1 && e.button !== 1 && !e.touches) && (wn._dragging = this, this._preventOutline && Kt(this._element), Ht(), Rt(), !this._moving)) {
|
|
1931
1911
|
this.fire("down");
|
|
1932
1912
|
var t = e.touches ? e.touches[0] : e, n = Jt(this._element);
|
|
1933
1913
|
this._startPoint = new x(t.clientX, t.clientY), this._startPos = Lt(this._element), this._parentScale = Yt(n);
|
|
@@ -1938,12 +1918,11 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
1938
1918
|
},
|
|
1939
1919
|
_onMove: function(e) {
|
|
1940
1920
|
if (this._enabled) {
|
|
1941
|
-
if (e.touches && e.touches.length > 1)
|
|
1942
|
-
|
|
1943
|
-
|
|
1921
|
+
if (e.touches && e.touches.length > 1) this._moved = !0;
|
|
1922
|
+
else {
|
|
1923
|
+
var t = e.touches && e.touches.length === 1 ? e.touches[0] : e, n = new x(t.clientX, t.clientY)._subtract(this._startPoint);
|
|
1924
|
+
(n.x || n.y) && (Math.abs(n.x) + Math.abs(n.y) < this.options.clickTolerance || (n.x /= this._parentScale.x, n.y /= this._parentScale.y, U(e), this._moved || (this.fire("dragstart"), this._moved = !0, F(document.body, "leaflet-dragging"), this._lastTarget = e.target || e.srcElement, window.SVGElementInstance && this._lastTarget instanceof window.SVGElementInstance && (this._lastTarget = this._lastTarget.correspondingUseElement), F(this._lastTarget, "leaflet-drag-target")), this._newPos = this._startPos.add(n), this._moving = !0, this._lastEvent = e, this._updatePosition()));
|
|
1944
1925
|
}
|
|
1945
|
-
var t = e.touches && e.touches.length === 1 ? e.touches[0] : e, n = new x(t.clientX, t.clientY)._subtract(this._startPoint);
|
|
1946
|
-
(n.x || n.y) && (Math.abs(n.x) + Math.abs(n.y) < this.options.clickTolerance || (n.x /= this._parentScale.x, n.y /= this._parentScale.y, U(e), this._moved || (this.fire("dragstart"), this._moved = !0, F(document.body, "leaflet-dragging"), this._lastTarget = e.target || e.srcElement, window.SVGElementInstance && this._lastTarget instanceof window.SVGElementInstance && (this._lastTarget = this._lastTarget.correspondingUseElement), F(this._lastTarget, "leaflet-drag-target")), this._newPos = this._startPos.add(n), this._moving = !0, this._lastEvent = e, this._updatePosition()));
|
|
1947
1926
|
}
|
|
1948
1927
|
},
|
|
1949
1928
|
_updatePosition: function() {
|
|
@@ -2189,11 +2168,11 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
2189
2168
|
addLayer: function(e) {
|
|
2190
2169
|
if (!e._layerAdd) throw Error("The provided object is not a Layer.");
|
|
2191
2170
|
var t = o(e);
|
|
2192
|
-
return this._layers[t]
|
|
2171
|
+
return this._layers[t] || (this._layers[t] = e, e._mapToAdd = this, e.beforeAdd && e.beforeAdd(this), this.whenReady(e._layerAdd, e)), this;
|
|
2193
2172
|
},
|
|
2194
2173
|
removeLayer: function(e) {
|
|
2195
2174
|
var t = o(e);
|
|
2196
|
-
return this._layers[t]
|
|
2175
|
+
return this._layers[t] && (this._loaded && e.onRemove(this), delete this._layers[t], this._loaded && (this.fire("layerremove", { layer: e }), e.fire("remove")), e._map = e._mapToAdd = null), this;
|
|
2197
2176
|
},
|
|
2198
2177
|
hasLayer: function(e) {
|
|
2199
2178
|
return o(e) in this._layers;
|
|
@@ -2732,11 +2711,8 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
2732
2711
|
_clipPoints: function() {
|
|
2733
2712
|
var e = this._renderer._bounds;
|
|
2734
2713
|
if (this._parts = [], this._pxBounds && this._pxBounds.intersects(e)) {
|
|
2735
|
-
if (this.options.noClip)
|
|
2736
|
-
|
|
2737
|
-
return;
|
|
2738
|
-
}
|
|
2739
|
-
for (var t = this._parts, n = 0, r, i = 0, a = this._rings.length, o, s, c; n < a; n++) for (c = this._rings[n], r = 0, o = c.length; r < o - 1; r++) s = In(c[r], c[r + 1], e, r, !0), s && (t[i] = t[i] || [], t[i].push(s[0]), (s[1] !== c[r + 1] || r === o - 2) && (t[i].push(s[1]), i++));
|
|
2714
|
+
if (this.options.noClip) this._parts = this._rings;
|
|
2715
|
+
else for (var t = this._parts, n = 0, r, i = 0, a = this._rings.length, o, s, c; n < a; n++) for (c = this._rings[n], r = 0, o = c.length; r < o - 1; r++) s = In(c[r], c[r + 1], e, r, !0), s && (t[i] = t[i] || [], t[i].push(s[0]), (s[1] !== c[r + 1] || r === o - 2) && (t[i].push(s[1]), i++));
|
|
2740
2716
|
}
|
|
2741
2717
|
},
|
|
2742
2718
|
_simplifyPoints: function() {
|
|
@@ -2781,11 +2757,8 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
2781
2757
|
_clipPoints: function() {
|
|
2782
2758
|
var e = this._renderer._bounds, t = this.options.weight, n = new x(t, t);
|
|
2783
2759
|
if (e = new C(e.min.subtract(n), e.max.add(n)), this._parts = [], this._pxBounds && this._pxBounds.intersects(e)) {
|
|
2784
|
-
if (this.options.noClip)
|
|
2785
|
-
|
|
2786
|
-
return;
|
|
2787
|
-
}
|
|
2788
|
-
for (var r = 0, i = this._rings.length, a; r < i; r++) a = Tn(this._rings[r], e, !0), a.length && this._parts.push(a);
|
|
2760
|
+
if (this.options.noClip) this._parts = this._rings;
|
|
2761
|
+
else for (var r = 0, i = this._rings.length, a; r < i; r++) a = Tn(this._rings[r], e, !0), a.length && this._parts.push(a);
|
|
2789
2762
|
}
|
|
2790
2763
|
},
|
|
2791
2764
|
_updatePath: function() {
|
|
@@ -2998,11 +2971,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
2998
2971
|
},
|
|
2999
2972
|
_initImage: function() {
|
|
3000
2973
|
var e = this._url.tagName === "IMG", t = this._image = e ? this._url : N("img");
|
|
3001
|
-
|
|
3002
|
-
this._url = t.src;
|
|
3003
|
-
return;
|
|
3004
|
-
}
|
|
3005
|
-
t.src = this._url, t.alt = this.options.alt;
|
|
2974
|
+
F(t, "leaflet-image-layer"), this._zoomAnimated && F(t, "leaflet-zoom-animated"), this.options.className && F(t, this.options.className), t.onselectstart = l, t.onmousemove = l, t.onload = i(this.fire, this, "load"), t.onerror = i(this._overlayOnError, this, "error"), (this.options.crossOrigin || this.options.crossOrigin === "") && (t.crossOrigin = this.options.crossOrigin === !0 ? "" : this.options.crossOrigin), this.options.zIndex && this._updateZIndex(), e ? this._url = t.src : (t.src = this._url, t.alt = this.options.alt);
|
|
3006
2975
|
},
|
|
3007
2976
|
_animateZoom: function(e) {
|
|
3008
2977
|
var t = this._map.getZoomScale(e.zoom), n = this._map._latLngBoundsToNewLayerBounds(this._bounds, e.zoom, e.center).min;
|
|
@@ -3041,12 +3010,12 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
3041
3010
|
if (F(t, "leaflet-image-layer"), this._zoomAnimated && F(t, "leaflet-zoom-animated"), this.options.className && F(t, this.options.className), t.onselectstart = l, t.onmousemove = l, t.onloadeddata = i(this.fire, this, "load"), e) {
|
|
3042
3011
|
for (var n = t.getElementsByTagName("source"), r = [], a = 0; a < n.length; a++) r.push(n[a].src);
|
|
3043
3012
|
this._url = n.length > 0 ? r : [t.src];
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3013
|
+
} else {
|
|
3014
|
+
g(this._url) || (this._url = [this._url]), !this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(t.style, "objectFit") && (t.style.objectFit = "fill"), t.autoplay = !!this.options.autoplay, t.loop = !!this.options.loop, t.muted = !!this.options.muted, t.playsInline = !!this.options.playsInline;
|
|
3015
|
+
for (var o = 0; o < this._url.length; o++) {
|
|
3016
|
+
var s = N("source");
|
|
3017
|
+
s.src = this._url[o], t.appendChild(s);
|
|
3018
|
+
}
|
|
3050
3019
|
}
|
|
3051
3020
|
}
|
|
3052
3021
|
});
|
|
@@ -3224,14 +3193,13 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
3224
3193
|
},
|
|
3225
3194
|
_adjustPan: function() {
|
|
3226
3195
|
if (this.options.autoPan) {
|
|
3227
|
-
if (this._map._panAnim && this._map._panAnim.stop(), this._autopanning)
|
|
3228
|
-
|
|
3229
|
-
|
|
3196
|
+
if (this._map._panAnim && this._map._panAnim.stop(), this._autopanning) this._autopanning = !1;
|
|
3197
|
+
else {
|
|
3198
|
+
var e = this._map, t = parseInt(Dt(this._container, "marginBottom"), 10) || 0, n = this._container.offsetHeight + t, r = this._containerWidth, i = new x(this._containerLeft, -n - this._containerBottom);
|
|
3199
|
+
i._add(Lt(this._container));
|
|
3200
|
+
var a = e.layerPointToContainerPoint(i), o = S(this.options.autoPanPadding), s = S(this.options.autoPanPaddingTopLeft || o), c = S(this.options.autoPanPaddingBottomRight || o), l = e.getSize(), u = 0, d = 0;
|
|
3201
|
+
a.x + r + c.x > l.x && (u = a.x + r - l.x + c.x), a.x - u - s.x < 0 && (u = a.x - s.x), a.y + n + c.y > l.y && (d = a.y + n - l.y + c.y), a.y - d - s.y < 0 && (d = a.y - s.y), (u || d) && (this.options.keepInView && (this._autopanning = !0), e.fire("autopanstart").panBy([u, d]));
|
|
3230
3202
|
}
|
|
3231
|
-
var e = this._map, t = parseInt(Dt(this._container, "marginBottom"), 10) || 0, n = this._container.offsetHeight + t, r = this._containerWidth, i = new x(this._containerLeft, -n - this._containerBottom);
|
|
3232
|
-
i._add(Lt(this._container));
|
|
3233
|
-
var a = e.layerPointToContainerPoint(i), o = S(this.options.autoPanPadding), s = S(this.options.autoPanPaddingTopLeft || o), c = S(this.options.autoPanPaddingBottomRight || o), l = e.getSize(), u = 0, d = 0;
|
|
3234
|
-
a.x + r + c.x > l.x && (u = a.x + r - l.x + c.x), a.x - u - s.x < 0 && (u = a.x - s.x), a.y + n + c.y > l.y && (d = a.y + n - l.y + c.y), a.y - d - s.y < 0 && (d = a.y - s.y), (u || d) && (this.options.keepInView && (this._autopanning = !0), e.fire("autopanstart").panBy([u, d]));
|
|
3235
3203
|
}
|
|
3236
3204
|
},
|
|
3237
3205
|
_getAnchor: function() {
|
|
@@ -3286,11 +3254,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
3286
3254
|
if (this._popup && this._map) {
|
|
3287
3255
|
an(e);
|
|
3288
3256
|
var t = e.layer || e.target;
|
|
3289
|
-
|
|
3290
|
-
this._map.hasLayer(this._popup) ? this.closePopup() : this.openPopup(e.latlng);
|
|
3291
|
-
return;
|
|
3292
|
-
}
|
|
3293
|
-
this._popup._source = t, this.openPopup(e.latlng);
|
|
3257
|
+
this._popup._source === t && !(t instanceof ar) ? this._map.hasLayer(this._popup) ? this.closePopup() : this.openPopup(e.latlng) : (this._popup._source = t, this.openPopup(e.latlng));
|
|
3294
3258
|
}
|
|
3295
3259
|
},
|
|
3296
3260
|
_movePopup: function(e) {
|
|
@@ -3408,9 +3372,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
3408
3372
|
this._map.once("moveend", function() {
|
|
3409
3373
|
t._openOnceFlag = !1, t._openTooltip(e);
|
|
3410
3374
|
});
|
|
3411
|
-
|
|
3412
|
-
}
|
|
3413
|
-
this._tooltip._source = e.layer || e.target, this.openTooltip(this._tooltip.options.sticky ? e.latlng : void 0);
|
|
3375
|
+
} else this._tooltip._source = e.layer || e.target, this.openTooltip(this._tooltip.options.sticky ? e.latlng : void 0);
|
|
3414
3376
|
}
|
|
3415
3377
|
},
|
|
3416
3378
|
_moveTooltip: function(e) {
|
|
@@ -3552,16 +3514,15 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
3552
3514
|
_pruneTiles: function() {
|
|
3553
3515
|
if (this._map) {
|
|
3554
3516
|
var e, t, n = this._map.getZoom();
|
|
3555
|
-
if (n > this.options.maxZoom || n < this.options.minZoom)
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3517
|
+
if (n > this.options.maxZoom || n < this.options.minZoom) this._removeAllTiles();
|
|
3518
|
+
else {
|
|
3519
|
+
for (e in this._tiles) t = this._tiles[e], t.retain = t.current;
|
|
3520
|
+
for (e in this._tiles) if (t = this._tiles[e], t.current && !t.active) {
|
|
3521
|
+
var r = t.coords;
|
|
3522
|
+
this._retainParent(r.x, r.y, r.z, r.z - 5) || this._retainChildren(r.x, r.y, r.z, r.z + 2);
|
|
3523
|
+
}
|
|
3524
|
+
for (e in this._tiles) this._tiles[e].retain || this._removeTile(e);
|
|
3563
3525
|
}
|
|
3564
|
-
for (e in this._tiles) this._tiles[e].retain || this._removeTile(e);
|
|
3565
3526
|
}
|
|
3566
3527
|
},
|
|
3567
3528
|
_removeTilesAtZoom: function(e) {
|
|
@@ -3585,11 +3546,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
3585
3546
|
var o = new x(i, a);
|
|
3586
3547
|
o.z = n + 1;
|
|
3587
3548
|
var s = this._tileCoordsToKey(o), c = this._tiles[s];
|
|
3588
|
-
|
|
3589
|
-
c.retain = !0;
|
|
3590
|
-
continue;
|
|
3591
|
-
}
|
|
3592
|
-
c && c.loaded && (c.retain = !0), n + 1 < r && this._retainChildren(i, a, n + 1, r);
|
|
3549
|
+
c && c.active ? c.retain = !0 : (c && c.loaded && (c.retain = !0), n + 1 < r && this._retainChildren(i, a, n + 1, r));
|
|
3593
3550
|
}
|
|
3594
3551
|
},
|
|
3595
3552
|
_resetView: function(e) {
|
|
@@ -3638,24 +3595,23 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
3638
3595
|
var u = this._tiles[l].coords;
|
|
3639
3596
|
(u.z !== this._tileZoom || !c.contains(new x(u.x, u.y))) && (this._tiles[l].current = !1);
|
|
3640
3597
|
}
|
|
3641
|
-
if (Math.abs(n - this._tileZoom) > 1)
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3598
|
+
if (Math.abs(n - this._tileZoom) > 1) this._setView(e, n);
|
|
3599
|
+
else {
|
|
3600
|
+
for (var d = i.min.y; d <= i.max.y; d++) for (var f = i.min.x; f <= i.max.x; f++) {
|
|
3601
|
+
var p = new x(f, d);
|
|
3602
|
+
if (p.z = this._tileZoom, this._isValidTile(p)) {
|
|
3603
|
+
var m = this._tiles[this._tileCoordsToKey(p)];
|
|
3604
|
+
m ? m.current = !0 : o.push(p);
|
|
3605
|
+
}
|
|
3606
|
+
}
|
|
3607
|
+
if (o.sort(function(e, t) {
|
|
3608
|
+
return e.distanceTo(a) - t.distanceTo(a);
|
|
3609
|
+
}), o.length !== 0) {
|
|
3610
|
+
this._loading || (this._loading = !0, this.fire("loading"));
|
|
3611
|
+
var ee = document.createDocumentFragment();
|
|
3612
|
+
for (f = 0; f < o.length; f++) this._addTile(o[f], ee);
|
|
3613
|
+
this._level.el.appendChild(ee);
|
|
3650
3614
|
}
|
|
3651
|
-
}
|
|
3652
|
-
if (o.sort(function(e, t) {
|
|
3653
|
-
return e.distanceTo(a) - t.distanceTo(a);
|
|
3654
|
-
}), o.length !== 0) {
|
|
3655
|
-
this._loading || (this._loading = !0, this.fire("loading"));
|
|
3656
|
-
var ee = document.createDocumentFragment();
|
|
3657
|
-
for (f = 0; f < o.length; f++) this._addTile(o[f], ee);
|
|
3658
|
-
this._level.el.appendChild(ee);
|
|
3659
3615
|
}
|
|
3660
3616
|
}
|
|
3661
3617
|
}
|
|
@@ -4563,11 +4519,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
4563
4519
|
}
|
|
4564
4520
|
},
|
|
4565
4521
|
_onTouchEnd: function() {
|
|
4566
|
-
|
|
4567
|
-
this._zooming = !1;
|
|
4568
|
-
return;
|
|
4569
|
-
}
|
|
4570
|
-
this._zooming = !1, v(this._animRequest), H(document, "touchmove", this._onTouchMove, this), H(document, "touchend touchcancel", this._onTouchEnd, this), this._map.options.zoomAnimation ? this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), !0, this._map.options.zoomSnap) : this._map._resetView(this._center, this._map._limitZoom(this._zoom));
|
|
4522
|
+
!this._moved || !this._zooming ? this._zooming = !1 : (this._zooming = !1, v(this._animRequest), H(document, "touchmove", this._onTouchMove, this), H(document, "touchend touchcancel", this._onTouchEnd, this), this._map.options.zoomAnimation ? this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), !0, this._map.options.zoomSnap) : this._map._resetView(this._center, this._map._limitZoom(this._zoom)));
|
|
4571
4523
|
}
|
|
4572
4524
|
});
|
|
4573
4525
|
W.addInitHook("addHandler", "touchZoom", ii), W.BoxZoom = Zr, W.DoubleClickZoom = Qr, W.Drag = $r, W.Keyboard = ei, W.ScrollWheelZoom = ti, W.TapHold = ri, W.TouchZoom = ii, e.Bounds = C, e.Browser = M, e.CRS = k, e.Canvas = Hr, e.Circle = cr, e.CircleMarker = or, e.Class = y, e.Control = G, e.DivIcon = Pr, e.DivOverlay = Q, e.DomEvent = dn, e.DomUtil = Xt, e.Draggable = wn, e.Evented = ue, e.FeatureGroup = Y, e.GeoJSON = Z, e.GridLayer = Ir, e.Handler = K, e.Icon = $n, e.ImageOverlay = wr, e.LatLng = D, e.LatLngBounds = T, e.Layer = J, e.LayerGroup = Xn, e.LineUtil = Un, e.Map = W, e.Marker = rr, e.Mixin = Sn, e.Path = ar, e.Point = x, e.PolyUtil = On, e.Polygon = dr, e.Polyline = X, e.Popup = Ar, e.PosAnimation = fn, e.Projection = Kn, e.Rectangle = Yr, e.Renderer = $, e.SVG = qr, e.SVGOverlay = Or, e.TileLayer = Rr, e.Tooltip = Mr, e.Transformation = me, e.Util = ce, e.VideoOverlay = Er, e.bind = i, e.bounds = w, e.canvas = Ur, e.circle = lr, e.circleMarker = sr, e.control = mn, e.divIcon = Fr, e.extend = n, e.featureGroup = Qn, e.geoJSON = Sr, e.geoJson = Cr, e.gridLayer = Lr, e.icon = er, e.imageOverlay = Tr, e.latLng = O, e.latLngBounds = E, e.layerGroup = Zn, e.map = pn, e.marker = ir, e.point = S, e.polygon = fr, e.polyline = ur, e.popup = jr, e.rectangle = Xr, e.setOptions = p, e.stamp = o, e.svg = Jr, e.svgOverlay = kr, e.tileLayer = zr, e.tooltip = Nr, e.transformation = he, e.version = t, e.videoOverlay = Dr;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as e } from "./constants-DVcJAvc5.js";
|
|
2
|
-
import { t } from "./api-
|
|
3
|
-
import { r as n } from "./scripts-
|
|
2
|
+
import { t } from "./api-CmuOZ0i3.js";
|
|
3
|
+
import { r as n } from "./scripts-DrccjrFv.js";
|
|
4
4
|
//#region src/js/modules/address/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-
|
|
2
|
+
import { t } from "./api-BR2Gqy37.js";
|
|
3
3
|
//#region src/js/modules/payments/mollie.ts
|
|
4
4
|
var n = e("mollie", "redirect"), r = t({
|
|
5
5
|
moduleId: "formie:mollie",
|
|
@@ -8,11 +8,7 @@ var n = e("mollie", "redirect"), r = t({
|
|
|
8
8
|
setup: async ({ services: e, root: t }) => {
|
|
9
9
|
let r = (t) => {
|
|
10
10
|
let n = t.detail?.data;
|
|
11
|
-
|
|
12
|
-
e.addError("Missing Mollie checkout URL.");
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
window.location.href = n.checkoutUrl;
|
|
11
|
+
n?.checkoutUrl ? window.location.href = n.checkoutUrl : e.addError("Missing Mollie checkout URL.");
|
|
16
12
|
};
|
|
17
13
|
return t.addEventListener(n, r), { destroy: () => {
|
|
18
14
|
t.removeEventListener(n, r);
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { t as e } from "./request-profile-DhwkeCpS.js";
|
|
2
|
+
import { t } from "./dist-CJReDlDK.js";
|
|
3
|
+
import { s as n } from "./event-names-BCI2FLD8.js";
|
|
4
|
+
import { n as r, t as i } from "./api-BR2Gqy37.js";
|
|
5
|
+
import { t as a } from "./debug-rhzqP1j2.js";
|
|
6
|
+
import { a as o } from "./theme-classes-DAQuEqdP.js";
|
|
7
|
+
import { t as s } from "./csrf-DxHg_ZYt.js";
|
|
8
|
+
import { r as c } from "./scripts-DrccjrFv.js";
|
|
9
|
+
import { t as l } from "./styles-BfoIZwJp.js";
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/js/modules/payments/opayo.ts
|
|
12
|
+
l("opayo", ["@layer formie-theme{.formie-opayo-drop-in{box-sizing:border-box;width:100%;min-height:10rem}}"]);
|
|
13
|
+
var u = "FORMIE_OPAYO_SCRIPT", d = "https://live.opayo.eu.elavon.com/api/v1/js/sagepay.js", f = "https://sandbox.opayo.eu.elavon.com/api/v1/js/sagepay.js", p = "[data-formie-opayo-drop-in]", m = a("payments", "opayo"), h = n("opayo", "challenge"), g = "formie:payment:opayo:challenge:response";
|
|
14
|
+
function _(e) {
|
|
15
|
+
return e.checkoutMode === "dropIn";
|
|
16
|
+
}
|
|
17
|
+
async function v(n) {
|
|
18
|
+
let { form: r, handle: i, sessionToken: a, services: o } = n, c = new FormData();
|
|
19
|
+
s(c, r), c.set("action", "formie/payment-sessions/initialize"), c.append("handle", i), c.append("sessionToken", a);
|
|
20
|
+
try {
|
|
21
|
+
let i = await t(n.sessionEndpoint || r.action, {
|
|
22
|
+
method: "POST",
|
|
23
|
+
body: c
|
|
24
|
+
}, e(r));
|
|
25
|
+
return i.status < 200 || i.status >= 300 ? (o.addError(`${i.status}: ${i.statusText}`), m.warn("Merchant session request failed.", {
|
|
26
|
+
status: i.status,
|
|
27
|
+
statusText: i.statusText
|
|
28
|
+
}), null) : (await i.json()).merchantSessionKey || (o.addError("Unable to get merchant session."), m.warn("merchantSessionKey missing in session response."), null);
|
|
29
|
+
} catch {
|
|
30
|
+
return o.addError("Network error. Please try again."), m.warn("Network error requesting merchant session."), null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function y(e) {
|
|
34
|
+
return e.id ||= `formie-opayo-drop-in-${Math.random().toString(36).slice(2, 9)}`, e.id;
|
|
35
|
+
}
|
|
36
|
+
var b = i({
|
|
37
|
+
moduleId: "formie:opayo",
|
|
38
|
+
defaultRequiredInputSuffixes: ["opayoTokenId"],
|
|
39
|
+
load: async (e) => {
|
|
40
|
+
let { provider: t } = e.options, n = t.useSandbox ? f : d, r = _(t) ? "sagepayCheckout" : "sagepayOwnForm";
|
|
41
|
+
return await c(r, {
|
|
42
|
+
id: u,
|
|
43
|
+
src: n,
|
|
44
|
+
timeoutMs: 1e4
|
|
45
|
+
}), null;
|
|
46
|
+
},
|
|
47
|
+
mount: async ({ field: e, services: t, provider: n }) => {
|
|
48
|
+
if (!_(n)) return null;
|
|
49
|
+
let r = t.form, i = window.sagepayCheckout, a = e.querySelector(p);
|
|
50
|
+
if (!r?.action) return t.addError("Form action is missing."), m.warn("Missing form action before drop-in mount."), null;
|
|
51
|
+
if (!i) return t.addError("Opayo script failed to load."), m.warn("sagepayCheckout global not available."), null;
|
|
52
|
+
if (!a) return t.addError("Opayo drop-in container is missing."), m.warn("Drop-in container not found in payment field."), null;
|
|
53
|
+
let o = n.handle || "opayo", s = await v({
|
|
54
|
+
form: r,
|
|
55
|
+
handle: o,
|
|
56
|
+
sessionToken: n.sessionToken || "",
|
|
57
|
+
sessionEndpoint: n.sessionEndpoint,
|
|
58
|
+
services: t
|
|
59
|
+
});
|
|
60
|
+
if (!s) return null;
|
|
61
|
+
let c = y(a), l = {
|
|
62
|
+
checkout: null,
|
|
63
|
+
merchantSessionKey: s,
|
|
64
|
+
pendingAuthorize: null,
|
|
65
|
+
retriedTokenise: !1
|
|
66
|
+
};
|
|
67
|
+
return l.checkout = i({
|
|
68
|
+
merchantSessionKey: s,
|
|
69
|
+
containerSelector: `#${c}`,
|
|
70
|
+
onTokenise: (e) => {
|
|
71
|
+
let i = l.pendingAuthorize;
|
|
72
|
+
l.pendingAuthorize = null, i ? e.success && e.cardIdentifier ? (t.updateInputs("opayoTokenId", e.cardIdentifier), t.updateInputs("opayoSessionKey", l.merchantSessionKey), m.log("Drop-in tokenization succeeded.", { hasCardIdentifier: !!e.cardIdentifier }), i(!0)) : l.retriedTokenise ? (t.addError(e.errors?.[0]?.message || "Tokenization failed."), m.warn("Drop-in tokenization failed.", e), i(!1)) : (l.retriedTokenise = !0, v({
|
|
73
|
+
form: r,
|
|
74
|
+
handle: o,
|
|
75
|
+
sessionToken: n.sessionToken || "",
|
|
76
|
+
sessionEndpoint: n.sessionEndpoint,
|
|
77
|
+
services: t
|
|
78
|
+
}).then((n) => {
|
|
79
|
+
n ? (l.merchantSessionKey = n, l.pendingAuthorize = i, l.checkout.tokenise({ newMerchantSessionKey: n })) : (t.addError(e.errors?.[0]?.message || "Tokenization failed."), m.warn("Drop-in tokenization failed after session refresh.", e), i(!1));
|
|
80
|
+
})) : m.warn("Drop-in tokenisation completed without a pending authorize step.");
|
|
81
|
+
}
|
|
82
|
+
}), m.log("Drop-in checkout mounted.", { containerId: c }), l;
|
|
83
|
+
},
|
|
84
|
+
unmount: async ({ widget: e }) => {
|
|
85
|
+
e?.checkout?.destroy?.();
|
|
86
|
+
},
|
|
87
|
+
onBeforePayment: async (e) => {
|
|
88
|
+
let { field: t, services: n, options: i, provider: a, widget: o } = e, s = a.handle || "opayo", c = n.form;
|
|
89
|
+
if (!c?.action) return n.addError("Form action is missing."), m.warn("Missing form action before authorize."), !1;
|
|
90
|
+
if (r(t, "opayo3DSComplete")?.value.trim()) return !0;
|
|
91
|
+
if (_(a)) return o ? (o.retriedTokenise = !1, new Promise((e) => {
|
|
92
|
+
o.pendingAuthorize = e, o.checkout.tokenise();
|
|
93
|
+
})) : (n.addError("Opayo drop-in checkout is not ready."), m.warn("Drop-in authorize requested before widget mount."), !1);
|
|
94
|
+
let l = window.sagepayOwnForm;
|
|
95
|
+
if (!l) return n.addError("Opayo script failed to load."), m.warn("sagepayOwnForm global not available."), !1;
|
|
96
|
+
let u = t.querySelector("[data-opayo-card=\"cardholder-name\"]")?.value ?? "", d = t.querySelector("[data-opayo-card=\"card-number\"]")?.value ?? "", f = t.querySelector("[data-opayo-card=\"expiry-date\"]")?.value ?? "", p = t.querySelector("[data-opayo-card=\"security-code\"]")?.value ?? "";
|
|
97
|
+
d = d.replace(/[\s/]/g, ""), f = f.replace(/[\s/]/g, "");
|
|
98
|
+
let h = await v({
|
|
99
|
+
form: c,
|
|
100
|
+
handle: s,
|
|
101
|
+
sessionToken: a.sessionToken || "",
|
|
102
|
+
sessionEndpoint: a.sessionEndpoint,
|
|
103
|
+
services: n
|
|
104
|
+
});
|
|
105
|
+
return h ? new Promise((e) => {
|
|
106
|
+
l({ merchantSessionKey: h }).tokeniseCardDetails({
|
|
107
|
+
cardDetails: {
|
|
108
|
+
cardholderName: u,
|
|
109
|
+
cardNumber: d,
|
|
110
|
+
expiryDate: f,
|
|
111
|
+
securityCode: p
|
|
112
|
+
},
|
|
113
|
+
onTokenised: (t) => {
|
|
114
|
+
t.success && t.cardIdentifier ? (n.updateInputs("opayoTokenId", t.cardIdentifier), n.updateInputs("opayoSessionKey", h), m.log("Tokenization succeeded.", { hasCardIdentifier: !!t.cardIdentifier }), e(!0)) : (n.addError(t.errors?.[0]?.message || "Tokenization failed."), m.warn("Tokenization failed.", t), e(!1));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}) : !1;
|
|
118
|
+
},
|
|
119
|
+
setup: async (e) => {
|
|
120
|
+
let { services: t } = e;
|
|
121
|
+
e.target;
|
|
122
|
+
let n = null, r = !1, i = () => {
|
|
123
|
+
n?.parentNode && n.parentNode.removeChild(n), n = null;
|
|
124
|
+
}, a = t.events.onForm(h, ((e) => {
|
|
125
|
+
let a = e.detail?.data;
|
|
126
|
+
if (!a?.acsUrl || !a?.creq) return;
|
|
127
|
+
r = !1, m.log("Received payment challenge event.", {
|
|
128
|
+
hasAcsUrl: !!a.acsUrl,
|
|
129
|
+
hasCreq: !!a.creq
|
|
130
|
+
});
|
|
131
|
+
let s = t.form, c = s?.querySelector("input[name*=\"opayoSessionKey\"]")?.value || "", l = document.createElement("div");
|
|
132
|
+
l.className = "formie-modal", l.id = `formie-opayo-dialog-${Math.random().toString(36).slice(2, 9)}`, l.innerHTML = "\n <div class=\"formie-modal-backdrop\" data-dialog-close></div>\n <div class=\"formie-modal-content\">\n <div data-formie-opayo-loading style=\"--formie-loading-width: 3rem; --formie-loading-height: 3rem; top: 50%; margin-top: -1.5rem;\"></div>\n <iframe width=\"100%\" height=\"100%\" style=\"width: 100%; height: 100%; position: relative; z-index: 1;\"></iframe>\n </div>\n ";
|
|
133
|
+
let u = l.querySelector("[data-formie-opayo-loading]");
|
|
134
|
+
u && o(u, s, "loading", !0);
|
|
135
|
+
let d = l.querySelector("iframe"), f = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), p = a.returnUrl || a.redirectUrl || "", h = `<form action="${f(a.acsUrl)}" method="post">
|
|
136
|
+
<input type="hidden" name="creq" value="${f(a.creq || "")}" />
|
|
137
|
+
<input type="hidden" name="threeDSSessionData" value="${f(a.threeDSSessionData || "")}" />
|
|
138
|
+
<input type="hidden" name="MD" value="${f(c)}" />
|
|
139
|
+
<input type="hidden" name="TermUrl" value="${f(p)}" />
|
|
140
|
+
<input type="hidden" name="ThreeDSNotificationURL" value="${f(p)}" />
|
|
141
|
+
</form><script>document.forms[0].submit();<\/script>`;
|
|
142
|
+
i(), document.body.appendChild(l), n = l, d?.contentWindow && (d.contentWindow.document.open(), d.contentWindow.document.write(h), d.contentWindow.document.close());
|
|
143
|
+
})), s = (e) => {
|
|
144
|
+
e.data?.message === g && (n ? r ? m.warn("Ignoring duplicate 3DS response while processing.") : (r = !0, m.log("Received payment challenge response message.", e.data?.value), i(), t.removeError(), e.data?.value?.error ? (t.addError(e.data.value.error.message), t.releaseSubmitLoading(), r = !1) : (t.updateInputs("opayo3DSComplete", e.data.value?.transactionId ?? ""), t.triggerSubmit())) : m.log("Ignoring 3DS response without active dialog."));
|
|
145
|
+
};
|
|
146
|
+
return window.addEventListener("message", s), { destroy: () => {
|
|
147
|
+
a(), window.removeEventListener("message", s), i(), r = !1;
|
|
148
|
+
} };
|
|
149
|
+
},
|
|
150
|
+
onAfterSubmit: async ({ services: e }) => {
|
|
151
|
+
e.updateInputs([
|
|
152
|
+
"opayoTokenId",
|
|
153
|
+
"opayoSessionKey",
|
|
154
|
+
"opayo3DSComplete"
|
|
155
|
+
], "");
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
//#endregion
|
|
159
|
+
export { b as opayoModule };
|
|
@@ -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-BR2Gqy37.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 { p as e } from "./dist-
|
|
2
|
-
import { a as t, l as n, u as r } from "./shared-
|
|
1
|
+
import { p as e } from "./dist-CJReDlDK.js";
|
|
2
|
+
import { a as t, l as n, u as r } from "./shared-CJ1LIEh3.js";
|
|
3
3
|
//#region src/js/modules/fields/password-validation.ts
|
|
4
4
|
var i = "input[data-formie-password-input]", a = [
|
|
5
5
|
"passwordMinLength",
|
|
@@ -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
|
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-BR2Gqy37.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
|
|
@@ -24,11 +24,7 @@ var r = "FORMIE_PAYWAY_SCRIPT", i = e({
|
|
|
24
24
|
publishableApiKey: i.publishableKey || "",
|
|
25
25
|
tokenMode: "callback"
|
|
26
26
|
}, (t, r) => {
|
|
27
|
-
|
|
28
|
-
n.addError(t?.message || "PayWay frame failed to load."), e(null);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
e(r);
|
|
27
|
+
t || !r ? (n.addError(t?.message || "PayWay frame failed to load."), e(null)) : e(r);
|
|
32
28
|
});
|
|
33
29
|
}) : null;
|
|
34
30
|
},
|
|
@@ -39,11 +35,7 @@ var r = "FORMIE_PAYWAY_SCRIPT", i = e({
|
|
|
39
35
|
let { widget: t, services: n } = e;
|
|
40
36
|
return t ? new Promise((e) => {
|
|
41
37
|
t.getToken((t, r) => {
|
|
42
|
-
|
|
43
|
-
n.addError(t.message), e(!1);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
r?.singleUseTokenId ? (n.updateInputs("paywayTokenId", r.singleUseTokenId), e(!0)) : (n.addError("Tokenization failed."), e(!1));
|
|
38
|
+
t ? (n.addError(t.message), e(!1)) : r?.singleUseTokenId ? (n.updateInputs("paywayTokenId", r.singleUseTokenId), e(!0)) : (n.addError("Tokenization failed."), e(!1));
|
|
47
39
|
});
|
|
48
40
|
}) : (n.addError("PayWay card frame is not ready."), !1);
|
|
49
41
|
},
|