@verbb/formie-browser 1.0.1 → 1.0.2

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 (346) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/chunks/address-finder-CQW81kY0.js +37 -0
  3. package/dist/chunks/bpoint-D8OjLmsn.js +26 -0
  4. package/dist/chunks/calculations-BqZsENCq.js +147 -0
  5. package/dist/chunks/captcha-eu-DIa6aUWz.js +34 -0
  6. package/dist/chunks/checkbox-radio-BI-UjgMF.js +136 -0
  7. package/dist/chunks/conditions-BVl6jTYo.js +433 -0
  8. package/dist/chunks/date-picker-69TgvErA.js +4994 -0
  9. package/dist/chunks/eway-1GPxH6DU.js +74 -0
  10. package/dist/chunks/file-upload-BDZZftgL.js +281 -0
  11. package/dist/chunks/friendly-captcha-v1-DA2QPKA3.js +33 -0
  12. package/dist/chunks/friendly-captcha-v2-BorOWiz_.js +38 -0
  13. package/dist/chunks/go-cardless-DwBgERcA.js +24 -0
  14. package/dist/chunks/google-address-BcTBncyS.js +162 -0
  15. package/dist/chunks/hcaptcha-BchdVCqq.js +56 -0
  16. package/dist/chunks/hidden-D8RqSPt7.js +31 -0
  17. package/dist/chunks/index-BEsfee-D.js +1839 -0
  18. package/dist/chunks/index-BP7Unm5Y.js +863 -0
  19. package/dist/chunks/index-C1ZOKiAi.js +4229 -0
  20. package/dist/chunks/loqate-nXuTX7In.js +55 -0
  21. package/dist/chunks/mollie-qdCynQCd.js +24 -0
  22. package/dist/chunks/moneris-BNEA-laO.js +101 -0
  23. package/dist/chunks/opayo-BJtXOkuK.js +122 -0
  24. package/dist/chunks/paddle-D72Pa8kr.js +60 -0
  25. package/dist/chunks/paypal-Cqt2bned.js +100 -0
  26. package/dist/chunks/payway-BjCqsc0H.js +56 -0
  27. package/dist/chunks/phone-country-K9pYAlzM.js +3765 -0
  28. package/dist/chunks/place-kit-Dg6f_UoM.js +42 -0
  29. package/dist/chunks/placekit-autocomplete.esm-LAwfbPZl.js +1299 -0
  30. package/dist/chunks/recaptcha-enterprise--VYAeeqz.js +71 -0
  31. package/dist/chunks/recaptcha-shared-PSIEEEe1.js +15 -0
  32. package/dist/chunks/recaptcha-v2-checkbox-atBNe5ml.js +41 -0
  33. package/dist/chunks/recaptcha-v2-invisible-DnBufNPT.js +59 -0
  34. package/dist/chunks/recaptcha-v3-CF6O8rDj.js +28 -0
  35. package/dist/chunks/repeater-CB7Yojvx.js +124 -0
  36. package/dist/chunks/rich-text-nAV_SQZo.js +304 -0
  37. package/dist/chunks/scripts-BkAAux0i.js +36 -0
  38. package/dist/chunks/sdk-3SicTWby.js +1559 -0
  39. package/dist/chunks/shared-DGqeMvcJ.js +80 -0
  40. package/dist/chunks/signature-BT6CsQ6n.js +550 -0
  41. package/dist/chunks/snaptcha-C7qQo02f.js +8 -0
  42. package/dist/chunks/square-C5AH3trb.js +46 -0
  43. package/dist/chunks/stripe-EJK0RyUv.js +202 -0
  44. package/dist/chunks/styles-C3aqgtek.js +21 -0
  45. package/dist/chunks/summary-DC_ipXCU.js +126 -0
  46. package/dist/chunks/table-BEAI99qo.js +95 -0
  47. package/dist/chunks/text-limit-Blgq5G-G.js +135 -0
  48. package/dist/chunks/turnstile-_uCRwnU-.js +59 -0
  49. package/dist/chunks/utils-BntI3W4S.js +6149 -0
  50. package/dist/index.d.ts +30 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +39 -3205
  53. package/dist/js/compatibility/dom-adapter.d.ts +12 -0
  54. package/dist/js/compatibility/dom-adapter.d.ts.map +1 -0
  55. package/dist/js/compatibility/event-map.d.ts +25 -0
  56. package/dist/js/compatibility/event-map.d.ts.map +1 -0
  57. package/dist/js/compatibility/validator-adapter.d.ts +17 -0
  58. package/dist/js/compatibility/validator-adapter.d.ts.map +1 -0
  59. package/dist/js/contracts/client.d.ts +40 -0
  60. package/dist/js/contracts/client.d.ts.map +1 -0
  61. package/dist/js/contracts/common.d.ts +5 -0
  62. package/dist/js/contracts/common.d.ts.map +1 -0
  63. package/dist/js/contracts/modules.d.ts +47 -0
  64. package/dist/js/contracts/modules.d.ts.map +1 -0
  65. package/dist/js/contracts/schema.d.ts +79 -0
  66. package/dist/js/contracts/schema.d.ts.map +1 -0
  67. package/dist/js/contracts/theme.d.ts +2 -0
  68. package/dist/js/contracts/theme.d.ts.map +1 -0
  69. package/dist/js/core/create-formie-client.d.ts +3 -0
  70. package/dist/js/core/create-formie-client.d.ts.map +1 -0
  71. package/dist/js/core/dom-events.d.ts +2 -0
  72. package/dist/js/core/dom-events.d.ts.map +1 -0
  73. package/dist/js/core/formie.d.ts +27 -0
  74. package/dist/js/core/formie.d.ts.map +1 -0
  75. package/dist/js/core/hydrate-modules.d.ts +22 -0
  76. package/dist/js/core/hydrate-modules.d.ts.map +1 -0
  77. package/dist/js/core/page-client-event.d.ts +9 -0
  78. package/dist/js/core/page-client-event.d.ts.map +1 -0
  79. package/dist/js/core/page-tab-errors.d.ts +2 -0
  80. package/dist/js/core/page-tab-errors.d.ts.map +1 -0
  81. package/dist/js/core/submit-flow.d.ts +21 -0
  82. package/dist/js/core/submit-flow.d.ts.map +1 -0
  83. package/dist/js/core/submit-result-state.d.ts +8 -0
  84. package/dist/js/core/submit-result-state.d.ts.map +1 -0
  85. package/dist/js/core/submit-result-ui.d.ts +10 -0
  86. package/dist/js/core/submit-result-ui.d.ts.map +1 -0
  87. package/dist/js/events/event-bus.d.ts +21 -0
  88. package/dist/js/events/event-bus.d.ts.map +1 -0
  89. package/dist/js/modules/address/address-finder.d.ts +2 -0
  90. package/dist/js/modules/address/address-finder.d.ts.map +1 -0
  91. package/dist/js/modules/address/api.d.ts +8 -0
  92. package/dist/js/modules/address/api.d.ts.map +1 -0
  93. package/dist/js/modules/address/constants.d.ts +15 -0
  94. package/dist/js/modules/address/constants.d.ts.map +1 -0
  95. package/dist/js/modules/address/factories.d.ts +35 -0
  96. package/dist/js/modules/address/factories.d.ts.map +1 -0
  97. package/dist/js/modules/address/google-address.d.ts +2 -0
  98. package/dist/js/modules/address/google-address.d.ts.map +1 -0
  99. package/dist/js/modules/address/host.d.ts +30 -0
  100. package/dist/js/modules/address/host.d.ts.map +1 -0
  101. package/dist/js/modules/address/index.d.ts +3 -0
  102. package/dist/js/modules/address/index.d.ts.map +1 -0
  103. package/dist/js/modules/address/loqate.d.ts +2 -0
  104. package/dist/js/modules/address/loqate.d.ts.map +1 -0
  105. package/dist/js/modules/address/place-kit.d.ts +2 -0
  106. package/dist/js/modules/address/place-kit.d.ts.map +1 -0
  107. package/dist/js/modules/captchas/api.d.ts +9 -0
  108. package/dist/js/modules/captchas/api.d.ts.map +1 -0
  109. package/dist/js/modules/captchas/captcha-eu.d.ts +2 -0
  110. package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -0
  111. package/dist/js/modules/captchas/constants.d.ts +5 -0
  112. package/dist/js/modules/captchas/constants.d.ts.map +1 -0
  113. package/dist/js/modules/captchas/factories.d.ts +63 -0
  114. package/dist/js/modules/captchas/factories.d.ts.map +1 -0
  115. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +2 -0
  116. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -0
  117. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +2 -0
  118. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -0
  119. package/dist/js/modules/captchas/hcaptcha.d.ts +2 -0
  120. package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -0
  121. package/dist/js/modules/captchas/host.d.ts +78 -0
  122. package/dist/js/modules/captchas/host.d.ts.map +1 -0
  123. package/dist/js/modules/captchas/index.d.ts +3 -0
  124. package/dist/js/modules/captchas/index.d.ts.map +1 -0
  125. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +2 -0
  126. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -0
  127. package/dist/js/modules/captchas/recaptcha-shared.d.ts +26 -0
  128. package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -0
  129. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +2 -0
  130. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -0
  131. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +2 -0
  132. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -0
  133. package/dist/js/modules/captchas/recaptcha-v3.d.ts +2 -0
  134. package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -0
  135. package/dist/js/modules/captchas/snaptcha.d.ts +2 -0
  136. package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -0
  137. package/dist/js/modules/captchas/turnstile.d.ts +2 -0
  138. package/dist/js/modules/captchas/turnstile.d.ts.map +1 -0
  139. package/dist/js/modules/captchas/utils.d.ts +13 -0
  140. package/dist/js/modules/captchas/utils.d.ts.map +1 -0
  141. package/dist/js/modules/fields/calculations.d.ts +3 -0
  142. package/dist/js/modules/fields/calculations.d.ts.map +1 -0
  143. package/dist/js/modules/fields/checkbox-radio.d.ts +3 -0
  144. package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -0
  145. package/dist/js/modules/fields/conditions/config.d.ts +5 -0
  146. package/dist/js/modules/fields/conditions/config.d.ts.map +1 -0
  147. package/dist/js/modules/fields/conditions/effects.d.ts +2 -0
  148. package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -0
  149. package/dist/js/modules/fields/conditions/evaluator.d.ts +6 -0
  150. package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -0
  151. package/dist/js/modules/fields/conditions/references.d.ts +5 -0
  152. package/dist/js/modules/fields/conditions/references.d.ts.map +1 -0
  153. package/dist/js/modules/fields/conditions/transforms.d.ts +3 -0
  154. package/dist/js/modules/fields/conditions/transforms.d.ts.map +1 -0
  155. package/dist/js/modules/fields/conditions/types.d.ts +30 -0
  156. package/dist/js/modules/fields/conditions/types.d.ts.map +1 -0
  157. package/dist/js/modules/fields/conditions/values.d.ts +5 -0
  158. package/dist/js/modules/fields/conditions/values.d.ts.map +1 -0
  159. package/dist/js/modules/fields/conditions.d.ts +3 -0
  160. package/dist/js/modules/fields/conditions.d.ts.map +1 -0
  161. package/dist/js/modules/fields/date-picker.d.ts +3 -0
  162. package/dist/js/modules/fields/date-picker.d.ts.map +1 -0
  163. package/dist/js/modules/fields/file-upload.d.ts +3 -0
  164. package/dist/js/modules/fields/file-upload.d.ts.map +1 -0
  165. package/dist/js/modules/fields/hidden.d.ts +3 -0
  166. package/dist/js/modules/fields/hidden.d.ts.map +1 -0
  167. package/dist/js/modules/fields/index.d.ts +3 -0
  168. package/dist/js/modules/fields/index.d.ts.map +1 -0
  169. package/dist/js/modules/fields/phone-country.d.ts +3 -0
  170. package/dist/js/modules/fields/phone-country.d.ts.map +1 -0
  171. package/dist/js/modules/fields/repeater.d.ts +3 -0
  172. package/dist/js/modules/fields/repeater.d.ts.map +1 -0
  173. package/dist/js/modules/fields/rich-text.d.ts +3 -0
  174. package/dist/js/modules/fields/rich-text.d.ts.map +1 -0
  175. package/dist/js/modules/fields/shared.d.ts +20 -0
  176. package/dist/js/modules/fields/shared.d.ts.map +1 -0
  177. package/dist/js/modules/fields/signature.d.ts +3 -0
  178. package/dist/js/modules/fields/signature.d.ts.map +1 -0
  179. package/dist/js/modules/fields/summary.d.ts +3 -0
  180. package/dist/js/modules/fields/summary.d.ts.map +1 -0
  181. package/dist/js/modules/fields/table.d.ts +3 -0
  182. package/dist/js/modules/fields/table.d.ts.map +1 -0
  183. package/dist/js/modules/fields/text-limit.d.ts +3 -0
  184. package/dist/js/modules/fields/text-limit.d.ts.map +1 -0
  185. package/dist/js/modules/loader.d.ts +11 -0
  186. package/dist/js/modules/loader.d.ts.map +1 -0
  187. package/dist/js/modules/payments/api.d.ts +8 -0
  188. package/dist/js/modules/payments/api.d.ts.map +1 -0
  189. package/dist/js/modules/payments/bpoint.d.ts +2 -0
  190. package/dist/js/modules/payments/bpoint.d.ts.map +1 -0
  191. package/dist/js/modules/payments/constants.d.ts +5 -0
  192. package/dist/js/modules/payments/constants.d.ts.map +1 -0
  193. package/dist/js/modules/payments/eway.d.ts +9 -0
  194. package/dist/js/modules/payments/eway.d.ts.map +1 -0
  195. package/dist/js/modules/payments/factories.d.ts +54 -0
  196. package/dist/js/modules/payments/factories.d.ts.map +1 -0
  197. package/dist/js/modules/payments/go-cardless.d.ts +2 -0
  198. package/dist/js/modules/payments/go-cardless.d.ts.map +1 -0
  199. package/dist/js/modules/payments/host.d.ts +70 -0
  200. package/dist/js/modules/payments/host.d.ts.map +1 -0
  201. package/dist/js/modules/payments/index.d.ts +3 -0
  202. package/dist/js/modules/payments/index.d.ts.map +1 -0
  203. package/dist/js/modules/payments/mollie.d.ts +2 -0
  204. package/dist/js/modules/payments/mollie.d.ts.map +1 -0
  205. package/dist/js/modules/payments/moneris.d.ts +2 -0
  206. package/dist/js/modules/payments/moneris.d.ts.map +1 -0
  207. package/dist/js/modules/payments/opayo.d.ts +25 -0
  208. package/dist/js/modules/payments/opayo.d.ts.map +1 -0
  209. package/dist/js/modules/payments/paddle.d.ts +2 -0
  210. package/dist/js/modules/payments/paddle.d.ts.map +1 -0
  211. package/dist/js/modules/payments/paypal.d.ts +2 -0
  212. package/dist/js/modules/payments/paypal.d.ts.map +1 -0
  213. package/dist/js/modules/payments/payway.d.ts +2 -0
  214. package/dist/js/modules/payments/payway.d.ts.map +1 -0
  215. package/dist/js/modules/payments/square.d.ts +2 -0
  216. package/dist/js/modules/payments/square.d.ts.map +1 -0
  217. package/dist/js/modules/payments/stripe.d.ts +2 -0
  218. package/dist/js/modules/payments/stripe.d.ts.map +1 -0
  219. package/dist/js/modules/payments/utils.d.ts +17 -0
  220. package/dist/js/modules/payments/utils.d.ts.map +1 -0
  221. package/dist/js/modules/registry.d.ts +9 -0
  222. package/dist/js/modules/registry.d.ts.map +1 -0
  223. package/dist/js/modules/styles.d.ts +2 -0
  224. package/dist/js/modules/styles.d.ts.map +1 -0
  225. package/dist/js/submit/pipeline.d.ts +18 -0
  226. package/dist/js/submit/pipeline.d.ts.map +1 -0
  227. package/dist/js/theme/theme-classes.d.ts +10 -0
  228. package/dist/js/theme/theme-classes.d.ts.map +1 -0
  229. package/dist/js/transport/forms-api.d.ts +11 -0
  230. package/dist/js/transport/forms-api.d.ts.map +1 -0
  231. package/dist/js/utils/async.d.ts +8 -0
  232. package/dist/js/utils/async.d.ts.map +1 -0
  233. package/dist/js/utils/debug.d.ts +10 -0
  234. package/dist/js/utils/debug.d.ts.map +1 -0
  235. package/dist/js/utils/event-names.d.ts +13 -0
  236. package/dist/js/utils/event-names.d.ts.map +1 -0
  237. package/dist/js/utils/field-references.d.ts +6 -0
  238. package/dist/js/utils/field-references.d.ts.map +1 -0
  239. package/dist/js/utils/field-references.keys.d.ts +4 -0
  240. package/dist/js/utils/field-references.keys.d.ts.map +1 -0
  241. package/dist/js/utils/field-references.parser.d.ts +3 -0
  242. package/dist/js/utils/field-references.parser.d.ts.map +1 -0
  243. package/dist/js/utils/field-references.registry.d.ts +3 -0
  244. package/dist/js/utils/field-references.registry.d.ts.map +1 -0
  245. package/dist/js/utils/field-references.resolver.d.ts +4 -0
  246. package/dist/js/utils/field-references.resolver.d.ts.map +1 -0
  247. package/dist/js/utils/field-references.types.d.ts +27 -0
  248. package/dist/js/utils/field-references.types.d.ts.map +1 -0
  249. package/dist/js/utils/fields.d.ts +5 -0
  250. package/dist/js/utils/fields.d.ts.map +1 -0
  251. package/dist/js/utils/http.d.ts +9 -0
  252. package/dist/js/utils/http.d.ts.map +1 -0
  253. package/dist/js/utils/i18n.d.ts +7 -0
  254. package/dist/js/utils/i18n.d.ts.map +1 -0
  255. package/dist/js/utils/scripts.d.ts +13 -0
  256. package/dist/js/utils/scripts.d.ts.map +1 -0
  257. package/dist/js/utils/unload-warning.d.ts +10 -0
  258. package/dist/js/utils/unload-warning.d.ts.map +1 -0
  259. package/dist/js/validation/rules/email.d.ts +4 -0
  260. package/dist/js/validation/rules/email.d.ts.map +1 -0
  261. package/dist/js/validation/rules/match.d.ts +4 -0
  262. package/dist/js/validation/rules/match.d.ts.map +1 -0
  263. package/dist/js/validation/rules/number.d.ts +4 -0
  264. package/dist/js/validation/rules/number.d.ts.map +1 -0
  265. package/dist/js/validation/rules/required.d.ts +4 -0
  266. package/dist/js/validation/rules/required.d.ts.map +1 -0
  267. package/dist/js/validation/rules/shared.d.ts +7 -0
  268. package/dist/js/validation/rules/shared.d.ts.map +1 -0
  269. package/dist/js/validation/rules/url.d.ts +4 -0
  270. package/dist/js/validation/rules/url.d.ts.map +1 -0
  271. package/dist/js/validation/rules.d.ts +10 -0
  272. package/dist/js/validation/rules.d.ts.map +1 -0
  273. package/dist/js/validation/types.d.ts +44 -0
  274. package/dist/js/validation/types.d.ts.map +1 -0
  275. package/dist/js/validation/validator.d.ts +53 -0
  276. package/dist/js/validation/validator.d.ts.map +1 -0
  277. package/package.json +3 -2
  278. package/src/js/modules/fields/file-upload.ts +1 -1
  279. package/src/js/modules/fields/repeater.ts +1 -1
  280. package/src/js/modules/fields/rich-text.ts +2 -2
  281. package/src/js/modules/fields/signature.ts +1 -1
  282. package/src/js/modules/fields/summary.ts +1 -1
  283. package/src/js/modules/fields/table.ts +1 -1
  284. package/src/js/modules/fields/text-limit.ts +1 -1
  285. package/src/js/modules/payments/paypal.ts +1 -1
  286. package/src/js/modules/payments/payway.ts +1 -1
  287. package/src/js/modules/payments/stripe.ts +1 -1
  288. package/dist/chunks/address-finder-DfMCiW89.js +0 -47
  289. package/dist/chunks/api-CbqEMQT5.js +0 -181
  290. package/dist/chunks/api-DE7LfK-R.js +0 -960
  291. package/dist/chunks/api-DOfDzYC_.js +0 -538
  292. package/dist/chunks/async-B3DUf1GZ.js +0 -26
  293. package/dist/chunks/bpoint-Ciy3yY9Q.js +0 -34
  294. package/dist/chunks/calculations-CkYAqO_-.js +0 -197
  295. package/dist/chunks/captcha-eu-DnOWhMwr.js +0 -43
  296. package/dist/chunks/checkbox-radio-0x7Tc0br.js +0 -197
  297. package/dist/chunks/chunk-K6L4z4UQ.js +0 -24
  298. package/dist/chunks/conditions-4fXKhEJS.js +0 -609
  299. package/dist/chunks/date-picker-B6iZkjHS.js +0 -6204
  300. package/dist/chunks/debug-KnZeKYBI.js +0 -39
  301. package/dist/chunks/dist-D09GnXMW.js +0 -2663
  302. package/dist/chunks/event-names-DamGPtXR.js +0 -51
  303. package/dist/chunks/eway-DEAYcwT0.js +0 -86
  304. package/dist/chunks/field-references.keys-BpBZ_quS.js +0 -24
  305. package/dist/chunks/field-references.resolver-Ba6xhiJC.js +0 -183
  306. package/dist/chunks/file-upload-BIj85NFH.js +0 -428
  307. package/dist/chunks/friendly-captcha-v1-CqO4WVre.js +0 -40
  308. package/dist/chunks/friendly-captcha-v2-CyykcJcM.js +0 -47
  309. package/dist/chunks/friendly-challenge-Dg8XkStd.js +0 -1101
  310. package/dist/chunks/go-cardless-CuND59rR.js +0 -26
  311. package/dist/chunks/google-address--uR8WDSm.js +0 -208
  312. package/dist/chunks/hcaptcha-CmaFUesv.js +0 -72
  313. package/dist/chunks/hidden-CYnZYple.js +0 -36
  314. package/dist/chunks/http-18nn97DZ.js +0 -29
  315. package/dist/chunks/i18n-vUh-KGiH.js +0 -55
  316. package/dist/chunks/loqate-BICNJlVK.js +0 -97
  317. package/dist/chunks/mollie-DwlsgHZ1.js +0 -26
  318. package/dist/chunks/moneris-B_IFZFTx.js +0 -159
  319. package/dist/chunks/opayo-U2x_TOII.js +0 -192
  320. package/dist/chunks/paddle-BqXFrc79.js +0 -75
  321. package/dist/chunks/paypal-VowQ3ilP.js +0 -121
  322. package/dist/chunks/payway-VOO-ajyg.js +0 -75
  323. package/dist/chunks/phone-country-B6Me4lK0.js +0 -3317
  324. package/dist/chunks/place-kit-ldUl-u9w.js +0 -56
  325. package/dist/chunks/placekit-autocomplete.esm-D-lGeaZl.js +0 -1771
  326. package/dist/chunks/recaptcha-enterprise-DPJNyv1X.js +0 -72
  327. package/dist/chunks/recaptcha-shared-DTI4qWVR.js +0 -22
  328. package/dist/chunks/recaptcha-v2-checkbox-zFjpvJ5c.js +0 -49
  329. package/dist/chunks/recaptcha-v2-invisible-CnYtkNvz.js +0 -62
  330. package/dist/chunks/recaptcha-v3-EAlWhnkX.js +0 -33
  331. package/dist/chunks/repeater-BPm7Mkyn.js +0 -149
  332. package/dist/chunks/rich-text-CHSly1Hq.js +0 -438
  333. package/dist/chunks/scripts-BGD_iU_6.js +0 -41
  334. package/dist/chunks/sdk-B7u9fTlP.js +0 -2103
  335. package/dist/chunks/shared-DC6_1u8X.js +0 -85
  336. package/dist/chunks/signature-DNMCgrMd.js +0 -763
  337. package/dist/chunks/snaptcha-CCDunGeb.js +0 -8
  338. package/dist/chunks/square-BLqK51rS.js +0 -61
  339. package/dist/chunks/stripe-B6ZcDQdx.js +0 -273
  340. package/dist/chunks/styles-BIh6g7V_.js +0 -22
  341. package/dist/chunks/summary-BTG0uIOt.js +0 -189
  342. package/dist/chunks/table-BTYc0Qm8.js +0 -122
  343. package/dist/chunks/text-limit-CgBMu4sJ.js +0 -177
  344. package/dist/chunks/theme-classes-vSHpdCUO.js +0 -59
  345. package/dist/chunks/turnstile-DP0bdR7T.js +0 -68
  346. package/dist/chunks/utils-ByrEVYrJ.js +0 -49584
