@verbb/formie-browser 1.0.15 → 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.
Files changed (135) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/chunks/{address-country-BcEQKw0T.js → address-country-DLJF-OkC.js} +4 -8
  3. package/dist/chunks/{address-finder-BWGINCSA.js → address-finder-QK1m1eyv.js} +1 -1
  4. package/dist/chunks/{address-state-DI3ndhMU.js → address-state-CHKit8AW.js} +26 -35
  5. package/dist/chunks/{api-BK9b340y.js → api-BPtH5RBA.js} +152 -120
  6. package/dist/chunks/{api-Dxl_CKw-.js → api-BR2Gqy37.js} +306 -301
  7. package/dist/chunks/{api-ghNr2uxX.js → api-CmuOZ0i3.js} +1 -1
  8. package/dist/chunks/{bpoint-BwtuyN_O.js → bpoint-GvYfyPjD.js} +1 -1
  9. package/dist/chunks/{calculations-YEoVCG2q.js → calculations-DeEmdUDq.js} +5 -7
  10. package/dist/chunks/{captcha-eu-DWLoQFKB.js → captcha-eu-eU_M6snp.js} +1 -1
  11. package/dist/chunks/{checkbox-radio-gsm8QPJg.js → checkbox-radio-CSXo6svm.js} +4 -12
  12. package/dist/chunks/{combobox-Ba08_cHL.js → combobox-CJh2DoSO.js} +292 -333
  13. package/dist/chunks/{conditions-Ceeg6ReZ.js → conditions-Dz3068K0.js} +56 -72
  14. package/dist/chunks/{country-from-ip-DDj_mFki.js → country-from-ip-BqQ-BqLH.js} +1 -1
  15. package/dist/chunks/{custom-google-maps-C4l2S3GO.js → custom-google-maps-rNm5VFbb.js} +2 -6
  16. package/dist/chunks/{custom-link-CLazgKYH.js → custom-link-CLqFCssQ.js} +1 -1
  17. package/dist/chunks/{custom-maps-DqcAlD0v.js → custom-maps-DgjYQDLj.js} +4 -8
  18. package/dist/chunks/{date-picker-DaPvMrop.js → date-picker-BVJxJVYT.js} +30 -47
  19. package/dist/chunks/{debug-BV0DvdHx.js → debug-rhzqP1j2.js} +2 -14
  20. package/dist/chunks/{dist-ZLeW0zZ3.js → dist-CJReDlDK.js} +13 -8
  21. package/dist/chunks/{eway-uw0DzU-L.js → eway-BZuTBAUW.js} +1 -1
  22. package/dist/chunks/{field-references.resolver-Ca8MguFv.js → field-references.resolver-uSHf5-NP.js} +1 -1
  23. package/dist/chunks/{file-upload-B8_mH012.js → file-upload-vEUr_EuP.js} +114 -108
  24. package/dist/chunks/{friendly-captcha-v1-CVXaXgDO.js → friendly-captcha-v1-C_cF1WD2.js} +2 -2
  25. package/dist/chunks/{friendly-captcha-v2-DkeIVTKI.js → friendly-captcha-v2-BenESH-n.js} +2 -2
  26. package/dist/chunks/{friendly-challenge-DPG9MJb1.js → friendly-challenge-BgPBEMXx.js} +21 -35
  27. package/dist/chunks/{go-cardless-c4wLJdOt.js → go-cardless-DWZeB0Bq.js} +2 -6
  28. package/dist/chunks/{google-address-JHYvjwgN.js → google-address-DQR6rsbh.js} +2 -2
  29. package/dist/chunks/{hcaptcha-Dt3ELLlP.js → hcaptcha-COilLmRT.js} +1 -1
  30. package/dist/chunks/{hidden-BZhXnNPe.js → hidden-Bc2TpcgF.js} +1 -1
  31. package/dist/chunks/{http-C2QdHuWO.js → http-Dj_skqaa.js} +1 -1
  32. package/dist/chunks/{leaflet-src-DE6rv6M-.js → leaflet-src-Cg-LUOD8.js} +74 -122
  33. package/dist/chunks/{loqate-m51iPyO1.js → loqate-ZZClcacr.js} +1 -1
  34. package/dist/chunks/{mollie-Bn0PX173.js → mollie-8OMXIYa8.js} +2 -6
  35. package/dist/chunks/{moneris-BRbUvI4t.js → moneris-qYHJ9EFy.js} +1 -1
  36. package/dist/chunks/opayo-DlWPEnla.js +159 -0
  37. package/dist/chunks/{paddle-CympHVvd.js → paddle-CArfWih0.js} +1 -1
  38. package/dist/chunks/{password-validation-C8_uO_c_.js → password-validation-HGOU9kf3.js} +2 -2
  39. package/dist/chunks/{paypal-h75h6wae.js → paypal-BcaMCMGY.js} +1 -1
  40. package/dist/chunks/{payway-C9rHTCC_.js → payway-vxC7_bfR.js} +3 -11
  41. package/dist/chunks/{phone-country-B8fv-L5_.js → phone-country-Bx9EG50h.js} +123 -140
  42. package/dist/chunks/{place-kit-BnZGQ-L1.js → place-kit-BKk8xDXf.js} +2 -2
  43. package/dist/chunks/{placekit-autocomplete.esm-CZZERYur.js → placekit-autocomplete.esm-D2A_0iVU.js} +2 -5
  44. package/dist/chunks/{recaptcha-enterprise-CUs8BO6V.js → recaptcha-enterprise-Cx6HUpMa.js} +6 -12
  45. package/dist/chunks/recaptcha-shared-CcMI-r8t.js +33 -0
  46. package/dist/chunks/{recaptcha-v2-checkbox-P1McW4Pv.js → recaptcha-v2-checkbox-DQ9BJzcv.js} +2 -2
  47. package/dist/chunks/{recaptcha-v2-invisible-FGDqozSP.js → recaptcha-v2-invisible-BP0T8Pan.js} +2 -2
  48. package/dist/chunks/recaptcha-v3-DKMGQ27K.js +38 -0
  49. package/dist/chunks/{repeater-CyhDbozO.js → repeater-BR0RUvTs.js} +3 -7
  50. package/dist/chunks/{rich-text-uV4o_pGk.js → rich-text-H2A6cm1t.js} +33 -11
  51. package/dist/chunks/{rolldown-runtime-DtPi1Y-2.js → rolldown-runtime-VHNaYcLd.js} +1 -1
  52. package/dist/chunks/{sdk-lkwSvlpM.js → sdk-_cmrRYgp.js} +4 -16
  53. package/dist/chunks/{shared-OKhSay59.js → shared-CJ1LIEh3.js} +1 -3
  54. package/dist/chunks/{signature-7cldFbqj.js → signature-CfKA_poI.js} +9 -41
  55. package/dist/chunks/{snaptcha-C3QLYxFT.js → snaptcha-P3EoSQud.js} +1 -1
  56. package/dist/chunks/{square-C1z5DPVw.js → square-Dyz0p_GU.js} +1 -1
  57. package/dist/chunks/{stripe-Dmkdkq1y.js → stripe-Bfd_jp_k.js} +3 -6
  58. package/dist/chunks/{summary-Bn-g5SDx.js → summary-B3CAebLV.js} +44 -36
  59. package/dist/chunks/{survey-likert-fk1hUPff.js → survey-likert-CEtUceag.js} +1 -1
  60. package/dist/chunks/{survey-rank-BsLGl2LX.js → survey-rank-Dtt97y6s.js} +3 -7
  61. package/dist/chunks/{survey-rating-DVS6e6fM.js → survey-rating-mlDMI0uq.js} +9 -23
  62. package/dist/chunks/{table-j7MlLLCc.js → table-0k6Md0IO.js} +1 -1
  63. package/dist/chunks/{text-limit-LGMPhFuC.js → text-limit-CTVML6s7.js} +10 -10
  64. package/dist/chunks/{turnstile-ptihQfLl.js → turnstile-Sp4ubowK.js} +1 -1
  65. package/dist/chunks/{upload-manager-BW7l-BhF.js → upload-manager-Ccg3d_4I.js} +11 -25
  66. package/dist/index.d.ts +1 -0
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +752 -756
  69. package/dist/js/core/create-formie-client.d.ts.map +1 -1
  70. package/dist/js/core/dom-events.d.ts +5 -0
  71. package/dist/js/core/dom-events.d.ts.map +1 -1
  72. package/dist/js/core/page-client-event.d.ts.map +1 -1
  73. package/dist/js/core/submit-result-state.d.ts.map +1 -1
  74. package/dist/js/core/submit-result-ui.d.ts.map +1 -1
  75. package/dist/js/core/validation-focus.d.ts.map +1 -1
  76. package/dist/js/modules/captchas/factories.d.ts.map +1 -1
  77. package/dist/js/modules/captchas/host.d.ts +4 -1
  78. package/dist/js/modules/captchas/host.d.ts.map +1 -1
  79. package/dist/js/modules/captchas/recaptcha-shared.d.ts +1 -1
  80. package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -1
  81. package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
  82. package/dist/js/modules/fields/address-state.d.ts.map +1 -1
  83. package/dist/js/modules/fields/combobox.d.ts +2 -0
  84. package/dist/js/modules/fields/combobox.d.ts.map +1 -1
  85. package/dist/js/modules/fields/conditions.d.ts.map +1 -1
  86. package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
  87. package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
  88. package/dist/js/modules/fields/rich-text.d.ts.map +1 -1
  89. package/dist/js/modules/fields/summary.d.ts.map +1 -1
  90. package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
  91. package/dist/js/modules/payments/factories.d.ts.map +1 -1
  92. package/dist/js/modules/payments/opayo.d.ts.map +1 -1
  93. package/dist/js/submit/pipeline.d.ts +2 -0
  94. package/dist/js/submit/pipeline.d.ts.map +1 -1
  95. package/dist/js/utils/form-started-at.d.ts +1 -0
  96. package/dist/js/utils/form-started-at.d.ts.map +1 -1
  97. package/dist/js/utils/unload-warning.d.ts +4 -0
  98. package/dist/js/utils/unload-warning.d.ts.map +1 -1
  99. package/dist/js/validation/rules/required.d.ts.map +1 -1
  100. package/dist/js/validation/submit-readiness.d.ts.map +1 -1
  101. package/dist/js/validation/validator.d.ts +1 -0
  102. package/dist/js/validation/validator.d.ts.map +1 -1
  103. package/package.json +3 -3
  104. package/src/index.ts +1 -0
  105. package/src/js/core/create-formie-client.ts +20 -18
  106. package/src/js/core/dom-events.ts +30 -1
  107. package/src/js/core/page-client-event.ts +5 -7
  108. package/src/js/core/submit-result-state.ts +13 -2
  109. package/src/js/core/submit-result-ui.ts +21 -0
  110. package/src/js/core/validation-focus.ts +17 -3
  111. package/src/js/modules/captchas/factories.ts +241 -101
  112. package/src/js/modules/captchas/host.ts +16 -0
  113. package/src/js/modules/captchas/recaptcha-enterprise.ts +1 -1
  114. package/src/js/modules/captchas/recaptcha-shared.ts +23 -5
  115. package/src/js/modules/captchas/recaptcha-v3.ts +23 -14
  116. package/src/js/modules/fields/address-state.ts +6 -4
  117. package/src/js/modules/fields/combobox.ts +19 -1
  118. package/src/js/modules/fields/conditions.ts +3 -0
  119. package/src/js/modules/fields/file-upload.ts +11 -4
  120. package/src/js/modules/fields/phone-country.ts +23 -0
  121. package/src/js/modules/fields/rich-text.ts +33 -0
  122. package/src/js/modules/fields/summary.ts +63 -10
  123. package/src/js/modules/fields/text-limit.ts +11 -0
  124. package/src/js/modules/payments/factories.ts +87 -54
  125. package/src/js/modules/payments/opayo.ts +7 -0
  126. package/src/js/submit/pipeline.ts +16 -9
  127. package/src/js/utils/form-started-at.ts +19 -4
  128. package/src/js/utils/unload-warning.ts +63 -7
  129. package/src/js/validation/rules/required.ts +6 -0
  130. package/src/js/validation/submit-readiness.ts +2 -0
  131. package/src/js/validation/validator.ts +15 -4
  132. package/src/vendor.d.ts +2 -0
  133. package/dist/chunks/opayo-BwWdInEP.js +0 -188
  134. package/dist/chunks/recaptcha-shared-DTbTw-MF.js +0 -27
  135. package/dist/chunks/recaptcha-v3-CflUHeZD.js +0 -28
