@verbb/formie-browser 1.0.1 → 1.0.3
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 +16 -0
- package/dist/chunks/address-finder-BjMuEiwF.js +37 -0
- package/dist/chunks/bpoint-KudsBCo2.js +26 -0
- package/dist/chunks/calculations-DlGSkQ3W.js +147 -0
- package/dist/chunks/captcha-eu-CterYFok.js +34 -0
- package/dist/chunks/checkbox-radio-CBvgk3hR.js +136 -0
- package/dist/chunks/conditions-DYy1-Hwt.js +459 -0
- package/dist/chunks/date-picker-BlD--zfe.js +4994 -0
- package/dist/chunks/eway-qwc-B5Us.js +74 -0
- package/dist/chunks/file-upload-CIgHrXfp.js +316 -0
- package/dist/chunks/friendly-captcha-v1-EDFac33c.js +33 -0
- package/dist/chunks/friendly-captcha-v2-BDpSvFGR.js +38 -0
- package/dist/chunks/go-cardless-DuDMVsnz.js +24 -0
- package/dist/chunks/google-address-Bmjp01pH.js +181 -0
- package/dist/chunks/hcaptcha-BTQ6An6g.js +56 -0
- package/dist/chunks/hidden-DbPdOxKb.js +31 -0
- package/dist/chunks/index-BEsfee-D.js +1839 -0
- package/dist/chunks/index-BP7Unm5Y.js +863 -0
- package/dist/chunks/index-BcqwpPNE.js +4314 -0
- package/dist/chunks/loqate-BdNGv93o.js +55 -0
- package/dist/chunks/mollie-DFOjTuGX.js +24 -0
- package/dist/chunks/moneris-BbFfl-EL.js +101 -0
- package/dist/chunks/opayo-CmgYa9ya.js +122 -0
- package/dist/chunks/paddle-BUi7w1_o.js +60 -0
- package/dist/chunks/paypal-A-ePfh6k.js +100 -0
- package/dist/chunks/payway-BqFCbhyo.js +56 -0
- package/dist/chunks/phone-country-DPMiqk4L.js +3765 -0
- package/dist/chunks/place-kit-CX7tamAg.js +42 -0
- package/dist/chunks/placekit-autocomplete.esm-LAwfbPZl.js +1299 -0
- package/dist/chunks/recaptcha-enterprise-DxF6cW95.js +71 -0
- package/dist/chunks/recaptcha-shared-DhGcbiaq.js +15 -0
- package/dist/chunks/recaptcha-v2-checkbox-R9EfbZ4k.js +41 -0
- package/dist/chunks/recaptcha-v2-invisible-DV9hswAp.js +59 -0
- package/dist/chunks/recaptcha-v3-V0xc-Edh.js +28 -0
- package/dist/chunks/repeater-DKUT6TGI.js +124 -0
- package/dist/chunks/rich-text-SH7KiaKH.js +304 -0
- package/dist/chunks/scripts-D9N2d5rN.js +36 -0
- package/dist/chunks/sdk-3SicTWby.js +1559 -0
- package/dist/chunks/shared-BmntPmnW.js +80 -0
- package/dist/chunks/signature-BA3tQsGT.js +550 -0
- package/dist/chunks/snaptcha-DV7p6J9k.js +8 -0
- package/dist/chunks/square-Bs-ndqYK.js +46 -0
- package/dist/chunks/stripe-DkZAHxtn.js +202 -0
- package/dist/chunks/styles-C3aqgtek.js +21 -0
- package/dist/chunks/summary-Dq2i9TQk.js +126 -0
- package/dist/chunks/table-Cu4WfVcw.js +95 -0
- package/dist/chunks/text-limit-2ycmB-Ae.js +135 -0
- package/dist/chunks/turnstile-CId90tRr.js +59 -0
- package/dist/chunks/utils-BntI3W4S.js +6149 -0
- package/dist/css/theme/forms/_form.css +28 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -3205
- package/dist/js/compatibility/dom-adapter.d.ts +12 -0
- package/dist/js/compatibility/dom-adapter.d.ts.map +1 -0
- package/dist/js/compatibility/event-map.d.ts +25 -0
- package/dist/js/compatibility/event-map.d.ts.map +1 -0
- package/dist/js/compatibility/validator-adapter.d.ts +17 -0
- package/dist/js/compatibility/validator-adapter.d.ts.map +1 -0
- package/dist/js/contracts/client.d.ts +40 -0
- package/dist/js/contracts/client.d.ts.map +1 -0
- package/dist/js/contracts/common.d.ts +5 -0
- package/dist/js/contracts/common.d.ts.map +1 -0
- package/dist/js/contracts/modules.d.ts +47 -0
- package/dist/js/contracts/modules.d.ts.map +1 -0
- package/dist/js/contracts/schema.d.ts +79 -0
- package/dist/js/contracts/schema.d.ts.map +1 -0
- package/dist/js/contracts/theme.d.ts +2 -0
- package/dist/js/contracts/theme.d.ts.map +1 -0
- package/dist/js/core/create-formie-client.d.ts +3 -0
- package/dist/js/core/create-formie-client.d.ts.map +1 -0
- package/dist/js/core/dom-events.d.ts +2 -0
- package/dist/js/core/dom-events.d.ts.map +1 -0
- package/dist/js/core/formie.d.ts +27 -0
- package/dist/js/core/formie.d.ts.map +1 -0
- package/dist/js/core/hydrate-modules.d.ts +22 -0
- package/dist/js/core/hydrate-modules.d.ts.map +1 -0
- package/dist/js/core/page-client-event.d.ts +9 -0
- package/dist/js/core/page-client-event.d.ts.map +1 -0
- package/dist/js/core/page-tab-errors.d.ts +2 -0
- package/dist/js/core/page-tab-errors.d.ts.map +1 -0
- package/dist/js/core/submit-flow.d.ts +21 -0
- package/dist/js/core/submit-flow.d.ts.map +1 -0
- package/dist/js/core/submit-result-state.d.ts +8 -0
- package/dist/js/core/submit-result-state.d.ts.map +1 -0
- package/dist/js/core/submit-result-ui.d.ts +10 -0
- package/dist/js/core/submit-result-ui.d.ts.map +1 -0
- package/dist/js/events/event-bus.d.ts +21 -0
- package/dist/js/events/event-bus.d.ts.map +1 -0
- package/dist/js/modules/address/address-finder.d.ts +2 -0
- package/dist/js/modules/address/address-finder.d.ts.map +1 -0
- package/dist/js/modules/address/api.d.ts +8 -0
- package/dist/js/modules/address/api.d.ts.map +1 -0
- package/dist/js/modules/address/constants.d.ts +15 -0
- package/dist/js/modules/address/constants.d.ts.map +1 -0
- package/dist/js/modules/address/factories.d.ts +35 -0
- package/dist/js/modules/address/factories.d.ts.map +1 -0
- package/dist/js/modules/address/google-address.d.ts +9 -0
- package/dist/js/modules/address/google-address.d.ts.map +1 -0
- package/dist/js/modules/address/host.d.ts +30 -0
- package/dist/js/modules/address/host.d.ts.map +1 -0
- package/dist/js/modules/address/index.d.ts +3 -0
- package/dist/js/modules/address/index.d.ts.map +1 -0
- package/dist/js/modules/address/loqate.d.ts +2 -0
- package/dist/js/modules/address/loqate.d.ts.map +1 -0
- package/dist/js/modules/address/place-kit.d.ts +2 -0
- package/dist/js/modules/address/place-kit.d.ts.map +1 -0
- package/dist/js/modules/captchas/api.d.ts +9 -0
- package/dist/js/modules/captchas/api.d.ts.map +1 -0
- package/dist/js/modules/captchas/captcha-eu.d.ts +2 -0
- package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -0
- package/dist/js/modules/captchas/constants.d.ts +5 -0
- package/dist/js/modules/captchas/constants.d.ts.map +1 -0
- package/dist/js/modules/captchas/factories.d.ts +63 -0
- package/dist/js/modules/captchas/factories.d.ts.map +1 -0
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +2 -0
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -0
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +2 -0
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -0
- package/dist/js/modules/captchas/hcaptcha.d.ts +2 -0
- package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -0
- package/dist/js/modules/captchas/host.d.ts +78 -0
- package/dist/js/modules/captchas/host.d.ts.map +1 -0
- package/dist/js/modules/captchas/index.d.ts +3 -0
- package/dist/js/modules/captchas/index.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-shared.d.ts +26 -0
- package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-v3.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -0
- package/dist/js/modules/captchas/snaptcha.d.ts +2 -0
- package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -0
- package/dist/js/modules/captchas/turnstile.d.ts +2 -0
- package/dist/js/modules/captchas/turnstile.d.ts.map +1 -0
- package/dist/js/modules/captchas/utils.d.ts +13 -0
- package/dist/js/modules/captchas/utils.d.ts.map +1 -0
- package/dist/js/modules/fields/calculations.d.ts +3 -0
- package/dist/js/modules/fields/calculations.d.ts.map +1 -0
- package/dist/js/modules/fields/checkbox-radio.d.ts +3 -0
- package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/config.d.ts +5 -0
- package/dist/js/modules/fields/conditions/config.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/effects.d.ts +4 -0
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/evaluator.d.ts +6 -0
- package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/references.d.ts +5 -0
- package/dist/js/modules/fields/conditions/references.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/transforms.d.ts +3 -0
- package/dist/js/modules/fields/conditions/transforms.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/types.d.ts +30 -0
- package/dist/js/modules/fields/conditions/types.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/values.d.ts +5 -0
- package/dist/js/modules/fields/conditions/values.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions.d.ts +3 -0
- package/dist/js/modules/fields/conditions.d.ts.map +1 -0
- package/dist/js/modules/fields/date-picker.d.ts +3 -0
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -0
- package/dist/js/modules/fields/file-upload.d.ts +3 -0
- package/dist/js/modules/fields/file-upload.d.ts.map +1 -0
- package/dist/js/modules/fields/hidden.d.ts +3 -0
- package/dist/js/modules/fields/hidden.d.ts.map +1 -0
- package/dist/js/modules/fields/index.d.ts +3 -0
- package/dist/js/modules/fields/index.d.ts.map +1 -0
- package/dist/js/modules/fields/phone-country.d.ts +3 -0
- package/dist/js/modules/fields/phone-country.d.ts.map +1 -0
- package/dist/js/modules/fields/repeater.d.ts +3 -0
- package/dist/js/modules/fields/repeater.d.ts.map +1 -0
- package/dist/js/modules/fields/rich-text.d.ts +3 -0
- package/dist/js/modules/fields/rich-text.d.ts.map +1 -0
- package/dist/js/modules/fields/shared.d.ts +20 -0
- package/dist/js/modules/fields/shared.d.ts.map +1 -0
- package/dist/js/modules/fields/signature.d.ts +3 -0
- package/dist/js/modules/fields/signature.d.ts.map +1 -0
- package/dist/js/modules/fields/summary.d.ts +3 -0
- package/dist/js/modules/fields/summary.d.ts.map +1 -0
- package/dist/js/modules/fields/table.d.ts +3 -0
- package/dist/js/modules/fields/table.d.ts.map +1 -0
- package/dist/js/modules/fields/text-limit.d.ts +3 -0
- package/dist/js/modules/fields/text-limit.d.ts.map +1 -0
- package/dist/js/modules/loader.d.ts +11 -0
- package/dist/js/modules/loader.d.ts.map +1 -0
- package/dist/js/modules/payments/api.d.ts +8 -0
- package/dist/js/modules/payments/api.d.ts.map +1 -0
- package/dist/js/modules/payments/bpoint.d.ts +2 -0
- package/dist/js/modules/payments/bpoint.d.ts.map +1 -0
- package/dist/js/modules/payments/constants.d.ts +5 -0
- package/dist/js/modules/payments/constants.d.ts.map +1 -0
- package/dist/js/modules/payments/eway.d.ts +9 -0
- package/dist/js/modules/payments/eway.d.ts.map +1 -0
- package/dist/js/modules/payments/factories.d.ts +54 -0
- package/dist/js/modules/payments/factories.d.ts.map +1 -0
- package/dist/js/modules/payments/go-cardless.d.ts +2 -0
- package/dist/js/modules/payments/go-cardless.d.ts.map +1 -0
- package/dist/js/modules/payments/host.d.ts +70 -0
- package/dist/js/modules/payments/host.d.ts.map +1 -0
- package/dist/js/modules/payments/index.d.ts +3 -0
- package/dist/js/modules/payments/index.d.ts.map +1 -0
- package/dist/js/modules/payments/mollie.d.ts +2 -0
- package/dist/js/modules/payments/mollie.d.ts.map +1 -0
- package/dist/js/modules/payments/moneris.d.ts +2 -0
- package/dist/js/modules/payments/moneris.d.ts.map +1 -0
- package/dist/js/modules/payments/opayo.d.ts +25 -0
- package/dist/js/modules/payments/opayo.d.ts.map +1 -0
- package/dist/js/modules/payments/paddle.d.ts +2 -0
- package/dist/js/modules/payments/paddle.d.ts.map +1 -0
- package/dist/js/modules/payments/paypal.d.ts +2 -0
- package/dist/js/modules/payments/paypal.d.ts.map +1 -0
- package/dist/js/modules/payments/payway.d.ts +2 -0
- package/dist/js/modules/payments/payway.d.ts.map +1 -0
- package/dist/js/modules/payments/square.d.ts +2 -0
- package/dist/js/modules/payments/square.d.ts.map +1 -0
- package/dist/js/modules/payments/stripe.d.ts +2 -0
- package/dist/js/modules/payments/stripe.d.ts.map +1 -0
- package/dist/js/modules/payments/utils.d.ts +17 -0
- package/dist/js/modules/payments/utils.d.ts.map +1 -0
- package/dist/js/modules/registry.d.ts +9 -0
- package/dist/js/modules/registry.d.ts.map +1 -0
- package/dist/js/modules/styles.d.ts +2 -0
- package/dist/js/modules/styles.d.ts.map +1 -0
- package/dist/js/submit/pipeline.d.ts +18 -0
- package/dist/js/submit/pipeline.d.ts.map +1 -0
- package/dist/js/theme/theme-classes.d.ts +10 -0
- package/dist/js/theme/theme-classes.d.ts.map +1 -0
- package/dist/js/transport/forms-api.d.ts +11 -0
- package/dist/js/transport/forms-api.d.ts.map +1 -0
- package/dist/js/utils/async.d.ts +8 -0
- package/dist/js/utils/async.d.ts.map +1 -0
- package/dist/js/utils/debug.d.ts +10 -0
- package/dist/js/utils/debug.d.ts.map +1 -0
- package/dist/js/utils/event-names.d.ts +13 -0
- package/dist/js/utils/event-names.d.ts.map +1 -0
- package/dist/js/utils/field-references.d.ts +6 -0
- package/dist/js/utils/field-references.d.ts.map +1 -0
- package/dist/js/utils/field-references.keys.d.ts +4 -0
- package/dist/js/utils/field-references.keys.d.ts.map +1 -0
- package/dist/js/utils/field-references.parser.d.ts +3 -0
- package/dist/js/utils/field-references.parser.d.ts.map +1 -0
- package/dist/js/utils/field-references.registry.d.ts +3 -0
- package/dist/js/utils/field-references.registry.d.ts.map +1 -0
- package/dist/js/utils/field-references.resolver.d.ts +4 -0
- package/dist/js/utils/field-references.resolver.d.ts.map +1 -0
- package/dist/js/utils/field-references.types.d.ts +27 -0
- package/dist/js/utils/field-references.types.d.ts.map +1 -0
- package/dist/js/utils/fields.d.ts +5 -0
- package/dist/js/utils/fields.d.ts.map +1 -0
- package/dist/js/utils/http.d.ts +9 -0
- package/dist/js/utils/http.d.ts.map +1 -0
- package/dist/js/utils/i18n.d.ts +7 -0
- package/dist/js/utils/i18n.d.ts.map +1 -0
- package/dist/js/utils/scripts.d.ts +13 -0
- package/dist/js/utils/scripts.d.ts.map +1 -0
- package/dist/js/utils/unload-warning.d.ts +10 -0
- package/dist/js/utils/unload-warning.d.ts.map +1 -0
- package/dist/js/validation/rules/email.d.ts +4 -0
- package/dist/js/validation/rules/email.d.ts.map +1 -0
- package/dist/js/validation/rules/match.d.ts +4 -0
- package/dist/js/validation/rules/match.d.ts.map +1 -0
- package/dist/js/validation/rules/number.d.ts +4 -0
- package/dist/js/validation/rules/number.d.ts.map +1 -0
- package/dist/js/validation/rules/required.d.ts +4 -0
- package/dist/js/validation/rules/required.d.ts.map +1 -0
- package/dist/js/validation/rules/shared.d.ts +7 -0
- package/dist/js/validation/rules/shared.d.ts.map +1 -0
- package/dist/js/validation/rules/url.d.ts +4 -0
- package/dist/js/validation/rules/url.d.ts.map +1 -0
- package/dist/js/validation/rules.d.ts +10 -0
- package/dist/js/validation/rules.d.ts.map +1 -0
- package/dist/js/validation/scope.d.ts +6 -0
- package/dist/js/validation/scope.d.ts.map +1 -0
- package/dist/js/validation/submit-readiness.d.ts +4 -0
- package/dist/js/validation/submit-readiness.d.ts.map +1 -0
- package/dist/js/validation/types.d.ts +44 -0
- package/dist/js/validation/types.d.ts.map +1 -0
- package/dist/js/validation/validator.d.ts +54 -0
- package/dist/js/validation/validator.d.ts.map +1 -0
- package/package.json +3 -2
- package/src/css/theme/forms/_form.css +28 -0
- package/src/js/core/create-formie-client.ts +6 -0
- package/src/js/core/submit-result-state.ts +17 -0
- package/src/js/modules/address/google-address.ts +33 -1
- package/src/js/modules/fields/conditions/effects.ts +79 -2
- package/src/js/modules/fields/conditions.ts +53 -11
- package/src/js/modules/fields/file-upload.ts +189 -97
- package/src/js/modules/fields/repeater.ts +1 -1
- package/src/js/modules/fields/rich-text.ts +2 -2
- package/src/js/modules/fields/signature.ts +1 -1
- package/src/js/modules/fields/summary.ts +1 -1
- package/src/js/modules/fields/table.ts +1 -1
- package/src/js/modules/fields/text-limit.ts +1 -1
- package/src/js/modules/payments/paypal.ts +1 -1
- package/src/js/modules/payments/payway.ts +1 -1
- package/src/js/modules/payments/stripe.ts +1 -1
- package/src/js/submit/pipeline.ts +3 -28
- package/src/js/validation/scope.ts +25 -0
- package/src/js/validation/submit-readiness.ts +157 -0
- package/src/js/validation/validator.ts +4 -0
- package/dist/chunks/address-finder-DfMCiW89.js +0 -47
- package/dist/chunks/api-CbqEMQT5.js +0 -181
- package/dist/chunks/api-DE7LfK-R.js +0 -960
- package/dist/chunks/api-DOfDzYC_.js +0 -538
- package/dist/chunks/async-B3DUf1GZ.js +0 -26
- package/dist/chunks/bpoint-Ciy3yY9Q.js +0 -34
- package/dist/chunks/calculations-CkYAqO_-.js +0 -197
- package/dist/chunks/captcha-eu-DnOWhMwr.js +0 -43
- package/dist/chunks/checkbox-radio-0x7Tc0br.js +0 -197
- package/dist/chunks/chunk-K6L4z4UQ.js +0 -24
- package/dist/chunks/conditions-4fXKhEJS.js +0 -609
- package/dist/chunks/date-picker-B6iZkjHS.js +0 -6204
- package/dist/chunks/debug-KnZeKYBI.js +0 -39
- package/dist/chunks/dist-D09GnXMW.js +0 -2663
- package/dist/chunks/event-names-DamGPtXR.js +0 -51
- package/dist/chunks/eway-DEAYcwT0.js +0 -86
- package/dist/chunks/field-references.keys-BpBZ_quS.js +0 -24
- package/dist/chunks/field-references.resolver-Ba6xhiJC.js +0 -183
- package/dist/chunks/file-upload-BIj85NFH.js +0 -428
- package/dist/chunks/friendly-captcha-v1-CqO4WVre.js +0 -40
- package/dist/chunks/friendly-captcha-v2-CyykcJcM.js +0 -47
- package/dist/chunks/friendly-challenge-Dg8XkStd.js +0 -1101
- package/dist/chunks/go-cardless-CuND59rR.js +0 -26
- package/dist/chunks/google-address--uR8WDSm.js +0 -208
- package/dist/chunks/hcaptcha-CmaFUesv.js +0 -72
- package/dist/chunks/hidden-CYnZYple.js +0 -36
- package/dist/chunks/http-18nn97DZ.js +0 -29
- package/dist/chunks/i18n-vUh-KGiH.js +0 -55
- package/dist/chunks/loqate-BICNJlVK.js +0 -97
- package/dist/chunks/mollie-DwlsgHZ1.js +0 -26
- package/dist/chunks/moneris-B_IFZFTx.js +0 -159
- package/dist/chunks/opayo-U2x_TOII.js +0 -192
- package/dist/chunks/paddle-BqXFrc79.js +0 -75
- package/dist/chunks/paypal-VowQ3ilP.js +0 -121
- package/dist/chunks/payway-VOO-ajyg.js +0 -75
- package/dist/chunks/phone-country-B6Me4lK0.js +0 -3317
- package/dist/chunks/place-kit-ldUl-u9w.js +0 -56
- package/dist/chunks/placekit-autocomplete.esm-D-lGeaZl.js +0 -1771
- package/dist/chunks/recaptcha-enterprise-DPJNyv1X.js +0 -72
- package/dist/chunks/recaptcha-shared-DTI4qWVR.js +0 -22
- package/dist/chunks/recaptcha-v2-checkbox-zFjpvJ5c.js +0 -49
- package/dist/chunks/recaptcha-v2-invisible-CnYtkNvz.js +0 -62
- package/dist/chunks/recaptcha-v3-EAlWhnkX.js +0 -33
- package/dist/chunks/repeater-BPm7Mkyn.js +0 -149
- package/dist/chunks/rich-text-CHSly1Hq.js +0 -438
- package/dist/chunks/scripts-BGD_iU_6.js +0 -41
- package/dist/chunks/sdk-B7u9fTlP.js +0 -2103
- package/dist/chunks/shared-DC6_1u8X.js +0 -85
- package/dist/chunks/signature-DNMCgrMd.js +0 -763
- package/dist/chunks/snaptcha-CCDunGeb.js +0 -8
- package/dist/chunks/square-BLqK51rS.js +0 -61
- package/dist/chunks/stripe-B6ZcDQdx.js +0 -273
- package/dist/chunks/styles-BIh6g7V_.js +0 -22
- package/dist/chunks/summary-BTG0uIOt.js +0 -189
- package/dist/chunks/table-BTYc0Qm8.js +0 -122
- package/dist/chunks/text-limit-CgBMu4sJ.js +0 -177
- package/dist/chunks/theme-classes-vSHpdCUO.js +0 -59
- package/dist/chunks/turnstile-DP0bdR7T.js +0 -68
- package/dist/chunks/utils-ByrEVYrJ.js +0 -49584
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { d as p, A as d } from "./index-BcqwpPNE.js";
|
|
2
|
+
import { l as y } from "./scripts-D9N2d5rN.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-BcqwpPNE.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-BcqwpPNE.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-BcqwpPNE.js";
|
|
2
|
+
import { l as E } from "./scripts-D9N2d5rN.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, "&").replace(/"/g, """).replace(/</g, "<"), 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-BcqwpPNE.js";
|
|
2
|
+
import { l as c } from "./scripts-D9N2d5rN.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-BcqwpPNE.js";
|
|
2
|
+
import { e as I } from "./styles-C3aqgtek.js";
|
|
3
|
+
import { l as v } from "./scripts-D9N2d5rN.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-BcqwpPNE.js";
|
|
2
|
+
import { e as u } from "./styles-C3aqgtek.js";
|
|
3
|
+
import { l as p } from "./scripts-D9N2d5rN.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
|
+
};
|