@@ -0,0 +1,55 @@
1
+ import { d as p, A as d } from "./index-C1ZOKiAi.js";
2
+ import { l as y } from "./scripts-BkAAux0i.js";
3
+ const E = "FORMIE_LOQATE_SCRIPT", C = p({
4
+ id: "loqate",
5
+ load: async () => {
6
+ await y("pca", {
7
+ id: E,
8
+ src: "https://services.pcapredict.com/js/address-3.91.min.js",
9
+ async: !0,
10
+ defer: !0
11
+ });
12
+ const e = document.createElement("link");
13
+ return e.href = "https://services.pcapredict.com/css/address-3.91.min.css", e.rel = "stylesheet", e.type = "text/css", document.querySelector(`link[href="${e.href}"]`) || document.body.appendChild(e), window.pca;
14
+ },
15
+ mount: ({ api: e, field: m, services: P, provider: n }) => {
16
+ const l = n.namespace || "", i = n.apiKey || "";
17
+ if (!i)
18
+ throw new Error("Loqate API key is required");
19
+ const f = {
20
+ autoComplete: d.autoComplete,
21
+ address1: d.address1,
22
+ address2: d.address2,
23
+ address3: d.address3,
24
+ city: d.city,
25
+ state: d.state,
26
+ zip: d.zip,
27
+ country: d.country
28
+ }, t = (o) => {
29
+ if (l)
30
+ return `${l}[${o}]`;
31
+ const a = f[o], s = a ? m.querySelector(a) : null;
32
+ return s?.name ? s.name : s?.id ? s.id : "";
33
+ }, c = t("autoComplete");
34
+ if (!c)
35
+ throw new Error("Loqate: could not find autocomplete input within address field");
36
+ const u = [
37
+ { element: c, field: "", mode: e.fieldMode.SEARCH },
38
+ { element: t("address1"), field: "Line1", mode: e.fieldMode.POPULATE },
39
+ { element: t("address2"), field: "Line2", mode: e.fieldMode.POPULATE },
40
+ { element: t("address3"), field: "Line3", mode: e.fieldMode.POPULATE },
41
+ { element: t("city"), field: "City", mode: e.fieldMode.POPULATE },
42
+ { element: t("state"), field: "Province", mode: e.fieldMode.POPULATE },
43
+ { element: t("zip"), field: "PostalCode", mode: e.fieldMode.POPULATE },
44
+ { element: t("country"), field: "CountryName", mode: e.fieldMode.COUNTRY }
45
+ ].filter((o) => o.element), r = new e.Address(u, {
46
+ key: i,
47
+ simulateReactEvents: !0,
48
+ ...n.reconfigurableOptions || {}
49
+ });
50
+ return typeof r.load == "function" && r.load(), r;
51
+ }
52
+ });
53
+ export {
54
+ C as loqateModule
55
+ };
@@ -0,0 +1,24 @@
1
+ import { u as d, v as l } from "./index-C1ZOKiAi.js";
2
+ const o = l("mollie", "redirect"), s = d({
3
+ id: "mollie",
4
+ defaultRequiredInputSuffixes: [],
5
+ load: async () => null,
6
+ setup: async ({ services: r, root: e }) => {
7
+ const t = (i) => {
8
+ const n = i.detail?.data;
9
+ if (!n?.checkoutUrl) {
10
+ r.addError("Missing Mollie checkout URL.");
11
+ return;
12
+ }
13
+ window.location.href = n.checkoutUrl;
14
+ };
15
+ return e.addEventListener(o, t), {
16
+ destroy: () => {
17
+ e.removeEventListener(o, t);
18
+ }
19
+ };
20
+ }
21
+ });
22
+ export {
23
+ s as mollieModule
24
+ };
@@ -0,0 +1,101 @@
1
+ import { u as S } from "./index-C1ZOKiAi.js";
2
+ const k = {
3
+ 940: "Invalid profile ID (tokenization request).",
4
+ 941: "Error generating token.",
5
+ 942: "Invalid Profile ID or source URL.",
6
+ 943: "Card data is invalid.",
7
+ 944: "Invalid expiration date.",
8
+ 945: "Invalid CVD."
9
+ }, I = (n) => {
10
+ const i = (e) => {
11
+ const r = String(e.dataKey ?? e.data_key ?? "").trim(), t = String(e.responseCode ?? e.response_code ?? "").trim(), d = String(e.responseMessage ?? e.response_message ?? "").trim(), a = String(e.error ?? e.errorMessage ?? e.message ?? "").trim();
12
+ if (r)
13
+ return { token: r, error: "" };
14
+ if (t && t !== "001") {
15
+ const s = k[t] || `Moneris response code ${t}.`;
16
+ return { token: "", error: d || s };
17
+ }
18
+ return { token: "", error: a };
19
+ };
20
+ if (n && typeof n == "object")
21
+ return i(n);
22
+ if (typeof n != "string")
23
+ return { token: "", error: "" };
24
+ const o = n.trim();
25
+ if (!o)
26
+ return { token: "", error: "" };
27
+ try {
28
+ const e = JSON.parse(o);
29
+ if (e && typeof e == "object")
30
+ return i(e);
31
+ } catch {
32
+ }
33
+ if (o.includes("=")) {
34
+ const e = new URLSearchParams(o), r = (e.get("dataKey") || e.get("data_key") || "").trim(), t = (e.get("responseCode") || e.get("response_code") || "").trim(), d = (e.get("responseMessage") || e.get("response_message") || "").trim(), a = (e.get("error") || e.get("message") || "").trim();
35
+ if (r)
36
+ return { token: r, error: "" };
37
+ if (t && t !== "001") {
38
+ const s = k[t] || `Moneris response code ${t}.`;
39
+ return { token: "", error: d || s };
40
+ }
41
+ return { token: "", error: a };
42
+ }
43
+ return /^[A-Za-z0-9._-]{8,}$/.test(o) ? { token: o, error: "" } : { token: "", error: "" };
44
+ }, z = S({
45
+ id: "moneris",
46
+ defaultRequiredInputSuffixes: ["monerisTokenId"],
47
+ load: async () => null,
48
+ onBeforeAuthorize: async (n) => {
49
+ const { field: i, services: o, options: e } = n, r = i, d = (e.provider.endpointUrl || "").trim(), a = i.querySelector("[data-formie-moneris-frame]");
50
+ let s = "";
51
+ try {
52
+ s = new URL(d, window.location.origin).origin;
53
+ } catch {
54
+ s = "";
55
+ }
56
+ if (!a?.contentWindow || !s)
57
+ return o.addError("Moneris frame or endpoint is missing."), !1;
58
+ r.__formieMonerisAuthorizeCleanup?.();
59
+ const p = (r.__formieMonerisAuthorizeRequestId || 0) + 1;
60
+ return r.__formieMonerisAuthorizeRequestId = p, new Promise((f) => {
61
+ let u = !1, g = "", l = 0;
62
+ const c = () => {
63
+ window.removeEventListener("message", M), window.clearTimeout(l), r.__formieMonerisAuthorizeCleanup === c && (r.__formieMonerisAuthorizeCleanup = null);
64
+ }, M = (_) => {
65
+ if (u || p !== r.__formieMonerisAuthorizeRequestId || _.origin !== s)
66
+ return;
67
+ const m = I(_.data);
68
+ m.token ? (u = !0, c(), o.updateInputs("monerisTokenId", m.token), f(!0)) : m.error && (g = m.error);
69
+ };
70
+ r.__formieMonerisAuthorizeCleanup = c, l = window.setTimeout(() => {
71
+ u || (u = !0, c(), o.addError(g || "Moneris tokenization timed out. Please try again."), f(!1));
72
+ }, 1e4), window.addEventListener("message", M);
73
+ try {
74
+ a.contentWindow?.postMessage("tokenize", s);
75
+ } catch {
76
+ u = !0, c(), o.addError("Moneris tokenization could not be started."), f(!1);
77
+ }
78
+ });
79
+ },
80
+ setup: async (n) => {
81
+ const { services: i } = n, o = (r) => {
82
+ if (!r.origin.includes("moneris"))
83
+ return;
84
+ const t = I(r.data);
85
+ t.token && i.updateInputs("monerisTokenId", t.token);
86
+ }, e = i.events.onRoot("message", o);
87
+ return {
88
+ destroy: () => {
89
+ e();
90
+ const r = n.target;
91
+ r.__formieMonerisAuthorizeCleanup?.(), r.__formieMonerisAuthorizeCleanup = null;
92
+ }
93
+ };
94
+ },
95
+ onAfterSubmit: async ({ services: n }) => {
96
+ n.updateInputs("monerisTokenId", "");
97
+ }
98
+ });
99
+ export {
100
+ z as monerisModule
101
+ };
@@ -0,0 +1,122 @@
1
+ import { u as v, v as w, h as b } from "./index-C1ZOKiAi.js";
2
+ import { l as E } from "./scripts-BkAAux0i.js";
3
+ const I = "FORMIE_OPAYO_SCRIPT", D = "https://live.opayo.eu.elavon.com/api/v1/js/sagepay.js", T = "https://sandbox.opayo.eu.elavon.com/api/v1/js/sagepay.js", t = b("payments", "opayo"), k = w("opayo", "challenge"), C = "formie:payment:opayo:challenge:response", R = v({
4
+ id: "opayo",
5
+ defaultRequiredInputSuffixes: ["opayoTokenId"],
6
+ load: async (c) => {
7
+ const { provider: a } = c.options, d = !!a.useSandbox ? T : D;
8
+ return await E("sagepayOwnForm", {
9
+ id: I,
10
+ src: d,
11
+ timeoutMs: 1e4
12
+ }), null;
13
+ },
14
+ onBeforeAuthorize: async (c) => {
15
+ const { field: a, services: e, options: d } = c, p = d.provider, g = p.handle || "opayo", m = e.form;
16
+ if (!m?.action)
17
+ return e.addError("Form action is missing."), t.warn("Missing form action before authorize."), !1;
18
+ const s = window.sagepayOwnForm;
19
+ if (!s)
20
+ return e.addError("Opayo script failed to load."), t.warn("sagepayOwnForm global not available."), !1;
21
+ const r = a.querySelector('[data-opayo-card="cardholder-name"]')?.value ?? "";
22
+ let y = a.querySelector('[data-opayo-card="card-number"]')?.value ?? "", f = a.querySelector('[data-opayo-card="expiry-date"]')?.value ?? "";
23
+ const h = a.querySelector('[data-opayo-card="security-code"]')?.value ?? "";
24
+ return y = y.replace(/[\s/]/g, ""), f = f.replace(/[\s/]/g, ""), new Promise((n) => {
25
+ const i = new FormData();
26
+ i.append("action", "formie/payment-webhooks/process-callback"), i.append("merchantSessionKey", "true"), i.append("handle", g), i.append("sessionToken", p.sessionToken || ""), fetch(m.action, {
27
+ method: "POST",
28
+ body: i
29
+ }).then(async (o) => {
30
+ if (o.status < 200 || o.status >= 300) {
31
+ e.addError(`${o.status}: ${o.statusText}`), t.warn("Merchant session request failed.", {
32
+ status: o.status,
33
+ statusText: o.statusText
34
+ }), n(!1);
35
+ return;
36
+ }
37
+ try {
38
+ const u = (await o.json()).merchantSessionKey;
39
+ if (!u) {
40
+ e.addError("Unable to get merchant session."), t.warn("merchantSessionKey missing in callback response."), n(!1);
41
+ return;
42
+ }
43
+ s({ merchantSessionKey: u }).tokeniseCardDetails({
44
+ cardDetails: {
45
+ cardholderName: r,
46
+ cardNumber: y,
47
+ expiryDate: f,
48
+ securityCode: h
49
+ },
50
+ onTokenised: (l) => {
51
+ l.success && l.cardIdentifier ? (e.updateInputs("opayoTokenId", l.cardIdentifier), e.updateInputs("opayoSessionKey", u), t.log("Tokenization succeeded.", {
52
+ hasCardIdentifier: !!l.cardIdentifier
53
+ }), n(!0)) : (e.addError(l.errors?.[0]?.message || "Tokenization failed."), t.warn("Tokenization failed.", l), n(!1));
54
+ }
55
+ });
56
+ } catch {
57
+ e.addError("Unable to parse merchant session response."), t.warn("Failed to parse merchant session response."), n(!1);
58
+ }
59
+ }).catch(() => {
60
+ e.addError("Network error. Please try again."), t.warn("Network error requesting merchant session."), n(!1);
61
+ });
62
+ });
63
+ },
64
+ setup: async (c) => {
65
+ const { services: a } = c;
66
+ c.target;
67
+ let e = null, d = !1;
68
+ const p = () => {
69
+ e?.parentNode && e.parentNode.removeChild(e), e = null;
70
+ }, g = a.events.onForm(k, ((s) => {
71
+ const r = s.detail?.data;
72
+ if (!r?.acsUrl || !r?.creq) return;
73
+ d = !1, t.log("Received payment challenge event.", {
74
+ hasAcsUrl: !!r.acsUrl,
75
+ hasCreq: !!r.creq
76
+ });
77
+ const h = a.form?.querySelector('input[name*="opayoSessionKey"]')?.value || "", n = document.createElement("div");
78
+ n.className = "formie-modal", n.id = `formie-opayo-dialog-${Math.random().toString(36).slice(2, 9)}`, n.innerHTML = `
79
+ <div class="formie-modal-backdrop" data-dialog-close></div>
80
+ <div class="formie-modal-content">
81
+ <div class="formie-loading formie-loading-large" style="--formie-loading-width: 3rem; --formie-loading-height: 3rem; top: 50%; margin-top: -1.5rem;"></div>
82
+ <iframe width="100%" height="100%" style="width: 100%; height: 100%; position: relative; z-index: 1;"></iframe>
83
+ </div>
84
+ `;
85
+ const i = n.querySelector("iframe"), o = (l) => l.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), S = r.returnUrl || r.redirectUrl || "", u = `<form action="${o(r.acsUrl)}" method="post">
86
+ <input type="hidden" name="creq" value="${o(r.creq || "")}" />
87
+ <input type="hidden" name="threeDSSessionData" value="${o(r.threeDSSessionData || "")}" />
88
+ <input type="hidden" name="MD" value="${o(h)}" />
89
+ <input type="hidden" name="TermUrl" value="${o(S)}" />
90
+ <input type="hidden" name="ThreeDSNotificationURL" value="${o(S)}" />
91
+ </form><script>document.forms[0].submit();<\/script>`;
92
+ p(), document.body.appendChild(n), e = n, i?.contentWindow && (i.contentWindow.document.open(), i.contentWindow.document.write(u), i.contentWindow.document.close());
93
+ })), m = (s) => {
94
+ if (s.data?.message === C) {
95
+ if (!e) {
96
+ t.log("Ignoring 3DS response without active dialog.");
97
+ return;
98
+ }
99
+ if (d) {
100
+ t.warn("Ignoring duplicate 3DS response while processing.");
101
+ return;
102
+ }
103
+ if (d = !0, t.log("Received payment challenge response message.", s.data?.value), p(), a.removeError(), s.data?.value?.error) {
104
+ a.addError(s.data.value.error.message), a.releaseSubmitLoading(), d = !1;
105
+ return;
106
+ }
107
+ a.updateInputs("opayo3DSComplete", s.data.value?.transactionId ?? ""), a.triggerSubmit();
108
+ }
109
+ };
110
+ return window.addEventListener("message", m), {
111
+ destroy: () => {
112
+ g(), window.removeEventListener("message", m), p(), d = !1;
113
+ }
114
+ };
115
+ },
116
+ onAfterSubmit: async ({ services: c }) => {
117
+ c.updateInputs(["opayoTokenId", "opayoSessionKey", "opayo3DSComplete"], "");
118
+ }
119
+ });
120
+ export {
121
+ R as opayoModule
122
+ };
@@ -0,0 +1,60 @@
1
+ import { u as l, v as u } from "./index-C1ZOKiAi.js";
2
+ import { l as c } from "./scripts-BkAAux0i.js";
3
+ const p = "FORMIE_PADDLE_SCRIPT", m = u("paddle", "initialize"), h = l({
4
+ id: "paddle",
5
+ defaultRequiredInputSuffixes: ["paddleCheckoutData"],
6
+ load: async () => null,
7
+ setup: async (d) => {
8
+ const { services: t } = d;
9
+ d.target;
10
+ const o = d.options.provider, n = o.clientSideToken;
11
+ if (!n?.trim())
12
+ return t.addError("Missing clientSideToken for Paddle."), {};
13
+ let a;
14
+ try {
15
+ a = await c("Paddle", {
16
+ id: p,
17
+ src: "https://cdn.paddle.com/paddle/v2/paddle.js"
18
+ }), a.Environment.set(o.environment || "production");
19
+ } catch (e) {
20
+ return t.addError(e instanceof Error ? e.message : "Failed to load Paddle SDK."), {};
21
+ }
22
+ a.Initialize({
23
+ token: n,
24
+ checkout: {
25
+ settings: {
26
+ displayMode: "overlay",
27
+ variant: "multi-page"
28
+ }
29
+ },
30
+ eventCallback: (e) => {
31
+ e.name === "checkout.completed" && (t.updateInputs("paddleCheckoutInit", ""), t.updateInputs("paddleCheckoutData", JSON.stringify(e.data || {})), setTimeout(() => {
32
+ a.Checkout.close(), t.triggerSubmit();
33
+ }, 500));
34
+ }
35
+ });
36
+ const i = (e) => {
37
+ if (!e?.items)
38
+ return t.addError("Missing Paddle checkout items."), !1;
39
+ try {
40
+ t.releaseSubmitLoading(), a.Checkout.open(e);
41
+ } catch (r) {
42
+ return t.addError(r instanceof Error ? r.message : "Unable to open Paddle checkout."), !1;
43
+ }
44
+ return !0;
45
+ }, s = t.events.onForm(m, ((e) => {
46
+ i(e.detail?.data);
47
+ }));
48
+ return {
49
+ destroy: () => {
50
+ s();
51
+ }
52
+ };
53
+ },
54
+ onAfterSubmit: async ({ services: d }) => {
55
+ d.updateInputs("paddleCheckoutInit", "true"), d.updateInputs("paddleCheckoutData", "");
56
+ }
57
+ });
58
+ export {
59
+ h as paddleModule
60
+ };
@@ -0,0 +1,100 @@
1
+ import { u as b } from "./index-C1ZOKiAi.js";
2
+ import { e as I } from "./styles-C3aqgtek.js";
3
+ import { l as v } from "./scripts-BkAAux0i.js";
4
+ const g = "@layer formie-theme{.formie-paypal-button{border:var(--formie-border-width) solid var(--formie-color-border);border-radius:var(--formie-radius-sm);background:var(--formie-color-surface);box-sizing:border-box;min-height:var(--formie-control-height);padding:var(--formie-space-2)}}";
5
+ I("paypal", [g]);
6
+ const A = "FORMIE_PAYPAL_SCRIPT";
7
+ function P(r) {
8
+ if (!r)
9
+ return "";
10
+ const a = (r.purchase_units || [])[0]?.payments || {}, e = a.authorizations || [], c = a.captures || [];
11
+ return String(e[0]?.id || c[0]?.id || "").trim();
12
+ }
13
+ function S(r, o) {
14
+ return `https://www.paypal.com/sdk/js?${[
15
+ "intent=authorize",
16
+ `currency=${encodeURIComponent(o)}`,
17
+ `client-id=${encodeURIComponent(r)}`
18
+ ].join("&")}`;
19
+ }
20
+ const U = b({
21
+ id: "paypal",
22
+ defaultRequiredInputSuffixes: ["paypalOrderId", "paypalAuthId"],
23
+ load: async (r) => {
24
+ const { provider: o } = r.options, a = o.clientId;
25
+ if (!a?.trim())
26
+ return console.error("[formie] Missing clientId for PayPal."), null;
27
+ const e = o.currency || "AUD", c = S(a, e);
28
+ return await v("paypal", {
29
+ id: A,
30
+ src: c
31
+ }), window.paypal;
32
+ },
33
+ mount: async (r) => {
34
+ const { api: o, field: a, services: e, options: c, provider: t } = r, i = a.querySelector("[data-formie-paypal-button]");
35
+ if (!i || !o || i.getAttribute("data-formie-paypal-rendered") === "true")
36
+ return null;
37
+ i.innerHTML = "";
38
+ const y = !!t.useSandbox, s = e.resolveCurrency({ value: t.currency, defaultCurrency: "AUD" });
39
+ if (!s.ok)
40
+ return e.addError("error" in s ? s.error : "Invalid PayPal currency."), null;
41
+ const m = s.value, l = {
42
+ layout: t.buttonLayout || "vertical",
43
+ color: t.buttonColor || "gold",
44
+ shape: t.buttonShape || "rect",
45
+ label: t.buttonLabel || "paypal",
46
+ width: t.buttonWidth || 250,
47
+ height: t.buttonHeight || 35
48
+ };
49
+ l.layout === "horizontal" && (l.tagline = t.buttonTagline ?? !0);
50
+ const f = {
51
+ env: y ? "sandbox" : "production",
52
+ style: l,
53
+ createOrder: (d, p) => {
54
+ e.removeError();
55
+ const n = e.resolveAmount({
56
+ type: t.amountType,
57
+ fixed: t.amountFixed,
58
+ variable: t.amountVariable
59
+ });
60
+ if (!n.ok) {
61
+ const u = "error" in n ? n.error : "Invalid PayPal amount.";
62
+ throw e.addError(u), new Error(u);
63
+ }
64
+ return p.order.create({
65
+ intent: "AUTHORIZE",
66
+ application_context: { user_action: "CONTINUE" },
67
+ purchase_units: [{
68
+ amount: {
69
+ currency_code: m,
70
+ value: String(n.value)
71
+ }
72
+ }]
73
+ });
74
+ },
75
+ onError: (d) => {
76
+ e.addError(d?.message || "PayPal error.");
77
+ },
78
+ onApprove: async (d, p) => {
79
+ try {
80
+ const n = await p.order.authorize(), u = P(n);
81
+ e.updateInputs("paypalOrderId", d.orderID), e.updateInputs("paypalAuthId", u || ""), u ? e.addSuccess("Payment authorized. Finalize the form to complete payment.") : e.addSuccess("PayPal approval received. Finalizing payment on submit.");
82
+ } catch {
83
+ e.addError("Unable to authorize payment. Please try again.");
84
+ }
85
+ }
86
+ }, h = o.Buttons(f);
87
+ return i.setAttribute("data-formie-paypal-rendered", "true"), h.render(i);
88
+ },
89
+ unmount: async (r) => {
90
+ r.widget?.close && r.widget.close();
91
+ const o = r.field.querySelector("[data-formie-paypal-button]");
92
+ o && (o.removeAttribute("data-formie-paypal-rendered"), o.innerHTML = "");
93
+ },
94
+ onAfterSubmit: async ({ services: r }) => {
95
+ r.updateInputs(["paypalOrderId", "paypalAuthId"], ""), r.removeSuccess(), r.removeError();
96
+ }
97
+ });
98
+ export {
99
+ U as paypalModule
100
+ };
@@ -0,0 +1,56 @@
1
+ import { u as y } from "./index-C1ZOKiAi.js";
2
+ import { e as u } from "./styles-C3aqgtek.js";
3
+ import { l as p } from "./scripts-BkAAux0i.js";
4
+ const f = "@layer formie-theme{.formie-payway-button{border:var(--formie-border-width) solid var(--formie-color-border);border-radius:var(--formie-radius-sm);background:var(--formie-color-surface);box-sizing:border-box;min-height:var(--formie-control-height);padding:var(--formie-space-2)}}";
5
+ u("payway", [f]);
6
+ const c = "FORMIE_PAYWAY_SCRIPT", h = y({
7
+ id: "payway",
8
+ defaultRequiredInputSuffixes: ["paywayTokenId"],
9
+ load: async (e) => {
10
+ const { provider: a } = e.options;
11
+ return a.publishableKey?.trim() ? (await p("payway", {
12
+ id: c,
13
+ src: "https://api.payway.com.au/rest/v1/payway.js"
14
+ }), null) : (console.error("[formie] Missing publishableKey for PayWay."), null);
15
+ },
16
+ mount: async (e) => {
17
+ const { field: a, services: r, options: o } = e, i = o.provider;
18
+ if (!a.querySelector("[data-formie-payway-button]"))
19
+ return null;
20
+ const t = window.payway;
21
+ return t ? new Promise((s) => {
22
+ t.createCreditCardFrame({
23
+ layout: "wide",
24
+ publishableApiKey: i.publishableKey || "",
25
+ tokenMode: "callback"
26
+ }, (d, l) => {
27
+ if (d || !l) {
28
+ r.addError(d?.message || "PayWay frame failed to load."), s(null);
29
+ return;
30
+ }
31
+ s(l);
32
+ });
33
+ }) : null;
34
+ },
35
+ unmount: async (e) => {
36
+ e.widget?.destroy();
37
+ },
38
+ onBeforeAuthorize: async (e) => {
39
+ const { widget: a, services: r } = e;
40
+ return a ? new Promise((o) => {
41
+ a.getToken((i, n) => {
42
+ if (i) {
43
+ r.addError(i.message), o(!1);
44
+ return;
45
+ }
46
+ n?.singleUseTokenId ? (r.updateInputs("paywayTokenId", n.singleUseTokenId), o(!0)) : (r.addError("Tokenization failed."), o(!1));
47
+ });
48
+ }) : (r.addError("PayWay card frame is not ready."), !1);
49
+ },
50
+ onAfterSubmit: async ({ services: e }) => {
51
+ e.updateInputs("paywayTokenId", "");
52
+ }
53
+ });
54
+ export {
55
+ h as paywayModule
56
+ };