@@ -1,9 +1,9 @@
1
- import { t as e } from "./rolldown-runtime-DtPi1Y-2.js";
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
- })(e, (function(e) {
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 (!(typeof L > "u" || !L || !L.Mixin)) {
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
- console.warn("wrong listener type: " + typeof t);
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
- return;
193
- }
194
- if (typeof t != "function") {
195
- console.warn("wrong listener type: " + typeof t);
196
- return;
197
- }
198
- var o = this._listens(e, t, n);
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
- if (g(e)) {
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
- if (!st[t]) {
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
- r = e.detail;
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 ? (P(this._container), this.onRemove && this.onRemove(this._map), this._map.off("unload", this.remove, this), this._map = null, this) : this;
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 ? (this._attributions[e] || (this._attributions[e] = 0), this._attributions[e]++, this._update(), this) : this;
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 ? this : (this._enabled = !0, this.addHooks(), this);
1884
+ return this._enabled || (this._enabled = !0, this.addHooks()), this;
1902
1885
  },
1903
1886
  disable: function() {
1904
- return this._enabled ? (this._enabled = !1, this.removeHooks(), this) : this;
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
- wn._dragging === this && this.finishDrag();
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
- this._moved = !0;
1943
- return;
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] ? this : (this._layers[t] = e, e._mapToAdd = this, e.beforeAdd && e.beforeAdd(this), this.whenReady(e._layerAdd, e), this);
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] ? (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) : this;
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
- this._parts = this._rings;
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
- this._parts = this._rings;
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
- 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.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) {
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
- return;
3045
- }
3046
- 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;
3047
- for (var o = 0; o < this._url.length; o++) {
3048
- var s = N("source");
3049
- s.src = this._url[o], t.appendChild(s);
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
- this._autopanning = !1;
3229
- return;
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
- if (this._popup._source === t && !(t instanceof ar)) {
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
- return;
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
- this._removeAllTiles();
3557
- return;
3558
- }
3559
- for (e in this._tiles) t = this._tiles[e], t.retain = t.current;
3560
- for (e in this._tiles) if (t = this._tiles[e], t.current && !t.active) {
3561
- var r = t.coords;
3562
- this._retainParent(r.x, r.y, r.z, r.z - 5) || this._retainChildren(r.x, r.y, r.z, r.z + 2);
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
- if (c && c.active) {
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
- this._setView(e, n);
3643
- return;
3644
- }
3645
- for (var d = i.min.y; d <= i.max.y; d++) for (var f = i.min.x; f <= i.max.x; f++) {
3646
- var p = new x(f, d);
3647
- if (p.z = this._tileZoom, this._isValidTile(p)) {
3648
- var m = this._tiles[this._tileCoordsToKey(p)];
3649
- m ? m.current = !0 : o.push(p);
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
- if (!this._moved || !this._zooming) {
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,5 +1,5 @@
1
1
  import { i as e } from "./constants-DVcJAvc5.js";
2
- import { t } from "./api-ghNr2uxX.js";
2
+ import { t } from "./api-CmuOZ0i3.js";
3
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({
@@ -1,5 +1,5 @@
1
1
  import { s as e } from "./event-names-BCI2FLD8.js";
2
- import { t } from "./api-Dxl_CKw-.js";
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
- if (!n?.checkoutUrl) {
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);
@@ -1,4 +1,4 @@
1
- import { t as e } from "./api-Dxl_CKw-.js";
1
+ import { t as e } from "./api-BR2Gqy37.js";
2
2
  //#region src/js/modules/payments/moneris.ts
3
3
  var t = {
4
4
  940: "Invalid profile ID (tokenization request).",
@@ -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, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), 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,5 +1,5 @@
1
1
  import { s as e } from "./event-names-BCI2FLD8.js";
2
- import { t } from "./api-Dxl_CKw-.js";
2
+ import { t } from "./api-BR2Gqy37.js";
3
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({
@@ -1,5 +1,5 @@
1
- import { p as e } from "./dist-ZLeW0zZ3.js";
2
- import { a as t, l as n, u as r } from "./shared-OKhSay59.js";
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,4 +1,4 @@
1
- import { t as e } from "./api-Dxl_CKw-.js";
1
+ import { t as e } from "./api-BR2Gqy37.js";
2
2
  import { r as t } from "./scripts-DrccjrFv.js";
3
3
  import { t as n } from "./styles-BfoIZwJp.js";
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { t as e } from "./api-Dxl_CKw-.js";
1
+ import { t as e } from "./api-BR2Gqy37.js";
2
2
  import { r as t } from "./scripts-DrccjrFv.js";
3
3
  import { t as n } from "./styles-BfoIZwJp.js";
4
4
  //#endregion
@@ -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
- if (t || !r) {
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
- if (t) {
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
  },