@justifi/webcomponents 6.0.0 → 6.0.1-rc.0

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 (232) hide show
  1. package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.js +2 -2
  2. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  3. package/dist/cjs/card-form.cjs.entry.js +2 -2
  4. package/dist/cjs/{check-pkg-version-7FBAUhHw.js → check-pkg-version-B48ZmuJS.js} +1 -1
  5. package/dist/cjs/checkouts-list-core.cjs.entry.js +1 -1
  6. package/dist/cjs/form-alert_5.cjs.entry.js +4 -4
  7. package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
  8. package/dist/cjs/form-control-monetary-provisioning.cjs.entry.js +2 -2
  9. package/dist/cjs/form-control-number-masked_2.cjs.entry.js +1 -1
  10. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  11. package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +9 -9
  12. package/dist/cjs/justifi-apple-pay.cjs.entry.js +1 -1
  13. package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +6 -6
  14. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +1 -1
  17. package/dist/cjs/justifi-checkout-summary_7.cjs.entry.js +15 -7
  18. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
  19. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +1 -1
  20. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
  21. package/dist/cjs/justifi-details.cjs.entry.js +1 -1
  22. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  24. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  25. package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
  26. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +3 -3
  27. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  28. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +1 -1
  29. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +3 -3
  30. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
  31. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  32. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  33. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
  34. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  35. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  36. package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +1 -1
  37. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  38. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
  39. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  40. package/dist/cjs/loader.cjs.js +1 -1
  41. package/dist/cjs/{package-BNN5fdIc.js → package-C3FMDKcV.js} +1 -1
  42. package/dist/cjs/pagination-menu.cjs.entry.js +3 -3
  43. package/dist/cjs/webcomponents.cjs.js +1 -1
  44. package/dist/collection/api/services/apple-pay.service.js +1 -1
  45. package/dist/collection/collection-manifest.json +1 -1
  46. package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +6 -6
  47. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +1 -1
  48. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +6 -6
  49. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +6 -6
  50. package/dist/collection/components/business-forms/owner-form/identity-address/identity-address-form.js +1 -1
  51. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +1 -1
  52. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +6 -6
  53. package/dist/collection/components/business-forms/owner-form/owner-form.js +1 -1
  54. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +1 -1
  55. package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-document-inputs.js +1 -1
  56. package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-form-inputs.js +1 -1
  57. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +1 -1
  58. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
  59. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +1 -1
  60. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +1 -1
  61. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +1 -1
  62. package/dist/collection/components/business-forms/payment-provisioning/form-control-monetary-provisioning.js +2 -2
  63. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +1 -1
  64. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-core.js +1 -1
  65. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-buttons.js +1 -1
  66. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +1 -1
  67. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +1 -1
  68. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +1 -1
  69. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +2 -2
  70. package/dist/collection/components/checkout/card-form/card-form.js +2 -2
  71. package/dist/collection/components/checkout/checkout.js +2 -2
  72. package/dist/collection/components/checkout/save-new-payment-method.js +1 -1
  73. package/dist/collection/components/checkout/saved-payment-method.js +1 -1
  74. package/dist/collection/components/checkouts-list/checkouts-list-core.js +1 -1
  75. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +1 -1
  76. package/dist/collection/components/checkouts-list/checkouts-list.js +1 -1
  77. package/dist/collection/components/modular-checkout/modular-checkout.js +15 -8
  78. package/dist/collection/components/modular-checkout/sub-components/bank-account-billing-form-simple.js +1 -1
  79. package/dist/collection/components/modular-checkout/sub-components/card-billing-form-simple.js +1 -1
  80. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +2 -3
  81. package/dist/collection/ui-components/details/details.js +1 -1
  82. package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
  83. package/dist/collection/ui-components/pagination-menu/pagination-menu.js +3 -3
  84. package/dist/collection/ui-components/shadow-dom-components/justifi-radio-list-item.js +1 -1
  85. package/dist/docs.json +18 -97
  86. package/dist/esm/bank-account-document-form-inputs_4.entry.js +2 -2
  87. package/dist/esm/bank-account-form.entry.js +2 -2
  88. package/dist/esm/card-form.entry.js +2 -2
  89. package/dist/esm/{check-pkg-version-BUkwdVdm.js → check-pkg-version-DSO4z-Vx.js} +1 -1
  90. package/dist/esm/checkouts-list-core.entry.js +1 -1
  91. package/dist/esm/form-alert_5.entry.js +4 -4
  92. package/dist/esm/form-control-checkbox.entry.js +2 -2
  93. package/dist/esm/form-control-monetary-provisioning.entry.js +2 -2
  94. package/dist/esm/form-control-number-masked_2.entry.js +1 -1
  95. package/dist/esm/hidden-input_2.entry.js +1 -1
  96. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +9 -9
  97. package/dist/esm/justifi-apple-pay.entry.js +1 -1
  98. package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +6 -6
  99. package/dist/esm/justifi-business-details.entry.js +2 -2
  100. package/dist/esm/justifi-business-form.entry.js +2 -2
  101. package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
  102. package/dist/esm/justifi-checkout-summary_7.entry.js +15 -7
  103. package/dist/esm/justifi-checkout.entry.js +4 -4
  104. package/dist/esm/justifi-checkouts-list-filters.entry.js +1 -1
  105. package/dist/esm/justifi-checkouts-list.entry.js +3 -3
  106. package/dist/esm/justifi-details.entry.js +1 -1
  107. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  108. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  109. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  110. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  111. package/dist/esm/justifi-owner-form_3.entry.js +3 -3
  112. package/dist/esm/justifi-payment-details.entry.js +2 -2
  113. package/dist/esm/justifi-payment-provisioning-core.entry.js +1 -1
  114. package/dist/esm/justifi-payment-provisioning.entry.js +3 -3
  115. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  116. package/dist/esm/justifi-payments-list.entry.js +2 -2
  117. package/dist/esm/justifi-payout-details.entry.js +2 -2
  118. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  119. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  120. package/dist/esm/justifi-refund-payment.entry.js +2 -2
  121. package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
  122. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  123. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  124. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  125. package/dist/esm/loader.js +1 -1
  126. package/dist/esm/{package-BBpkkt2-.js → package-tyhA5jkt.js} +1 -1
  127. package/dist/esm/pagination-menu.entry.js +3 -3
  128. package/dist/esm/webcomponents.js +1 -1
  129. package/dist/module/additional-questions.js +2 -2
  130. package/dist/module/bank-account-billing-form-simple.js +1 -1
  131. package/dist/module/bank-account-document-inputs.js +1 -1
  132. package/dist/module/bank-account-form-inputs2.js +1 -1
  133. package/dist/module/bank-account-form.js +2 -2
  134. package/dist/module/business-additional-questions-form-step.js +1 -1
  135. package/dist/module/business-bank-account-form-step.js +1 -1
  136. package/dist/module/business-core-info-form-step.js +1 -1
  137. package/dist/module/business-core-info.js +1 -1
  138. package/dist/module/business-owners-form-step.js +1 -1
  139. package/dist/module/business-representative-form-inputs.js +1 -1
  140. package/dist/module/business-representative-form-step.js +1 -1
  141. package/dist/module/business-representative.js +2 -2
  142. package/dist/module/business-terms-conditions-form-step.js +1 -1
  143. package/dist/module/card-billing-form-simple.js +1 -1
  144. package/dist/module/card-form.js +2 -2
  145. package/dist/module/checkouts-list-core2.js +1 -1
  146. package/dist/module/details.js +1 -1
  147. package/dist/module/form-control-checkbox2.js +2 -2
  148. package/dist/module/form-control-monetary-provisioning2.js +2 -2
  149. package/dist/module/identity-address-form.js +1 -1
  150. package/dist/module/justifi-apple-pay.js +1 -1
  151. package/dist/module/justifi-checkout.js +2 -2
  152. package/dist/module/justifi-checkouts-list-filters.js +1 -1
  153. package/dist/module/justifi-checkouts-list.js +1 -1
  154. package/dist/module/justifi-payment-provisioning.js +1 -1
  155. package/dist/module/justifi-radio-list-item2.js +1 -1
  156. package/dist/module/justifi-saved-payment-method.js +1 -1
  157. package/dist/module/legal-address-form-step.js +1 -1
  158. package/dist/module/legal-address-form.js +2 -2
  159. package/dist/module/modular-checkout.js +13 -5
  160. package/dist/module/owner-form-core2.js +1 -1
  161. package/dist/module/owner-form-inputs2.js +2 -2
  162. package/dist/module/owner-form.js +1 -1
  163. package/dist/module/package.js +1 -1
  164. package/dist/module/pagination-menu2.js +3 -3
  165. package/dist/module/payment-provisioning-core.js +1 -1
  166. package/dist/module/payment-provisioning-form-buttons.js +1 -1
  167. package/dist/module/payment-provisioning-form-steps.js +1 -1
  168. package/dist/module/save-new-payment-method.js +1 -1
  169. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +1 -1
  170. package/dist/types/components.d.ts +8 -10
  171. package/dist/webcomponents/{p-3152c84f.entry.js → p-037d7061.entry.js} +1 -1
  172. package/dist/webcomponents/{p-265d0a1d.entry.js → p-070c29ce.entry.js} +1 -1
  173. package/dist/webcomponents/{p-44e32f85.entry.js → p-10278c48.entry.js} +1 -1
  174. package/dist/webcomponents/p-19ccbeee.entry.js +1 -0
  175. package/dist/webcomponents/{p-9c4079cc.entry.js → p-1b3b6956.entry.js} +1 -1
  176. package/dist/webcomponents/p-1c433962.entry.js +1 -0
  177. package/dist/webcomponents/{p-a7e40e91.entry.js → p-1d7139d3.entry.js} +1 -1
  178. package/dist/webcomponents/{p-d7555ff1.entry.js → p-214fa6e0.entry.js} +1 -1
  179. package/dist/webcomponents/p-2d818d44.entry.js +1 -0
  180. package/dist/webcomponents/{p-17f7590c.entry.js → p-30147031.entry.js} +1 -1
  181. package/dist/webcomponents/{p-f7690165.entry.js → p-4215ea76.entry.js} +1 -1
  182. package/dist/webcomponents/{p-7cb6cc9f.entry.js → p-4b1abc3b.entry.js} +1 -1
  183. package/dist/webcomponents/p-4d5c71c4.entry.js +1 -0
  184. package/dist/webcomponents/p-62a16ef9.entry.js +1 -0
  185. package/dist/webcomponents/p-65286b2b.entry.js +1 -0
  186. package/dist/webcomponents/{p-f99e4566.entry.js → p-6af851c5.entry.js} +1 -1
  187. package/dist/webcomponents/{p-2a43e77f.entry.js → p-6d4ae6c7.entry.js} +1 -1
  188. package/dist/webcomponents/p-7494c1b6.entry.js +1 -0
  189. package/dist/webcomponents/p-8018523d.entry.js +1 -0
  190. package/dist/webcomponents/{p-bc3cdc7b.entry.js → p-83fa6da1.entry.js} +1 -1
  191. package/dist/webcomponents/p-84ccc7bb.entry.js +1 -0
  192. package/dist/webcomponents/p-8975bf93.entry.js +1 -0
  193. package/dist/webcomponents/{p-9fc464eb.entry.js → p-9046afd6.entry.js} +1 -1
  194. package/dist/webcomponents/{p-a928c6fb.entry.js → p-914e168d.entry.js} +1 -1
  195. package/dist/webcomponents/p-91c1e2ac.entry.js +1 -0
  196. package/dist/webcomponents/{p-146de253.entry.js → p-9f04cac4.entry.js} +1 -1
  197. package/dist/webcomponents/{p-D_5McRD_.js → p-CtA2NMVz.js} +1 -1
  198. package/dist/webcomponents/{p-82781411.entry.js → p-a0909318.entry.js} +1 -1
  199. package/dist/webcomponents/p-a57c1400.entry.js +1 -0
  200. package/dist/webcomponents/p-a85cf3e0.entry.js +1 -0
  201. package/dist/webcomponents/{p-005efe51.entry.js → p-bb03a95a.entry.js} +1 -1
  202. package/dist/webcomponents/{p-3e320c0d.entry.js → p-d2259dfd.entry.js} +1 -1
  203. package/dist/webcomponents/{p-7e04d5af.entry.js → p-d8e5d7b7.entry.js} +1 -1
  204. package/dist/webcomponents/{p-c70e1aac.entry.js → p-df385efe.entry.js} +1 -1
  205. package/dist/webcomponents/p-df7f36aa.entry.js +1 -0
  206. package/dist/webcomponents/p-e035a92e.entry.js +1 -0
  207. package/dist/webcomponents/p-e628a0c8.entry.js +1 -0
  208. package/dist/webcomponents/{p-c262d10f.entry.js → p-e7edf4f4.entry.js} +1 -1
  209. package/dist/webcomponents/p-eafd179b.entry.js +1 -0
  210. package/dist/webcomponents/{p-f8cbcbe9.entry.js → p-ffe01f1b.entry.js} +1 -1
  211. package/dist/webcomponents/p-tyhA5jkt.js +1 -0
  212. package/dist/webcomponents/webcomponents.esm.js +1 -1
  213. package/package.json +13 -13
  214. package/LICENSE +0 -21
  215. package/dist/webcomponents/p-0142114f.entry.js +0 -1
  216. package/dist/webcomponents/p-0d8fe5f2.entry.js +0 -1
  217. package/dist/webcomponents/p-20f036cc.entry.js +0 -1
  218. package/dist/webcomponents/p-25484e99.entry.js +0 -1
  219. package/dist/webcomponents/p-30c414b5.entry.js +0 -1
  220. package/dist/webcomponents/p-3906296f.entry.js +0 -1
  221. package/dist/webcomponents/p-5c3d8de5.entry.js +0 -1
  222. package/dist/webcomponents/p-6fdc03bc.entry.js +0 -1
  223. package/dist/webcomponents/p-7b103dad.entry.js +0 -1
  224. package/dist/webcomponents/p-8467851a.entry.js +0 -1
  225. package/dist/webcomponents/p-8d3f5638.entry.js +0 -1
  226. package/dist/webcomponents/p-9d7b5d07.entry.js +0 -1
  227. package/dist/webcomponents/p-BBpkkt2-.js +0 -1
  228. package/dist/webcomponents/p-b90999af.entry.js +0 -1
  229. package/dist/webcomponents/p-cecb65c4.entry.js +0 -1
  230. package/dist/webcomponents/p-df329742.entry.js +0 -1
  231. package/dist/webcomponents/p-ea2a9a81.entry.js +0 -1
  232. package/dist/webcomponents/p-f6fbd43d.entry.js +0 -1
@@ -23,7 +23,7 @@ const PaymentProvisioningFormButtons = /*@__PURE__*/ proxyCustomElement(class Pa
23
23
  return this.currentStep === this.totalSteps;
24
24
  }
25
25
  render() {
26
- return (h("div", { key: '5869ed8c350e3a1ae5fe62dcd04493f432eecff7', class: 'd-flex gap-2' }, h(Button, { key: 'b1e8c2fff97e9a053d715860a43ddd78c99b255a', variant: "secondary", type: "button", onClick: () => this.previousStepButtonOnClick(), disabled: this.formDisabled, hidden: !this.showPreviousStepButton }, "Previous"), h(Button, { key: '8696fe4f0bde5434e51f05f67b39a8e5b2f550bf', variant: "primary", type: "button", onClick: (e) => this.nextStepButtonOnClick(e, BusinessFormClickActions.nextStep), disabled: this.formDisabled, isLoading: this.formLoading, hidden: !this.showNextStepButton }, "Next"), h(Button, { key: 'b1750a849d60244bdb3cf82690c6cbd15b6e1110', variant: "primary", type: "submit", onClick: (e) => this.nextStepButtonOnClick(e, BusinessFormClickActions.submit), disabled: this.formDisabled, isLoading: this.formLoading, hidden: !this.showSubmitButton }, "Submit")));
26
+ return (h("div", { key: 'cc744b394b8a75f2cf6b551f50376d16eb4f053b', class: 'd-flex gap-2' }, h(Button, { key: 'b83498b5bd052607803159acc593ed3f53c8cd4f', variant: "secondary", type: "button", onClick: () => this.previousStepButtonOnClick(), disabled: this.formDisabled, hidden: !this.showPreviousStepButton }, "Previous"), h(Button, { key: '02f6dfacedd16c2a82879bf13706bf554372064c', variant: "primary", type: "button", onClick: (e) => this.nextStepButtonOnClick(e, BusinessFormClickActions.nextStep), disabled: this.formDisabled, isLoading: this.formLoading, hidden: !this.showNextStepButton }, "Next"), h(Button, { key: 'eda937677c7e1d5a64f88d020ba4c738bc89af68', variant: "primary", type: "submit", onClick: (e) => this.nextStepButtonOnClick(e, BusinessFormClickActions.submit), disabled: this.formDisabled, isLoading: this.formLoading, hidden: !this.showSubmitButton }, "Submit")));
27
27
  }
28
28
  }, [256, "justifi-payment-provisioning-form-buttons", {
29
29
  "currentStep": [2, "current-step"],
@@ -51,7 +51,7 @@ const PaymentProvisioningFormSteps = /*@__PURE__*/ proxyCustomElement(class Paym
51
51
  return this.componentStepMapping[this.currentStep]();
52
52
  }
53
53
  render() {
54
- return (h("div", { key: '9a09e562d0a3548cb40863ba5780c5d1692b6ec3', class: 'col-12 mb-4' }, this.currentStepComponent));
54
+ return (h("div", { key: 'bc4e1cd4a04dc6f0d9338fa737b91fe1628ed2b3', class: 'col-12 mb-4' }, this.currentStepComponent));
55
55
  }
56
56
  }, [256, "justifi-payment-provisioning-form-steps", {
57
57
  "businessId": [1, "business-id"],
@@ -23,7 +23,7 @@ const SaveNewPaymentMethod = /*@__PURE__*/ proxyCustomElement(class SaveNewPayme
23
23
  };
24
24
  }
25
25
  render() {
26
- return (h(StyledHost, { key: 'c3808f4373067144ded9db353e48fe9cd3df59bc' }, h("form-control-checkbox", { key: '2f104a35497fdc1397c014c4c4ed646f7b389239', label: this.label || 'Save New Payment Method', name: "saveNewPaymentMethod", checked: this.isChecked, inputHandler: this.handleCheckboxChange })));
26
+ return (h(StyledHost, { key: '0ac7e7b80c9a00737eed4f9345020994eb5d92bf' }, h("form-control-checkbox", { key: '3396c0a413c3d498d7cdccc12ad97739d97f74c8', label: this.label || 'Save New Payment Method', name: "saveNewPaymentMethod", checked: this.isChecked, inputHandler: this.handleCheckboxChange })));
27
27
  }
28
28
  }, [257, "justifi-save-new-payment-method", {
29
29
  "label": [1],
@@ -26,8 +26,8 @@ export declare const businessFormSchema: import("yup").ObjectSchema<{
26
26
  country?: string;
27
27
  };
28
28
  title?: string;
29
- ssn_last4?: string;
30
29
  name?: string;
30
+ ssn_last4?: string;
31
31
  email?: string;
32
32
  phone?: string;
33
33
  dob_full?: string;
@@ -11,12 +11,11 @@ import { ComponentClickEvent, ComponentErrorEvent, ComponentFormStepCompleteEven
11
11
  import { Placement, PositioningStrategy } from "@popperjs/core";
12
12
  import { EntityDocumentType, FileSelectEvent as FileSelectEvent1 } from "./api/Document";
13
13
  import { IPaymentMethodMetadata } from "./api/PaymentMethod";
14
- import { BillingFormFields as BillingFormFields1, FormController } from "./components";
15
14
  import { DisputeEvidenceDocument } from "./api/DisputeEvidenceDocument";
16
15
  import { DisputeResponseFormStep } from "./components/dispute-management/dispute-response/dispute-response-form-types";
17
16
  import { ApplePayButtonStyle, ApplePayButtonType, IApplePayToken } from "./api/ApplePay";
18
17
  import { BillingFormFields } from "./components/checkout/billing-form/billing-form-schema";
19
- import { FormController as FormController1 } from "./ui-components/form/form";
18
+ import { FormController } from "./ui-components/form/form";
20
19
  import { Dispute, IDispute } from "./api/Dispute";
21
20
  import { CheckoutChangedEventDetail, SelectedPaymentMethod } from "./components/modular-checkout/ModularCheckout";
22
21
  import { PaymentMethodPayload } from "./components/checkout/payment-method-payload";
@@ -29,12 +28,11 @@ export { ComponentClickEvent, ComponentErrorEvent, ComponentFormStepCompleteEven
29
28
  export { Placement, PositioningStrategy } from "@popperjs/core";
30
29
  export { EntityDocumentType, FileSelectEvent as FileSelectEvent1 } from "./api/Document";
31
30
  export { IPaymentMethodMetadata } from "./api/PaymentMethod";
32
- export { BillingFormFields as BillingFormFields1, FormController } from "./components";
33
31
  export { DisputeEvidenceDocument } from "./api/DisputeEvidenceDocument";
34
32
  export { DisputeResponseFormStep } from "./components/dispute-management/dispute-response/dispute-response-form-types";
35
33
  export { ApplePayButtonStyle, ApplePayButtonType, IApplePayToken } from "./api/ApplePay";
36
34
  export { BillingFormFields } from "./components/checkout/billing-form/billing-form-schema";
37
- export { FormController as FormController1 } from "./ui-components/form/form";
35
+ export { FormController } from "./ui-components/form/form";
38
36
  export { Dispute, IDispute } from "./api/Dispute";
39
37
  export { CheckoutChangedEventDetail, SelectedPaymentMethod } from "./components/modular-checkout/ModularCheckout";
40
38
  export { PaymentMethodPayload } from "./components/checkout/payment-method-payload";
@@ -362,7 +360,7 @@ export namespace Components {
362
360
  * and the other one is meant to be just read only.
363
361
  */
364
362
  interface JustifiBusinessCoreInfo {
365
- "formController": FormController1;
363
+ "formController": FormController;
366
364
  }
367
365
  interface JustifiBusinessCoreInfoFormStep {
368
366
  "allowOptionalFields"?: boolean;
@@ -416,7 +414,7 @@ export namespace Components {
416
414
  }
417
415
  interface JustifiBusinessRepresentativeFormInputs {
418
416
  "errors": any;
419
- "formController": FormController1;
417
+ "formController": FormController;
420
418
  "representativeDefaultValue": any;
421
419
  }
422
420
  interface JustifiBusinessRepresentativeFormStep {
@@ -636,7 +634,7 @@ export namespace Components {
636
634
  "authToken": string;
637
635
  "checkoutId": string;
638
636
  "setSelectedPaymentMethod": (paymentMethod: SelectedPaymentMethod) => Promise<void>;
639
- "submitCheckout": (submitCheckoutArgs?: BillingFormFields1) => Promise<void>;
637
+ "submitCheckout": (submitCheckoutArgs?: BillingFormFields) => Promise<void>;
640
638
  "validate": () => Promise<boolean>;
641
639
  }
642
640
  interface JustifiOrderTerminals {
@@ -889,7 +887,7 @@ export namespace Components {
889
887
  "authToken"?: string;
890
888
  "disableBankAccount"?: boolean;
891
889
  "disableCreditCard"?: boolean;
892
- "fillBillingForm": (fields: BillingFormFields1) => Promise<void>;
890
+ "fillBillingForm": (fields: BillingFormFields) => Promise<void>;
893
891
  "hideBankAccountBillingForm"?: boolean;
894
892
  "hideCardBillingForm"?: boolean;
895
893
  "hideSubmitButton"?: boolean;
@@ -3315,7 +3313,7 @@ declare namespace LocalJSX {
3315
3313
  * and the other one is meant to be just read only.
3316
3314
  */
3317
3315
  interface JustifiBusinessCoreInfo {
3318
- "formController"?: FormController1;
3316
+ "formController"?: FormController;
3319
3317
  }
3320
3318
  interface JustifiBusinessCoreInfoFormStep {
3321
3319
  "allowOptionalFields"?: boolean;
@@ -3378,7 +3376,7 @@ declare namespace LocalJSX {
3378
3376
  }
3379
3377
  interface JustifiBusinessRepresentativeFormInputs {
3380
3378
  "errors"?: any;
3381
- "formController"?: FormController1;
3379
+ "formController"?: FormController;
3382
3380
  "representativeDefaultValue"?: any;
3383
3381
  }
3384
3382
  interface JustifiBusinessRepresentativeFormStep {
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as p,a as c}from"./p-D2muobcE.js";import{c as a,J as n}from"./p-D_5McRD_.js";import{C as h}from"./p-BY2p6Sxk.js";import{m,S as u}from"./p-C1xGBPma.js";import{S as d}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{d as j}from"./p-CzPUMw00.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-BBpkkt2-.js";import"./p-BUa0YOaw.js";import"./p-D--yCspA.js";import"./p-RvUQ__Pq.js";const f=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=j,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){a(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:i})=>async({params:r,onSuccess:a,onError:n})=>{var h,m;try{const u=await i.fetchCheckouts(t,s,r);if(u.error)return n({error:c(u.error),code:p(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);a({checkouts:(null===(h=u.data)||void 0===h?void 0:h.map((t=>new e(t))))||[],pagingInfo:t})}}catch(t){const s=p(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:o.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new h}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u}))}render(){return i(d,{key:"41bf633467138b6af13b1c02ccf1e1016ec54bfe"},i("checkouts-list-core",{key:"cd3ca431258ad73e701fe74612ecdf2c0f2a1bda",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_checkouts_list}
1
+ import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as p,a as c}from"./p-D2muobcE.js";import{c as a,J as n}from"./p-CtA2NMVz.js";import{C as h}from"./p-BY2p6Sxk.js";import{m,S as u}from"./p-C1xGBPma.js";import{S as d}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{d as j}from"./p-CzPUMw00.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-tyhA5jkt.js";import"./p-BUa0YOaw.js";import"./p-D--yCspA.js";import"./p-RvUQ__Pq.js";const f=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=j,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){a(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:i})=>async({params:r,onSuccess:a,onError:n})=>{var h,m;try{const u=await i.fetchCheckouts(t,s,r);if(u.error)return n({error:c(u.error),code:p(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);a({checkouts:(null===(h=u.data)||void 0===h?void 0:h.map((t=>new e(t))))||[],pagingInfo:t})}}catch(t){const s=p(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:o.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new h}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u}))}render(){return i(d,{key:"4889226a2351b13dde8cbbfb0ba5fb3156226c5f"},i("checkouts-list-core",{key:"56c36469e55f5ce33da5cc3224ebfd83057811d7",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_checkouts_list}
@@ -1 +1 @@
1
- import{r as s,c as i,h as t}from"./p-qipqIMyC.js";import{E as r}from"./p-BIPdn2VU.js";import{B as o}from"./p-B4idKqyn.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as n,J as h}from"./p-D_5McRD_.js";import"./p-RvUQ__Pq.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-BBpkkt2-.js";const a=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){n(),this.analytics=new h(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new o})}render(){return this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{a as justifi_business_details}
1
+ import{r as s,c as i,h as t}from"./p-qipqIMyC.js";import{E as r}from"./p-BIPdn2VU.js";import{B as o}from"./p-B4idKqyn.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as n,J as h}from"./p-CtA2NMVz.js";import"./p-RvUQ__Pq.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-tyhA5jkt.js";const a=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){n(),this.analytics=new h(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new o})}render(){return this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{a as justifi_business_details}
@@ -1 +1 @@
1
- import{r as s,c as e,h as t,H as i}from"./p-qipqIMyC.js";import{C as n,a as r}from"./p-Cjcsf8ku.js";import{m as o,b as a,f as h,g as d}from"./p-5aA7gjr5.js";import{B as c,a as u,D as p}from"./p-B4idKqyn.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as f,d as l,F as b}from"./p-CR9D6mKt.js";import{A as m}from"./p-BUa0YOaw.js";import{C as g}from"./p-RvUQ__Pq.js";import{a as k,B as y}from"./p-XYgDHrVL.js";import{B as v}from"./p-D6XirF21.js";import"./p-CZfYo5-1.js";import"./p-D2muobcE.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-BFTU3MAI.js";const j=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-additional-questions-form-step-core",{key:"b494a48aa19f63e30007663276876540c5149879",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},w=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c}),this.postBankAccount=h({authToken:this.authToken,service:new u}),this.postDocumentRecord=d({authToken:this.authToken,service:new p})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-business-bank-account-form-step-core",{key:"adb496ad14cd3334d30e571d873150ed8335f833",businessId:this.businessId,getBusiness:this.getBusiness,postBankAccount:this.postBankAccount,postDocumentRecord:this.postDocumentRecord,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},_=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-business-core-info-form-step-core",{key:"1d2bd68e87d5f312c54f5a4bda8863b26fdeec5d",businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},C=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t(i,{key:"3420b6e74da344665583a49146b5b7fd1be40155"},t("justifi-business-owners-form-step-core",{key:"3e092450028815a0b134af4294edbb7589864409",authToken:this.authToken,businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s}))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},T=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-business-representative-form-step-core",{key:"582c77f4b763573a1d29726285a9b871afe96d89",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},I=class{constructor(t){s(this,t),this.stepCompleteEvent=e(this,"complete-form-step-event"),this.errorEvent=e(this,"error-event"),this.formLoading=e(this,"formLoading"),this.formCompleted=e(this,"formCompleted"),this.errors={},this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get({endpoint:this.businessEndpoint,authToken:this.authToken});this.acceptedTermsBefore=s.data.terms_conditions_accepted}catch(s){this.errorEvent.emit({errorCode:r.FETCH_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const e=this.termsPayload,t=await this.api.post({endpoint:this.termsConditionsEndpoint,body:e,authToken:this.authToken});this.handleResponse(t,s)}catch(s){this.errorEvent.emit({errorCode:r.POST_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,e)=>{this.acceptedTerms=e,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:e}))}}get businessEndpoint(){return`entities/business/${this.businessId}`}get termsConditionsEndpoint(){return"entities/terms_and_conditions"}get formHelperText(){return this.acceptedTermsBefore?"You have already accepted the terms and conditions.":null}get termsPayload(){return{business_id:this.businessId,accepted:this.formController.values.getValue().accepted,user_agent:window.navigator.userAgent}}async componentWillLoad(){this.api=m(),this.formController=new b((s=>{const e=f({accepted:l().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),t=f({accepted:l().nullable()});return s?t:e})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(s,e){s.error?this.errorEvent.emit({errorCode:r.POST_ERROR,message:s.error.message,severity:n.ERROR,data:s.error}):e(),this.stepCompleteEvent.emit({response:s,formStep:k.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:s}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:k.termsAndConditions,metadata:"no data submitted"}),this.formCompleted.emit(),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get merchantAgreementLink(){return t("a",{href:"https://justifi.tech/merchant-agreement/",target:"_blank",rel:"noopener noreferrer"},"merchant agreement")}render(){return t("form",{key:"8cea6fff2e5b5cbfa7de6b3adfce238153599d1e"},t("fieldset",{key:"ef3c4ce5d0d03f1d048e072c6f7ac3da565ffb18"},t("legend",{key:"caa5fee86bd4b5c2a7204a76ae3533146526b9e1",part:g},"Terms and Conditions"),t("hr",{key:"5a72caeaf2dae8f57c0be09ca21feceb0793daf4"}),t("div",{key:"e39700b83a10c479cf6d767c1af61ac8b480e4d5"},t("p",{key:"2b8520977bedf73c295a387095724a561391b005"},"Please read and accept the ",this.merchantAgreementLink," to submit your provisioning request.")),t("br",{key:"706ec9ecfd4a0909583745f90b36eeb42fa5e690"}),t("div",{key:"d915e2c49188b829b33b03f07cc8f1ccea99ee1d",class:"row-gy-3"},t("div",{key:"cbbc74e6b5e80bf54884a8f41eb94f6d5bcdb6dd",class:"col-12"},t("form-control-checkbox",{key:"f63aed196d33f1760dae8c5ac5487c0fbc7d4838",name:"accepted",label:"I agree to the terms and conditions",inputHandler:this.inputHandler,errorText:this.errors.accepted,disabled:this.acceptedTermsBefore,helpText:this.formHelperText,checked:this.acceptedTerms})))))}},S=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-legal-address-form-step-core",{key:"bd286476461181f2e8a435a97bf148d55876b49c",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},B=class{constructor(e){s(this,e)}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return t("div",{key:"5869ed8c350e3a1ae5fe62dcd04493f432eecff7",class:"d-flex gap-2"},t(v,{key:"b1e8c2fff97e9a053d715860a43ddd78c99b255a",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),t(v,{key:"8696fe4f0bde5434e51f05f67b39a8e5b2f550bf",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,y.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),t(v,{key:"b1750a849d60244bdb3cf82690c6cbd15b6e1110",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,y.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},A=class{constructor(e){s(this,e),this.allowOptionalFields=!1,this.componentStepMapping={0:()=>t("justifi-business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields}),1:()=>t("justifi-legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields}),2:()=>t("justifi-additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>t("justifi-business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields}),4:()=>t("justifi-business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields}),5:()=>t("justifi-business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,allowOptionalFields:this.allowOptionalFields}),6:()=>t("justifi-business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields})}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return t("div",{key:"9a09e562d0a3548cb40863ba5780c5d1692b6ec3",class:"col-12 mb-4"},this.currentStepComponent)}};export{j as justifi_additional_questions_form_step,w as justifi_business_bank_account_form_step,_ as justifi_business_core_info_form_step,C as justifi_business_owners_form_step,T as justifi_business_representative_form_step,I as justifi_business_terms_conditions_form_step,S as justifi_legal_address_form_step,B as justifi_payment_provisioning_form_buttons,A as justifi_payment_provisioning_form_steps}
1
+ import{r as s,c as e,h as t,H as i}from"./p-qipqIMyC.js";import{C as n,a as r}from"./p-Cjcsf8ku.js";import{m as a,b as o,f as h,g as d}from"./p-5aA7gjr5.js";import{B as c,a as u,D as p}from"./p-B4idKqyn.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as f,d as l,F as b}from"./p-CR9D6mKt.js";import{A as m}from"./p-BUa0YOaw.js";import{C as g}from"./p-RvUQ__Pq.js";import{a as k,B as y}from"./p-XYgDHrVL.js";import{B as v}from"./p-D6XirF21.js";import"./p-CZfYo5-1.js";import"./p-D2muobcE.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-BFTU3MAI.js";const j=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-additional-questions-form-step-core",{key:"9692b11a4a655aade004e62c4b4c1fa61904ec11",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},w=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c}),this.postBankAccount=h({authToken:this.authToken,service:new u}),this.postDocumentRecord=d({authToken:this.authToken,service:new p})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-business-bank-account-form-step-core",{key:"675d0d4f64e58f8b036ccd0bdf6d2f77d95fab4b",businessId:this.businessId,getBusiness:this.getBusiness,postBankAccount:this.postBankAccount,postDocumentRecord:this.postDocumentRecord,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},_=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-business-core-info-form-step-core",{key:"c8eb1c76b9c7839e83f341eca5cc60737fb83f6e",businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},C=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t(i,{key:"aa3b4e716a0592f48180b7dbe2f81662aeb4d6e7"},t("justifi-business-owners-form-step-core",{key:"8e3ef054061dbe2500aa9f67e4aea53b12e5d432",authToken:this.authToken,businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s}))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},T=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-business-representative-form-step-core",{key:"241cd9ff1afae3bf1f9107cf6f66392b7b656471",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},I=class{constructor(t){s(this,t),this.stepCompleteEvent=e(this,"complete-form-step-event"),this.errorEvent=e(this,"error-event"),this.formLoading=e(this,"formLoading"),this.formCompleted=e(this,"formCompleted"),this.errors={},this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get({endpoint:this.businessEndpoint,authToken:this.authToken});this.acceptedTermsBefore=s.data.terms_conditions_accepted}catch(s){this.errorEvent.emit({errorCode:r.FETCH_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const e=this.termsPayload,t=await this.api.post({endpoint:this.termsConditionsEndpoint,body:e,authToken:this.authToken});this.handleResponse(t,s)}catch(s){this.errorEvent.emit({errorCode:r.POST_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,e)=>{this.acceptedTerms=e,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:e}))}}get businessEndpoint(){return`entities/business/${this.businessId}`}get termsConditionsEndpoint(){return"entities/terms_and_conditions"}get formHelperText(){return this.acceptedTermsBefore?"You have already accepted the terms and conditions.":null}get termsPayload(){return{business_id:this.businessId,accepted:this.formController.values.getValue().accepted,user_agent:window.navigator.userAgent}}async componentWillLoad(){this.api=m(),this.formController=new b((s=>{const e=f({accepted:l().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),t=f({accepted:l().nullable()});return s?t:e})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(s,e){s.error?this.errorEvent.emit({errorCode:r.POST_ERROR,message:s.error.message,severity:n.ERROR,data:s.error}):e(),this.stepCompleteEvent.emit({response:s,formStep:k.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:s}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:k.termsAndConditions,metadata:"no data submitted"}),this.formCompleted.emit(),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get merchantAgreementLink(){return t("a",{href:"https://justifi.tech/merchant-agreement/",target:"_blank",rel:"noopener noreferrer"},"merchant agreement")}render(){return t("form",{key:"ed3e493e5c53e303c98e97a15149cffd2865de47"},t("fieldset",{key:"a4be899152d7930c2e5ac8b384f866ba313a434f"},t("legend",{key:"6b473d236380c13ec4186cb5088f976349f18e7c",part:g},"Terms and Conditions"),t("hr",{key:"4ef52973bed72265e0ef29f0ac6e7a0ac1142f8a"}),t("div",{key:"621d89594d6335d10a746af628ce85df0bf4a71f"},t("p",{key:"2f13e9851fdfa4b8f678de19261e7df7a7968cc0"},"Please read and accept the ",this.merchantAgreementLink," to submit your provisioning request.")),t("br",{key:"7951565f2ad57491cbba0d05d650eb0aea1aea54"}),t("div",{key:"e7d727efbd5d732b31746d3cc61eeaf9eb4b1ff6",class:"row-gy-3"},t("div",{key:"b6d8d501530fbe4de7c11eb46218c618a7aec26f",class:"col-12"},t("form-control-checkbox",{key:"79030af1a43bc5d1742726b8ea66d6dda3306473",name:"accepted",label:"I agree to the terms and conditions",inputHandler:this.inputHandler,errorText:this.errors.accepted,disabled:this.acceptedTermsBefore,helpText:this.formHelperText,checked:this.acceptedTerms})))))}},S=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event")}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new c}),this.patchBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new c})):this.errorEvent.emit({message:"Missing required props",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-legal-address-form-step-core",{key:"fb07306fe9d60ca061e9291565ea4dd11db6d93f",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},B=class{constructor(e){s(this,e)}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return t("div",{key:"cc744b394b8a75f2cf6b551f50376d16eb4f053b",class:"d-flex gap-2"},t(v,{key:"b83498b5bd052607803159acc593ed3f53c8cd4f",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),t(v,{key:"02f6dfacedd16c2a82879bf13706bf554372064c",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,y.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),t(v,{key:"eda937677c7e1d5a64f88d020ba4c738bc89af68",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,y.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},A=class{constructor(e){s(this,e),this.allowOptionalFields=!1,this.componentStepMapping={0:()=>t("justifi-business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields}),1:()=>t("justifi-legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields}),2:()=>t("justifi-additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>t("justifi-business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields}),4:()=>t("justifi-business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields}),5:()=>t("justifi-business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,allowOptionalFields:this.allowOptionalFields}),6:()=>t("justifi-business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields})}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return t("div",{key:"bc4e1cd4a04dc6f0d9338fa737b91fe1628ed2b3",class:"col-12 mb-4"},this.currentStepComponent)}};export{j as justifi_additional_questions_form_step,w as justifi_business_bank_account_form_step,_ as justifi_business_core_info_form_step,C as justifi_business_owners_form_step,T as justifi_business_representative_form_step,I as justifi_business_terms_conditions_form_step,S as justifi_legal_address_form_step,B as justifi_payment_provisioning_form_buttons,A as justifi_payment_provisioning_form_steps}
@@ -0,0 +1 @@
1
+ import{r as s,c as t,h as e,H as i}from"./p-qipqIMyC.js";import{Z as c,_ as a,$ as h,a0 as r,a1 as o,l as f}from"./p-RvUQ__Pq.js";import{F as b}from"./p-oGKW57R8.js";import{F as d}from"./p-DCMrHeJI.js";import"./p-CZfYo5-1.js";const m=class{constructor(e){s(this,e),this.formControlInput=t(this,"formControlInput"),this.formControlBlur=t(this,"formControlBlur"),this.isFocused=!1,this.handleFormControlInput=s=>{s.preventDefault();const t=s.target,e=t.getAttribute("name");this.inputHandler(e,t.checked),this.formControlInput.emit({name:e,value:t.value})},this.updateInput=s=>{this.checkboxElement.checked=s}}get part(){return this.errorText?c:this.isFocused&&this.checked?a:this.isFocused?h:this.checked?r:o}render(){return e(i,{key:"6ef9c4917c0371f697b92f6a7ee1471feec1aaf1"},e("div",{key:"c9b0a6f9d55f2fccc0ce060af6b0944d1cc9104e",class:"form-group d-flex flex-column"},e("div",{key:"618bf437e3d39095c5d5fb29b539d37e5f25b225",class:"form-check"},e("input",{key:"e51b0c603bc0be02055dc96145b04dbb43638b79",ref:s=>this.checkboxElement=s,type:"checkbox",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.part,class:this.errorText?"form-check-input is-invalid":"form-check-input",disabled:this.disabled,checked:this.checked}),e("label",{key:"bad954d2501514587ef79c0325ecaae0ba6a4b91",class:"form-check-label",htmlFor:this.name,part:f},this.label)),e(b,{key:"26d50d8b95bd2285211079e5527f57152c739651",helpText:this.helpText,name:this.name}),e(d,{key:"5e2f8d2c9fe3a883d2bc9a6200075d8ba13a5dc4",errorText:this.errorText,name:this.name})))}};export{m as form_control_checkbox}
@@ -1 +1 @@
1
- import{r as e,c as t,h as s}from"./p-qipqIMyC.js";import{c as i,d as r,e as a}from"./p-5aA7gjr5.js";import{I as o}from"./p-B4idKqyn.js";import{F as d}from"./p-CR9D6mKt.js";import{O as c}from"./p-BlJnA265.js";import{i as h}from"./p-PgEzcvI6.js";import{B as n}from"./p-D6XirF21.js";import{V as f}from"./p-RvUQ__Pq.js";import"./p-CZfYo5-1.js";import{B as l}from"./p-XYgDHrVL.js";import{S as m,P as b}from"./p-B-iV5cYd.js";import{u as p,a as u,b as y}from"./p-1ydcg9ti.js";import"./p-Cjcsf8ku.js";import"./p-D2muobcE.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BFTU3MAI.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-CYBR4K2p.js";import"./p-yH3TC3ZQ.js";const j=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event")}async validate(){return this.coreComponent.validate()}async submit(){return this.coreComponent.submit()}async validateAndSubmit({onSuccess:e}){this.coreComponent.validateAndSubmit({onSuccess:e})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&(this.getOwner=i({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.patchOwner=r({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.postOwner=a({authToken:this.authToken,service:new o}))}render(){return s("owner-form-core",{key:"07ad7cd2bb38442dc591c9e3421223294690ee8c",ownerId:this.ownerId,businessId:this.businessId,getOwner:this.getOwner,patchOwner:this.patchOwner,postOwner:this.postOwner,allowOptionalFields:this.allowOptionalFields,removeOwner:this.removeOwner,newFormOpen:this.newFormOpen,ownersLength:this.ownersLength,ref:e=>this.coreComponent=e})}},k=class{loadingWatcher(){this.formLoading.emit(this.isLoading)}constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.formLoading=t(this,"formLoading"),this.ownerSubmitted=t(this,"ownerSubmitted"),this.isLoading=!1,this.errors={},this.owner={},this.getData=()=>{this.isLoading=!0,this.getOwner({onSuccess:e=>{this.instantiateOwner(e.data)},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({message:e,errorCode:t,severity:s})},final:()=>this.isLoading=!1})},this.sendData=()=>(this.isLoading=!0,new Promise((e=>{this.ownerId?this.patchOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1}):this.postOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1})}))),this.instantiateOwner=async e=>{this.owner=Object.assign({},new c(e)),await this.formController.setInitialValues(this.owner)},this.handleAddOwner=()=>{this.clickEvent.emit({name:this.ownerId?l.updateOwner:l.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:l.removeOwner})},this.validate=this.validate.bind(this),this.submit=this.submit.bind(this),this.validateAndSubmit=this.validateAndSubmit.bind(this)}async returnOwnerData(){return this.ownerId}async validate(){return this.formController.validate()}async submit(){if(await this.validate())return this.sendData()}async validateAndSubmit(e){e.preventDefault(),await this.validate()&&this.submit()}get payload(){let e=new c(this.formController.values.getValue()).payload;return this.ownerId?e:Object.assign(Object.assign({},e),{business_id:this.businessId})}get formTitle(){return this.ownerId?"Edit Business Owner":"Add Business Owner"}get submitButtonText(){return this.ownerId?"Update":"Add"}get showRemoveButton(){return!(this.ownersLength<=1)&&(!(this.ownerId||!this.newFormOpen)||!(!this.ownerId||this.newFormOpen)||void 0)}componentWillLoad(){this.formController=new d(h("owner",this.allowOptionalFields)),this.ownerId?this.getData():this.instantiateOwner({})}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e)))}render(){return s("form",{key:"570c20c1fdf79268e6c8193a393515c8602a3a44",onSubmit:this.validateAndSubmit},s("fieldset",{key:"f4f75a735438baef254d4578b779ca16e5080a41"},s("legend",{key:"dc0c83a7ada9f908afec56d7560f7d9d116baa40",class:"fw-semibold fs-5",part:f},this.formTitle),s("br",{key:"5d97c0b38073618aef80ff9576cd57ab0e70d44e"}),s("div",{key:"b15a207a4c4afc1249ce3b8a381e7b57ceb32e7a",class:"row gy-3"},s("owner-form-inputs",{key:"21bd3e9b00580e7293338ad746c189d19ac3d98e",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController}),s("div",{key:"b4653d9b78094b15bfba61e3a18ea3703dc53162",class:"d-flex gap-2 justify-content-start"},s(n,{key:"0328aa7af6e3c2f7ed8aa16724dedcb576bb9870",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(n,{key:"e42671667156149d5424243eef1d6675a3bd6506",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"ee7bf4cdb63cdc31df8b307ffb1772e5c0f0348c"})))}static get watchers(){return{isLoading:["loadingWatcher"]}}},w=class{constructor(t){e(this,t),this.inputHandler=(e,t)=>{p(this.formController,{[e]:t})},this.onAddressFormUpdate=e=>{u(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))}}render(){return s("div",{key:"86abe1713fdfd297e88c1fc1734fadb2c9eab966",class:"row gy-3"},s("div",{key:"63a03271f2a777d4cede3b0790e11c7f4108797f",class:"col-12 col-md-8"},s("form-control-text",{key:"b86dd9184dbf50e00e047a733ff708526e32d6dc",name:"name",label:"Full Name",defaultValue:this.ownerDefaultValue.name,errorText:this.errors.name,inputHandler:this.inputHandler})),s("div",{key:"c3850b7425ca0d8a118a6b78933f3a2fbe343124",class:"col-12 col-md-4"},s("form-control-text",{key:"f1f6e801eb36bcae5f2e51f8cd4ea9b7ed6a34a8",name:"title",label:"Title",defaultValue:this.ownerDefaultValue.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),s("div",{key:"b07a8a86dbdef296c9438953ef311ccae3aed23c",class:"col-12 col-md-6"},s("form-control-text",{key:"714ca04b0bf0e5ed1b116b8f4963ba12f7fd6b77",name:"email",label:"Email Address",defaultValue:this.ownerDefaultValue.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{key:"46c11c80bb58d0190ff05f1e87ba962443b07c59",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"6da40db9fb8b3e4f3a744cd0426f4e6436350594",name:"phone",label:"Phone Number",defaultValue:this.ownerDefaultValue.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:b.US})),s("div",{key:"0960ea2fb399d0098caeabf45347a89c74066f57",class:"col-12 col-md-4"},s("form-control-date",{key:"fe0891a3f42c093d70db1dd1d1a7e121ba3091c1",name:"dob_full",label:"Birth Date",defaultValue:this.ownerDefaultValue.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>y(e,this.formController),helpText:"Must be 18 or older."})),s("div",{key:"e7cbc519fa6f4fa5b03a0d0b69c7d7f1c42185ff",class:"col-12 col-md-8"},s("form-control-number-masked",{key:"cf2b280c1560bd1a9f80cf81c1543d41bd807233",name:"identification_number",label:"SSN",defaultValue:this.ownerDefaultValue.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:m,helpText:"Enter your full Social Security Number. It is required for Federal OFAC check."})),s("div",{key:"1755c849992bfd9f459b65b4cf7e967039fdbe27",class:"col-12"},s("justifi-identity-address-form",{key:"ac5372d4a9fad8ee3cfe2af20c11868e8753cc35",errors:this.errors.address,defaultValues:this.ownerDefaultValue.address,handleFormUpdate:this.onAddressFormUpdate})))}};export{j as justifi_owner_form,k as owner_form_core,w as owner_form_inputs}
1
+ import{r as e,c as t,h as s}from"./p-qipqIMyC.js";import{c as i,d as r,e as a}from"./p-5aA7gjr5.js";import{I as o}from"./p-B4idKqyn.js";import{F as d}from"./p-CR9D6mKt.js";import{O as h}from"./p-BlJnA265.js";import{i as n}from"./p-PgEzcvI6.js";import{B as c}from"./p-D6XirF21.js";import{V as f}from"./p-RvUQ__Pq.js";import"./p-CZfYo5-1.js";import{B as l}from"./p-XYgDHrVL.js";import{S as b,P as m}from"./p-B-iV5cYd.js";import{u as p,a as u,b as y}from"./p-1ydcg9ti.js";import"./p-Cjcsf8ku.js";import"./p-D2muobcE.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BFTU3MAI.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-CYBR4K2p.js";import"./p-yH3TC3ZQ.js";const j=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event")}async validate(){return this.coreComponent.validate()}async submit(){return this.coreComponent.submit()}async validateAndSubmit({onSuccess:e}){this.coreComponent.validateAndSubmit({onSuccess:e})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&(this.getOwner=i({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.patchOwner=r({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.postOwner=a({authToken:this.authToken,service:new o}))}render(){return s("owner-form-core",{key:"a918d86ea220a66e69950919593791f3fec0f283",ownerId:this.ownerId,businessId:this.businessId,getOwner:this.getOwner,patchOwner:this.patchOwner,postOwner:this.postOwner,allowOptionalFields:this.allowOptionalFields,removeOwner:this.removeOwner,newFormOpen:this.newFormOpen,ownersLength:this.ownersLength,ref:e=>this.coreComponent=e})}},k=class{loadingWatcher(){this.formLoading.emit(this.isLoading)}constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.formLoading=t(this,"formLoading"),this.ownerSubmitted=t(this,"ownerSubmitted"),this.isLoading=!1,this.errors={},this.owner={},this.getData=()=>{this.isLoading=!0,this.getOwner({onSuccess:e=>{this.instantiateOwner(e.data)},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({message:e,errorCode:t,severity:s})},final:()=>this.isLoading=!1})},this.sendData=()=>(this.isLoading=!0,new Promise((e=>{this.ownerId?this.patchOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1}):this.postOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1})}))),this.instantiateOwner=async e=>{this.owner=Object.assign({},new h(e)),await this.formController.setInitialValues(this.owner)},this.handleAddOwner=()=>{this.clickEvent.emit({name:this.ownerId?l.updateOwner:l.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:l.removeOwner})},this.validate=this.validate.bind(this),this.submit=this.submit.bind(this),this.validateAndSubmit=this.validateAndSubmit.bind(this)}async returnOwnerData(){return this.ownerId}async validate(){return this.formController.validate()}async submit(){if(await this.validate())return this.sendData()}async validateAndSubmit(e){e.preventDefault(),await this.validate()&&this.submit()}get payload(){let e=new h(this.formController.values.getValue()).payload;return this.ownerId?e:Object.assign(Object.assign({},e),{business_id:this.businessId})}get formTitle(){return this.ownerId?"Edit Business Owner":"Add Business Owner"}get submitButtonText(){return this.ownerId?"Update":"Add"}get showRemoveButton(){return!(this.ownersLength<=1)&&(!(this.ownerId||!this.newFormOpen)||!(!this.ownerId||this.newFormOpen)||void 0)}componentWillLoad(){this.formController=new d(n("owner",this.allowOptionalFields)),this.ownerId?this.getData():this.instantiateOwner({})}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e)))}render(){return s("form",{key:"08673bb0eb61a77b3ed37702606808f28caf507b",onSubmit:this.validateAndSubmit},s("fieldset",{key:"73e9707a99d56c7eca7737fc02b77a9d69931ef6"},s("legend",{key:"3d85ec901c9051e30472623c740194e48cc60790",class:"fw-semibold fs-5",part:f},this.formTitle),s("br",{key:"a7256d1bfa79edd90c70eab491d533d2bcd07a94"}),s("div",{key:"b74744930ecd1ac1ef08d8e356d5eeb7f5417c39",class:"row gy-3"},s("owner-form-inputs",{key:"a9fdfe906615eb494f74001396b41a433fb5366b",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController}),s("div",{key:"32fe5564d5feb8056f2401a6dd219dae0d0d10b0",class:"d-flex gap-2 justify-content-start"},s(c,{key:"9e2c1d664b382260fb82c735454dbbf478e99fdd",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(c,{key:"db94849f699044848b46e87b285bd0ee30d66b92",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"9e62fbf6cb1b1d5fa8fc4b676a72cf4350058937"})))}static get watchers(){return{isLoading:["loadingWatcher"]}}},w=class{constructor(t){e(this,t),this.inputHandler=(e,t)=>{p(this.formController,{[e]:t})},this.onAddressFormUpdate=e=>{u(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))}}render(){return s("div",{key:"2f3679b3d4fb45dd55ada0d3752017c9ba94be9e",class:"row gy-3"},s("div",{key:"4ae3a6fbad22e94321940a46ea79bcc82049ba40",class:"col-12 col-md-8"},s("form-control-text",{key:"bad30c901a7341aabe09a20b9b075212092ed475",name:"name",label:"Full Name",defaultValue:this.ownerDefaultValue.name,errorText:this.errors.name,inputHandler:this.inputHandler})),s("div",{key:"025366d57d5ceb0932b105410f8948cc092d84f3",class:"col-12 col-md-4"},s("form-control-text",{key:"7c746f5b8fe06c71e800123b46ea40e701c675ef",name:"title",label:"Title",defaultValue:this.ownerDefaultValue.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),s("div",{key:"97808fe13be4a772d820f92003320e1b2d6dff5c",class:"col-12 col-md-6"},s("form-control-text",{key:"264e975df8cd9ca53cb05b60824055028839d3ca",name:"email",label:"Email Address",defaultValue:this.ownerDefaultValue.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{key:"3a045af74578f3bec4c66848cec5460a1588800d",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"17627d6bfc876106ec40e63dcb6a3fb1b7b7f009",name:"phone",label:"Phone Number",defaultValue:this.ownerDefaultValue.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:m.US})),s("div",{key:"394b0454272509ff5d99cd63e2f3d1f2f1d0dff1",class:"col-12 col-md-4"},s("form-control-date",{key:"b079e3422551e8be640d34461adbbbeb86f659b4",name:"dob_full",label:"Birth Date",defaultValue:this.ownerDefaultValue.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>y(e,this.formController),helpText:"Must be 18 or older."})),s("div",{key:"fdaf32d03ac0d562ecc6c14f552a891f7ab0e31f",class:"col-12 col-md-8"},s("form-control-number-masked",{key:"18c3a9019fb9d0abc8654d59b504bfba27ca9661",name:"identification_number",label:"SSN",defaultValue:this.ownerDefaultValue.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:b,helpText:"Enter your full Social Security Number. It is required for Federal OFAC check."})),s("div",{key:"5f5f2815471a5b4a7b18db1aba58597e429b425b",class:"col-12"},s("justifi-identity-address-form",{key:"663d4185f2a96a260b118e0e4a9437dbff3d1906",errors:this.errors.address,defaultValues:this.ownerDefaultValue.address,handleFormUpdate:this.onAddressFormUpdate})))}};export{j as justifi_owner_form,k as owner_form_core,w as owner_form_inputs}
@@ -0,0 +1 @@
1
+ import{r as a,h as e,H as s}from"./p-qipqIMyC.js";import{E as c}from"./p-CLHwhyvu.js";import{a8 as t,a9 as d,aa as i,ab as f,ac as b}from"./p-RvUQ__Pq.js";const p=class{constructor(e){a(this,e),this.paging=c,this.params={}}render(){return e(s,{key:"60e8ec0ae3694e92d4da6c9acafcc99ee7133a15"},e("nav",{key:"4e6e0fe25d9e74361ac35088998e633f9bfed406","aria-label":"Table pagination",class:"d-flex justify-content-end gap-3"},e("ul",{key:"534d80446e2c0353815cc7a90814a530d0a847d9",class:"pagination m-0"},e("li",{key:"64f5bcbca960ad9e7aebe4a80dbb39b4839e0a30",class:"page-item "+(this.paging.has_previous?"":" disabled")},e("button",{key:"69c8738326ad600ab0d3b62fbfff02e356cc363d",class:"page-link",onClick:a=>{a.preventDefault(),this.paging.handleClickPrevious(this.paging.start_cursor)},part:this.paging.has_previous?t:d},e("span",{key:"a78f24c5d02f12c4668ccc831f19b9062af46000",class:"me-1",part:i},"«"),e("span",{key:"a1088b77164fd7d72cb37a055c1a79e302ed3c83",part:f},"Previous"))),e("li",{key:"81d5fa7a02b4248d8d7e3ee717f1fba1bda94adc",class:"page-item "+(this.paging.has_next?"":" disabled")},e("button",{key:"8e971b90b118a09522c2ed0481faf678215c6e11",class:"page-link",onClick:a=>{a.preventDefault(),this.paging.handleClickNext(this.paging.end_cursor)},part:this.paging.has_next?t:d},e("span",{key:"bae3f08686008a581c481ad8c9608ccecce1414f",part:f},"Next"),e("span",{key:"cd89a36c4875da848110bfaad8c20fc63bd3f2fa",class:"ms-1",part:b},"»"))))))}};export{p as pagination_menu}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import{P as p}from"./p-CpKvg1ok.js";import{m as r}from"./p-CU4XQ3fO.js";import{E as e}from"./p-BIPdn2VU.js";import{C as o,a}from"./p-Cjcsf8ku.js";import{c as m,J as h}from"./p-D_5McRD_.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-RvUQ__Pq.js";import"./p-BBpkkt2-.js";const n=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.paymentService=new p,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){m(),this.analytics=new h(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=r({id:this.paymentId,authToken:this.authToken,service:new p}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:a.MISSING_PROPS,severity:o.ERROR}))}render(){return this.errorMessage?e(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{n as justifi_payment_details}
1
+ import{r as t,c as s,h as i}from"./p-qipqIMyC.js";import{P as r}from"./p-CpKvg1ok.js";import{m as p}from"./p-CU4XQ3fO.js";import{E as e}from"./p-BIPdn2VU.js";import{C as o,a}from"./p-Cjcsf8ku.js";import{c as m,J as h}from"./p-CtA2NMVz.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-RvUQ__Pq.js";import"./p-tyhA5jkt.js";const n=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.paymentService=new r,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){m(),this.analytics=new h(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=p({id:this.paymentId,authToken:this.authToken,service:new r}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:a.MISSING_PROPS,severity:o.ERROR}))}render(){return this.errorMessage?e(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{n as justifi_payment_details}
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,H as s}from"./p-qipqIMyC.js";import{c as a,F as r}from"./p-CR9D6mKt.js";import{k as c,l as d,m as n,n as l,q as o,y as f}from"./p-CYBR4K2p.js";import{r as h,av as b}from"./p-RvUQ__Pq.js";import{S as m}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{S as p}from"./p-Xv8DuU3Y.js";import{c as u,J as y}from"./p-D_5McRD_.js";import{w as v,c as k}from"./p-Bp_QFeog.js";import{H as g}from"./p-BguBT6Hn.js";import{n as _}from"./p-BnjCmwMr.js";import{S as j}from"./p-BX8GieXu.js";import{B as w}from"./p-D6XirF21.js";import{c as x}from"./p-CrQgyTRz.js";import"./p-BFTU3MAI.js";import"./p-yH3TC3ZQ.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BBpkkt2-.js";import"./p-BUa0YOaw.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-DsAwPf2y.js";import"./p-DCIW8z1f.js";const C=class{constructor(i){e(this,i),this.radioClick=t(this,"radio-click"),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return i(m,{key:"1ae40f787970160e38b72f917bda96f480d2a890"},i("div",{key:"2130596c8294cc38365e6126806735da0f93ef4a",class:`radio-list-item p-3 ${this.class||""}`,part:h,onClick:this.handleClick,hidden:this.hidden},i("form-control-radio",{key:"7d5524f518430f2bfd1c9863f354318929353cfb",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},H=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new r(a({name:f.required("Enter full name"),address_line1:o.nullable(),address_line2:l.nullable(),address_city:n.nullable(),address_state:d.nullable(),address_postal_code:c.nullable()}))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const e=this.formController.getInitialValues();return i(m,{key:"81a8511265b4813817b4cf183aa176b464645e85"},i("div",{key:"7dddd3ec7822077268c73da7d0f34a691ddde1cb",part:b,class:"mt-4"},i("form",{key:"1c9000a4b022209129cf511d79a77cf3dc44b77e"},i("fieldset",{key:"134c349c5745197b5ebb79b31748bf480e1cab7a"},this.legend&&i("legend",{key:"fb8e12086fd6fb51f7456d8fc6e82a9184514d4f"},this.legend),i("div",{key:"a49ae2d182e442efbe44aae7c2e0a4e40dabe7d7",class:"row gy-3"},i("div",{key:"2be4b2aab266d0fc17f32237693dea8578c7545d",class:"col-12"},i("form-control-text",{key:"92d1b3b05ba04212e46feecfd886f7dcc912e4fe",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})))))))}},V=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-end"},i(p,{height:"18px",width:"120px"}),i(p,{height:"36px"}))),i("div",{class:"row"},i("div",{class:"col-12 align-content-end"},i(p,{height:"18px",width:"110px"}),i(p,{height:"36px"}))))},O=class{constructor(t){e(this,t),this.isReady=!1}async componentWillLoad(){await v(),this.iframeOrigin=k.iframeOrigin,u(),this.analytics=new y(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.accountNumberIframeElement.validate(),t=await this.routingNumberIframeElement.validate();return e&&t}async tokenize({clientId:e,paymentMethodMetadata:t,account:i}){return this.accountNumberIframeElement.tokenize(e,t,i)}render(){return i(m,{key:"99ccb5aa2afbf79e5bf40d59ca15eb217180349a"},i(V,{key:"a26a6f4391a5e5b7923f36b05bdfe57491b31d8a",isReady:this.isReady}),i("hidden-input",{key:"7555fe1bbf38a1525e7c11fe7182e264752435c9"}),i("div",{key:"d1d7141ee75a644d4ae67d23b353dc6293306371",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"db0d578ccb3647e049b5ef958bef0273a8945448",class:"row mb-3"},i("iframe-input",{key:"58311d94a8f5f023f05de260afbaf6bc707a0d57",inputId:"accountNumber",ref:e=>this.accountNumberIframeElement=e,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),i("div",{key:"92e4b77f012a414ac88b8faf721b5a10f2c5a3a4",class:"row"},i("iframe-input",{key:"5163f7e8cff8fb82bb009f615ef7ab2e231deb52",inputId:"routingNumber",ref:e=>this.routingNumberIframeElement=e,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},B=class{constructor(t){e(this,t)}get showSimpleCardBillingForm(){return"card"===this.paymentMethodType&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return"bankAccount"===this.paymentMethodType&&this.hideBankAccountBillingForm}async getValues(){var e;return null===(e=this.selectedFormRef)||void 0===e?void 0:e.getValues()}async fill(e){var t;null===(t=this.selectedFormRef)||void 0===t||t.fill(e)}async validate(){var e;return null===(e=this.selectedFormRef)||void 0===e?void 0:e.validate()}render(){return i(s,null,i(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:e=>this.selectedFormRef=e}))}},L=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new r(a({name:f.required("Enter full name"),address_line1:o.required("Enter street address"),address_line2:l.nullable(),address_city:n.required("Enter city"),address_state:d.required("Select state"),address_postal_code:c.required("Enter postal code")})),this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){if(!this.formController)return null;const e=this.formController.getInitialValues();return i(m,null,i("div",{part:b,class:"mt-4"},i(g,{text:"Billing address",class:"fs-6 fw-bold lh-lg mb-4"}),i("form",null,i("fieldset",null,this.legend&&i("legend",null,this.legend),i("div",{class:"row gy-3"},i("div",{class:"col-12"},i("form-control-text",{name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-select",{name:"address_state",label:"State",options:j,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:_})))))))}},M=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return i(m,{key:"48098276e0808052803f0d16df68ba23d529c4ab"},i(w,{key:"c62e8d2d9208dc180180b4283edea991c5a93c57",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},D=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new r(a({name:f.nullable(),address_line1:o.nullable(),address_line2:l.nullable(),address_city:n.nullable(),address_state:d.nullable(),address_postal_code:c.required("Enter postal code")}))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const e=this.formController.getInitialValues();return i(m,{key:"a88ea2aa0b1cc2fccda7c169aad9c061e106ecfe"},i("div",{key:"414df056d92819bf646886ca8e15f2ed10e6ab18",part:b},i("form",{key:"c11f6eb5c7c5c1ecbeb8cc8f644a3b3ba72254c7"},i("fieldset",{key:"dd69c65ff7f36da3954c01ca2401e8ede6799f14"},this.legend&&i("legend",{key:"25a86a61452b84237cc58c047916de22c35b764d"},this.legend),i("div",{key:"2fa8445fcf4ac0500f357d92480f18ccac655689",class:"row gy-3"},i("div",{key:"b7ac75fcab43435a03ad919757541f74661ce5b4",class:"col-12"},i("form-control-text",{key:"fd9e84c9605edf1a987c7243409eb0182f79a803",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:_})))))))}},I=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(p,{height:"18px",width:"100px"}),i(p,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(p,{height:"18px",width:"80px"}),i(p,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(p,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(p,{height:"18px",width:"30px"}),i(p,{height:"36px"}))))},N=class{constructor(t){e(this,t),this.isReady=!1}async componentWillLoad(){await v(),this.iframeOrigin=k.iframeOrigin,u(),this.analytics=new y(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.cardNumberIframeElement.validate(),t=await this.expirationMonthIframeElement.validate(),i=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return e&&t&&i&&s}async tokenize({clientId:e,paymentMethodMetadata:t,account:i}){return this.cardNumberIframeElement.tokenize(e,t,i)}render(){return i(m,{key:"46991f66161e4118fdf135bf18eb757435e26457"},i(I,{key:"aacb7f467a10debc809997a67172fe4f23a2ca76",isReady:this.isReady}),i("hidden-input",{key:"3e9bd9b7ff0aba356d9f8fd07428cbaedcb223b1"}),i("div",{key:"8fcf6d92703491fe6a0be076a5965c09c800f262",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"8dea63dc69d7c7cfbcded0a07bfbcf9c7d7a41fa",class:"mb-3"},i("iframe-input",{key:"ffd4de932414b206ea5936c21349c522b762f8a4",inputId:"cardNumber",ref:e=>this.cardNumberIframeElement=e,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),i("div",{key:"3e56350822761119dbb7ff49e3cc56bec7f361ca",class:"row"},i("div",{key:"ab13b6b20573fbec961164a415ccaf21b663eb4b",class:"col-4 align-content-end"},i("iframe-input",{key:"e12d56f2c1dd12ae5eff7619204d9f746e1b6a43",inputId:"expirationMonth",ref:e=>this.expirationMonthIframeElement=e,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),i("div",{key:"62e4808ee208aec7cf3e1d7a99fd65f3d9a5e615",class:"col-4 align-content-end"},i("iframe-input",{key:"c8e3945b466e61e8b21fbb13f71c0631740ca1a3",inputId:"expirationYear",ref:e=>this.expirationYearIframeElement=e,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),i("div",{key:"979929e29abb54f8837f71b1cdb7261df97a58df",class:"col-4 align-content-end"},i("iframe-input",{key:"2c25868c5fd7e6c2d34722b39f22c2062248cdf6",inputId:"CVV",ref:e=>this.cvvIframeElement=e,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},R=class{constructor(i){e(this,i),this.checkboxChanged=t(this,"checkboxChanged"),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(e,t)=>{this.isChecked=t,x.savePaymentMethod=t,this.checkboxChanged.emit(this.isChecked)}}render(){return i(m,{key:"c3808f4373067144ded9db353e48fe9cd3df59bc"},i("form-control-checkbox",{key:"2f104a35497fdc1397c014c4c4ed646f7b389239",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{H as justifi_bank_account_billing_form_simple,O as justifi_bank_account_form,B as justifi_billing_form,L as justifi_billing_form_full,M as justifi_button,D as justifi_card_billing_form_simple,N as justifi_card_form,C as justifi_radio_list_item,R as justifi_save_new_payment_method}
1
+ import{r as e,c as t,h as i,H as a}from"./p-qipqIMyC.js";import{c as s,F as r}from"./p-CR9D6mKt.js";import{k as c,l as d,m as n,n as l,q as o,y as f}from"./p-CYBR4K2p.js";import{r as h,av as b}from"./p-RvUQ__Pq.js";import{S as m}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{S as p}from"./p-Xv8DuU3Y.js";import{c as u,J as y}from"./p-CtA2NMVz.js";import{w as v,c as k}from"./p-Bp_QFeog.js";import{H as g}from"./p-BguBT6Hn.js";import{n as _}from"./p-BnjCmwMr.js";import{S as j}from"./p-BX8GieXu.js";import{B as w}from"./p-D6XirF21.js";import{c as x}from"./p-CrQgyTRz.js";import"./p-BFTU3MAI.js";import"./p-yH3TC3ZQ.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-tyhA5jkt.js";import"./p-BUa0YOaw.js";import"./p-BHf9IqGw.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-DsAwPf2y.js";import"./p-DCIW8z1f.js";const C=class{constructor(i){e(this,i),this.radioClick=t(this,"radio-click"),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return i(m,{key:"b0501b66bcfdd697d88c01835b8f97fb2c0861ab"},i("div",{key:"ada4dda7868086b1ea4cadd6c8824f87d3cb2301",class:`radio-list-item p-3 ${this.class||""}`,part:h,onClick:this.handleClick,hidden:this.hidden},i("form-control-radio",{key:"72c6d07dd2a664ca6bd2be9b446584d7344bc2b0",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},V=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new r(s({name:f.required("Enter full name"),address_line1:o.nullable(),address_line2:l.nullable(),address_city:n.nullable(),address_state:d.nullable(),address_postal_code:c.nullable()}))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const e=this.formController.getInitialValues();return i(m,{key:"53205714e0fee906cb28b444eadf954b25a11dea"},i("div",{key:"1208a0bd457a727f73612aa76600ae1362493d1a",part:b,class:"mt-4"},i("form",{key:"bd6de1875ed9a9ff95206b38842711d00eaa5258"},i("fieldset",{key:"9169cc821a58774fd8b0135d1f506f98c96f4339"},this.legend&&i("legend",{key:"0dac5fca347fa7a6dadeb00cd8a252cc9bc64920"},this.legend),i("div",{key:"3a3fc5259f3bc28664e0e2e8ced2e56f39dc3820",class:"row gy-3"},i("div",{key:"7b61ca324077c9bcfc1d92a078ac9b94eafebe54",class:"col-12"},i("form-control-text",{key:"49782afc8cd941f921ea80852a5201de6c6cef5e",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})))))))}},H=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-end"},i(p,{height:"18px",width:"120px"}),i(p,{height:"36px"}))),i("div",{class:"row"},i("div",{class:"col-12 align-content-end"},i(p,{height:"18px",width:"110px"}),i(p,{height:"36px"}))))},O=class{constructor(t){e(this,t),this.isReady=!1}async componentWillLoad(){await v(),this.iframeOrigin=k.iframeOrigin,u(),this.analytics=new y(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.accountNumberIframeElement.validate(),t=await this.routingNumberIframeElement.validate();return e&&t}async tokenize({clientId:e,paymentMethodMetadata:t,account:i}){return this.accountNumberIframeElement.tokenize(e,t,i)}render(){return i(m,{key:"99ccb5aa2afbf79e5bf40d59ca15eb217180349a"},i(H,{key:"a26a6f4391a5e5b7923f36b05bdfe57491b31d8a",isReady:this.isReady}),i("hidden-input",{key:"7555fe1bbf38a1525e7c11fe7182e264752435c9"}),i("div",{key:"d1d7141ee75a644d4ae67d23b353dc6293306371",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"db0d578ccb3647e049b5ef958bef0273a8945448",class:"row mb-3"},i("iframe-input",{key:"58311d94a8f5f023f05de260afbaf6bc707a0d57",inputId:"accountNumber",ref:e=>this.accountNumberIframeElement=e,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),i("div",{key:"92e4b77f012a414ac88b8faf721b5a10f2c5a3a4",class:"row"},i("iframe-input",{key:"5163f7e8cff8fb82bb009f615ef7ab2e231deb52",inputId:"routingNumber",ref:e=>this.routingNumberIframeElement=e,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},B=class{constructor(t){e(this,t)}get showSimpleCardBillingForm(){return"card"===this.paymentMethodType&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return"bankAccount"===this.paymentMethodType&&this.hideBankAccountBillingForm}async getValues(){var e;return null===(e=this.selectedFormRef)||void 0===e?void 0:e.getValues()}async fill(e){var t;null===(t=this.selectedFormRef)||void 0===t||t.fill(e)}async validate(){var e;return null===(e=this.selectedFormRef)||void 0===e?void 0:e.validate()}render(){return i(a,null,i(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:e=>this.selectedFormRef=e}))}},L=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new r(s({name:f.required("Enter full name"),address_line1:o.required("Enter street address"),address_line2:l.nullable(),address_city:n.required("Enter city"),address_state:d.required("Select state"),address_postal_code:c.required("Enter postal code")})),this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){if(!this.formController)return null;const e=this.formController.getInitialValues();return i(m,null,i("div",{part:b,class:"mt-4"},i(g,{text:"Billing address",class:"fs-6 fw-bold lh-lg mb-4"}),i("form",null,i("fieldset",null,this.legend&&i("legend",null,this.legend),i("div",{class:"row gy-3"},i("div",{class:"col-12"},i("form-control-text",{name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-select",{name:"address_state",label:"State",options:j,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),i("div",{class:"col-12"},i("form-control-text",{name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:_})))))))}},M=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return i(m,{key:"48098276e0808052803f0d16df68ba23d529c4ab"},i(w,{key:"c62e8d2d9208dc180180b4283edea991c5a93c57",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},N=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new r(s({name:f.nullable(),address_line1:o.nullable(),address_line2:l.nullable(),address_city:n.nullable(),address_state:d.nullable(),address_postal_code:c.required("Enter postal code")}))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const e=this.formController.getInitialValues();return i(m,{key:"648204826c1e3979b8556ce9049f5e025a52b282"},i("div",{key:"dba0067b4662662653e424ff2c81c6edc831ed46",part:b},i("form",{key:"651812a32f1ee195f89238d1125573b6f9a62fa7"},i("fieldset",{key:"15e9d4713fba88bb6de715c48b41b1c3ebfab9df"},this.legend&&i("legend",{key:"783b34c1a9c2f4d407587b1a356ccf1e0e119993"},this.legend),i("div",{key:"f322d2a29f50bff82167e9c5633a9f1d8b3f3cef",class:"row gy-3"},i("div",{key:"a02f6b275a02b32c37fd8c15921a582fa6a235a7",class:"col-12"},i("form-control-text",{key:"3efd6677727b377bbf4432dc13c34500930ec801",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:_})))))))}},I=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(p,{height:"18px",width:"100px"}),i(p,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(p,{height:"18px",width:"80px"}),i(p,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(p,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(p,{height:"18px",width:"30px"}),i(p,{height:"36px"}))))},D=class{constructor(t){e(this,t),this.isReady=!1}async componentWillLoad(){await v(),this.iframeOrigin=k.iframeOrigin,u(),this.analytics=new y(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.cardNumberIframeElement.validate(),t=await this.expirationMonthIframeElement.validate(),i=await this.expirationYearIframeElement.validate(),a=await this.cvvIframeElement.validate();return e&&t&&i&&a}async tokenize({clientId:e,paymentMethodMetadata:t,account:i}){return this.cardNumberIframeElement.tokenize(e,t,i)}render(){return i(m,{key:"46991f66161e4118fdf135bf18eb757435e26457"},i(I,{key:"aacb7f467a10debc809997a67172fe4f23a2ca76",isReady:this.isReady}),i("hidden-input",{key:"3e9bd9b7ff0aba356d9f8fd07428cbaedcb223b1"}),i("div",{key:"8fcf6d92703491fe6a0be076a5965c09c800f262",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"8dea63dc69d7c7cfbcded0a07bfbcf9c7d7a41fa",class:"mb-3"},i("iframe-input",{key:"ffd4de932414b206ea5936c21349c522b762f8a4",inputId:"cardNumber",ref:e=>this.cardNumberIframeElement=e,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),i("div",{key:"3e56350822761119dbb7ff49e3cc56bec7f361ca",class:"row"},i("div",{key:"ab13b6b20573fbec961164a415ccaf21b663eb4b",class:"col-4 align-content-end"},i("iframe-input",{key:"e12d56f2c1dd12ae5eff7619204d9f746e1b6a43",inputId:"expirationMonth",ref:e=>this.expirationMonthIframeElement=e,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),i("div",{key:"62e4808ee208aec7cf3e1d7a99fd65f3d9a5e615",class:"col-4 align-content-end"},i("iframe-input",{key:"c8e3945b466e61e8b21fbb13f71c0631740ca1a3",inputId:"expirationYear",ref:e=>this.expirationYearIframeElement=e,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),i("div",{key:"979929e29abb54f8837f71b1cdb7261df97a58df",class:"col-4 align-content-end"},i("iframe-input",{key:"2c25868c5fd7e6c2d34722b39f22c2062248cdf6",inputId:"CVV",ref:e=>this.cvvIframeElement=e,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},T=class{constructor(i){e(this,i),this.checkboxChanged=t(this,"checkboxChanged"),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(e,t)=>{this.isChecked=t,x.savePaymentMethod=t,this.checkboxChanged.emit(this.isChecked)}}render(){return i(m,{key:"0ac7e7b80c9a00737eed4f9345020994eb5d92bf"},i("form-control-checkbox",{key:"3396c0a413c3d498d7cdccc12ad97739d97f74c8",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{V as justifi_bank_account_billing_form_simple,O as justifi_bank_account_form,B as justifi_billing_form,L as justifi_billing_form_full,M as justifi_button,N as justifi_card_billing_form_simple,D as justifi_card_form,C as justifi_radio_list_item,T as justifi_save_new_payment_method}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,c as i,H as s,g as a}from"./p-qipqIMyC.js";import{z as n,r as o}from"./p-RvUQ__Pq.js";import{f as r}from"./p-BHf9IqGw.js";import{c as h,o as l,g as c,a as d}from"./p-CrQgyTRz.js";import{S as u}from"./p-CLQx9p9q.js";import"./p-CZfYo5-1.js";import{H as y}from"./p-CQeex56P.js";import{H as m,b as p,h as M,i as v}from"./p-Bvp7uul3.js";import{H as g}from"./p-BguBT6Hn.js";import{J as f,c as k}from"./p-CtA2NMVz.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import{C as j,a as b,b as T}from"./p-Cjcsf8ku.js";import{I as w}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as N,a as D}from"./p-D2muobcE.js";import{C as I}from"./p-BY2p6Sxk.js";import{A as C}from"./p-BUa0YOaw.js";import{P as A,a as E,b as P}from"./p-DCIW8z1f.js";import{C as x}from"./p-ZpPDShvP.js";import"./p-DsAwPf2y.js";import"./p-tyhA5jkt.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const z=class{constructor(e){t(this,e)}render(){return e(u,{key:"3161e6f6a196c79d684574cafbc90bcf741b2150"},e("section",{key:"594b4485ed4fd9d7c1ee7f4556f071139f92ef0c"},e("div",{key:"5c2d14677dda6fc7ddcb074d4887b839385dca3a"},e("div",{key:"fb850cd7e9c11741349710696dd4e6241c98e805",part:n},null==h?void 0:h.paymentDescription),e("div",{key:"959014d7fa2a9c97bae0c986313a604930c1e0f3"},e("span",{key:"14ab0932a083568419b1c36c95f9072c73962b11",part:n},"Total")," ",e("span",{key:"08a9e00332253070ae984b77eb2a9bab88eb3472",part:n},r(+(null==h?void 0:h.totalAmount)))))))}},L=class{constructor(e){t(this,e),this.levels={h1:y,h2:m,h3:g},this.level="h1"}render(){return e(u,{key:"eb3651b698897193d34a6c6456cd57dd0bd0bc43"},e(this.levels[this.level],{key:"39caee687f93d3d4d90e62d9fbcae318eaa8022e",text:this.text,class:this.class}))}},O=C();class _{async getLinkToken(t,e,i,s){return O.post({endpoint:`plaid/${e}/link`,body:{checkout_id:i},authToken:t,signal:s})}async tokenizeBankAccount(t,e,i,s,a,n){const o=`plaid/${e}/tokenize`,r={public_token:i};return s&&(r.link_token_id=s),a&&(r.payment_method_group_id=a),O.post({endpoint:o,body:r,authToken:t,signal:n})}}const S=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),this.checkoutChangedEvent=i(this,"checkout-changed"),this.plaidService=new _,this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:s,error:a}=t.detail;e&&i?(h.paymentToken=s,h.selectedPaymentMethod={type:A.APPLE_PAY},this.submitCheckout()):(console.error("Apple Pay completed but failed:",a),this.errorEvent.emit({message:(null==a?void 0:a.message)||"Apple Pay payment failed",errorCode:b.TOKENIZE_ERROR,severity:j.ERROR}))},this.handleApplePayError=t=>{const{error:e,code:i}=t.detail;console.error("Apple Pay error:",e),this.errorEvent.emit({message:e||"Apple Pay error occurred",errorCode:`APPLE_PAY_${i}`,severity:j.ERROR})},this.handleApplePayCancelled=()=>{h.paymentToken=void 0,h.selectedPaymentMethod=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),h.checkoutId=this.checkoutId;const t={authToken:this.authToken,checkoutId:this.checkoutId,service:new I};this.getCheckout=(({authToken:t,checkoutId:e,service:i})=>async({onSuccess:s,onError:a})=>{var n;try{const o=await i.fetchCheckout(t,e);if(o.error)return a({error:D(o.error),code:N(null===(n=o.error)||void 0===n?void 0:n.code),severity:j.ERROR});s({checkout:o.data})}catch(t){const e=N(null==t?void 0:t.code);return a({error:t.message||t,code:e,severity:j.ERROR})}})(t),this.completeCheckout=(({authToken:t,checkoutId:e,service:i})=>async({payment:s,onSuccess:a,onError:n})=>{var o;try{const r=await i.complete(t,e,s);if(r.error)return n({error:D(r.error),code:N(null===(o=r.error)||void 0===o?void 0:o.code),severity:j.ERROR});a({checkout:r.data})}catch(t){const e=N(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:j.ERROR})}})(t),l((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new f(this),k(),h.authToken=this.authToken,this.fetchCheckout(),p("set",(t=>{const e=v[t];void 0!==e&&M(t,e)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this.removeApplePayListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{this.updateStore(t),t.status!==w.completed?t.status!==w.expired||this.errorEvent.emit({message:T.CHECKOUT_EXPIRED,errorCode:b.CHECKOUT_EXPIRED,severity:j.ERROR}):this.errorEvent.emit({message:T.CHECKOUT_ALREADY_COMPLETED,errorCode:b.CHECKOUT_ALREADY_COMPLETED,severity:j.ERROR})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:t.code,severity:t.severity})}}):this.errorEvent.emit({message:T.NOT_AUTHENTICATED,errorCode:b.NOT_AUTHENTICATED,severity:j.ERROR})}updateStore(t){var e,i,s,a,n;h.accountId=t.account_id,h.checkoutLoaded=!0,h.paymentMethods=t.payment_methods.map((t=>new E(t))),h.paymentMethodGroupId=t.payment_method_group_id,h.paymentDescription=t.payment_description,h.totalAmount=t.total_amount,h.paymentAmount=t.payment_amount,h.bnplEnabled=t.payment_settings.bnpl_payments,h.insuranceEnabled=t.payment_settings.insurance_payments,h.bankAccountVerification=null===(e=t.payment_settings)||void 0===e?void 0:e.bank_account_verification,h.bnplProviderClientId=null===(i=null==t?void 0:t.bnpl)||void 0===i?void 0:i.provider_client_id,h.bnplProviderMode=null===(s=null==t?void 0:t.bnpl)||void 0===s?void 0:s.provider_mode,h.bnplProviderApiVersion=null===(a=null==t?void 0:t.bnpl)||void 0===a?void 0:a.provider_api_version,h.bnplProviderCheckoutUrl=null===(n=null==t?void 0:t.bnpl)||void 0===n?void 0:n.provider_checkout_url}emitCheckoutChanged(){const t={availablePaymentMethodTypes:c(),selectedPaymentMethod:h.selectedPaymentMethod,savedPaymentMethods:h.paymentMethods};this.checkoutChangedEvent.emit(t)}queryFormRefs(){this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}async tokenizePaymentMethod(t){var e,i,s;const a=null!==(i=await(null===(e=this.billingFormRef)||void 0===e?void 0:e.getValues()))&&void 0!==i?i:{},n=Object.assign(Object.assign({},t),a),o=Object.assign({accountId:h.accountId,payment_method_group_id:void 0},n);h.savePaymentMethod&&(o.payment_method_group_id=h.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:o,account:h.accountId}));return r.error?r:(h.paymentToken=r.id,r.id)}async setSelectedPaymentMethod(t){h.selectedPaymentMethod=t,h.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];h.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(t=h.selectedPaymentMethod)||void 0===t?void 0:t.type)===A.NEW_CARD,a=(null===(e=h.selectedPaymentMethod)||void 0===e?void 0:e.type)===A.NEW_BANK_ACCOUNT;if((s||a)&&(this.paymentMethodFormRef&&i.push(this.paymentMethodFormRef.validate()),this.billingFormRef&&i.push(this.billingFormRef.validate())),0===i.length)return!0;try{return!!(await Promise.all(i)).every((t=>"boolean"==typeof t?t:!1!==(null==t?void 0:t.isValid)))||(this.errorEvent.emit({message:"Validation error",errorCode:b.VALIDATION_ERROR,severity:j.ERROR}),!1)}catch(t){return!1}}async submitCheckout(t){var e,i,s,a,n;const o=await this.validate();if(!h.selectedPaymentMethod)return void this.errorEvent.emit({message:"No payment method selected.",errorCode:b.VALIDATION_ERROR,severity:j.ERROR});const r=(null===(e=h.selectedPaymentMethod)||void 0===e?void 0:e.type)===A.NEW_CARD,l=(null===(i=h.selectedPaymentMethod)||void 0===i?void 0:i.type)===A.NEW_BANK_ACCOUNT,c=(null===(s=h.selectedPaymentMethod)||void 0===s?void 0:s.type)===A.PLAID;if(r||l){const e=await this.tokenizePaymentMethod(t);if(null==e?void 0:e.error)return void this.errorEvent.emit({message:e.error.message,errorCode:b.TOKENIZE_ERROR,severity:j.ERROR})}if(c&&!h.paymentToken){const t=h.plaidPublicToken,e=h.plaidLinkTokenId;if(!t)return void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:b.TOKENIZE_ERROR,severity:j.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(h.authToken,h.accountId,t,e||void 0,h.savePaymentMethod?h.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:b.TOKENIZE_ERROR,severity:j.ERROR});const s=null==i?void 0:i.data,n=(null===(a=null==s?void 0:s.bank_account)||void 0===a?void 0:a.token)||(null==s?void 0:s.token)||(null==s?void 0:s.id);h.paymentToken=n}catch(t){return void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:b.TOKENIZE_ERROR,severity:j.ERROR})}}if(!o)return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:b.VALIDATION_ERROR,severity:j.ERROR});if(!h.paymentToken)return void this.errorEvent.emit({message:"Payment token not found.",errorCode:b.TOKENIZE_ERROR,severity:j.ERROR});let d;d={payment_mode:(t=>{switch(t){case A.NEW_CARD:case A.SAVED_CARD:case A.NEW_BANK_ACCOUNT:case A.SAVED_BANK_ACCOUNT:case A.PLAID:return P.ECOM;case A.SEZZLE:return P.BNPL;case A.APPLE_PAY:return P.APPLE_PAY;default:return}})(null===(n=h.selectedPaymentMethod)||void 0===n?void 0:n.type),payment_token:h.paymentToken},this.completeCheckout({payment:d,onSuccess:({checkout:t})=>{this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:b.COMPLETE_CHECKOUT_ERROR,severity:j.ERROR})}})}render(){return e(s,{key:"dbe1fe78f8206fef2e3f4f51628d716786dea858"})}get hostEl(){return a(this)}};var R;!function(t){t.PLAID_SDK_LOAD_FAILED="plaid-sdk-load-failed",t.PLAID_LINK_INIT_FAILED="plaid-link-init-failed",t.PLAID_LINK_TOKEN_FAILED="plaid-link-token-failed",t.PLAID_AUTHENTICATION_FAILED="plaid-authentication-failed",t.PLAID_BANK_NOT_SUPPORTED="plaid-bank-not-supported",t.PLAID_TOKEN_EXPIRED="plaid-token-expired",t.PLAID_NETWORK_ERROR="plaid-network-error",t.PLAID_USER_CANCELLED="plaid-user-cancelled",t.PLAID_TIMEOUT="plaid-timeout",t.PLAID_INVALID_CREDENTIALS="plaid-invalid-credentials",t.PLAID_ACCOUNT_LOCKED="plaid-account-locked",t.PLAID_MAINTENANCE="plaid-maintenance",t.PLAID_RATE_LIMITED="plaid-rate-limited"}(R||(R={}));const U={[R.PLAID_SDK_LOAD_FAILED]:"Unable to load Plaid. Please refresh the page and try again.",[R.PLAID_LINK_INIT_FAILED]:"Unable to initialize bank connection. Please try again.",[R.PLAID_LINK_TOKEN_FAILED]:"Unable to connect to bank service. Please try again.",[R.PLAID_AUTHENTICATION_FAILED]:"Bank authentication failed. Please try again.",[R.PLAID_BANK_NOT_SUPPORTED]:"Your bank is not currently supported. Please try a different payment method.",[R.PLAID_TOKEN_EXPIRED]:"Your bank session has expired. Please reconnect your account.",[R.PLAID_NETWORK_ERROR]:"Network connection issue. Please check your internet connection and try again.",[R.PLAID_USER_CANCELLED]:"Bank connection was cancelled. Click to try again.",[R.PLAID_TIMEOUT]:"Bank connection timed out. Please try again.",[R.PLAID_INVALID_CREDENTIALS]:"Invalid bank credentials. Please check your username and password.",[R.PLAID_ACCOUNT_LOCKED]:"Your bank account is temporarily locked. Please contact your bank.",[R.PLAID_MAINTENANCE]:"Bank service is temporarily unavailable. Please try again later.",[R.PLAID_RATE_LIMITED]:"Too many connection attempts. Please wait a moment and try again."},B={[R.PLAID_SDK_LOAD_FAILED]:j.ERROR,[R.PLAID_LINK_INIT_FAILED]:j.ERROR,[R.PLAID_LINK_TOKEN_FAILED]:j.ERROR,[R.PLAID_AUTHENTICATION_FAILED]:j.ERROR,[R.PLAID_BANK_NOT_SUPPORTED]:j.WARNING,[R.PLAID_TOKEN_EXPIRED]:j.WARNING,[R.PLAID_NETWORK_ERROR]:j.WARNING,[R.PLAID_USER_CANCELLED]:j.INFO,[R.PLAID_TIMEOUT]:j.WARNING,[R.PLAID_INVALID_CREDENTIALS]:j.ERROR,[R.PLAID_ACCOUNT_LOCKED]:j.ERROR,[R.PLAID_MAINTENANCE]:j.WARNING,[R.PLAID_RATE_LIMITED]:j.WARNING},Q=class{constructor(e){t(this,e),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.plaidError=i(this,"plaidError"),this.plaidErrorRecovered=i(this,"plaidErrorRecovered"),this.isAuthenticating=!1,this.publicToken=null,this.linkToken=null,this.linkTokenId=null,this.error=null,this.plaidLink=null,this.isSelected=!1,this.retryCount=0,this.isRetrying=!1,this.plaidService=new _,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{h.authToken&&h.accountId&&h.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:R.PLAID_SDK_LOAD_FAILED,message:U[R.PLAID_SDK_LOAD_FAILED],severity:B[R.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:R.PLAID_LINK_TOKEN_FAILED,message:U[R.PLAID_LINK_TOKEN_FAILED],severity:B[R.PLAID_LINK_TOKEN_FAILED],retryable:!0,userAction:"Click to try again"});const t=window.Plaid;this.plaidLink=t.create({token:this.linkToken,onSuccess:this.handlePlaidSuccess,onExit:this.handlePlaidExit,onEvent:this.handlePlaidEvent,onLoad:this.handlePlaidLoad})}catch(t){this.handleError({code:R.PLAID_LINK_INIT_FAILED,message:U[R.PLAID_LINK_INIT_FAILED],severity:B[R.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,s,a;try{if(!h.authToken||!h.accountId)return void this.handleError({code:R.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:j.ERROR,retryable:!1,userAction:"Refresh the page"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var t;null===(t=this.abortController)||void 0===t||t.abort()}),3e4);const e=await this.plaidService.getLinkToken(h.authToken,h.accountId,h.checkoutId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),e.error)throw new Error("string"==typeof e.error?e.error:e.error.message||"Failed to get link token");this.linkToken=e.data.link_token,this.linkTokenId=(null==e?void 0:e.id)||(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)||null,this.linkTokenId&&(h.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let n=R.PLAID_LINK_TOKEN_FAILED,o=U[n],r=!0;"AbortError"===t.name?(n=R.PLAID_TIMEOUT,o=U[n],r=!0):(null===(e=t.message)||void 0===e?void 0:e.includes("network"))||(null===(i=t.message)||void 0===i?void 0:i.includes("fetch"))?(n=R.PLAID_NETWORK_ERROR,o=U[n],r=!0):((null===(s=t.message)||void 0===s?void 0:s.includes("401"))||(null===(a=t.message)||void 0===a?void 0:a.includes("unauthorized")))&&(n=R.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:n,message:o,severity:B[n],originalError:t,retryable:r,userAction:r?"Click to try again":"Refresh the page"})}},this.mapApiErrorToPlaidError=t=>{if("string"==typeof t){if(t.includes("rate_limit"))return R.PLAID_RATE_LIMITED;if(t.includes("maintenance"))return R.PLAID_MAINTENANCE;if(t.includes("not_authenticated"))return R.PLAID_INVALID_CREDENTIALS}if(null==t?void 0:t.code)switch(t.code){case"rate_limited":return R.PLAID_RATE_LIMITED;case"maintenance":return R.PLAID_MAINTENANCE;case"not_authenticated":return R.PLAID_INVALID_CREDENTIALS;default:return R.PLAID_LINK_TOKEN_FAILED}return R.PLAID_LINK_TOKEN_FAILED},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=t=>{this.publicToken=t,this.isAuthenticating=!1,this.clearError(),this.retryCount=0,this.isSelected||(this.isSelected=!0,h.selectedPaymentMethod={type:A.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:j.INFO}),h.plaidPublicToken=t},this.handlePlaidExit=t=>{this.isAuthenticating=!1,t&&this.handlePlaidError(t)},this.handlePlaidEvent=(t,e)=>{switch(t){case"OPEN":this.isAuthenticating=!0;break;case"CLOSE":this.isAuthenticating=!1;break;case"ERROR":this.handlePlaidError(e)}},this.handlePlaidLoad=()=>{},this.handlePlaidError=t=>{let e=R.PLAID_AUTHENTICATION_FAILED,i=U[e],s=!0,a="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=R.PLAID_INVALID_CREDENTIALS,i=U[e],s=!0;break;case"ITEM_LOGIN_REQUIRED":e=R.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":e=R.PLAID_ACCOUNT_LOCKED,i=U[e],s=!1,a="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=R.PLAID_MAINTENANCE,i=U[e],s=!0;break;case"RATE_LIMIT_EXCEEDED":e=R.PLAID_RATE_LIMITED,i=U[e],s=!0;break;case"INVALID_REQUEST":e=R.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":e=R.PLAID_AUTHENTICATION_FAILED,i=t.error_message||"Bank authentication failed. Please try again.",s=!0;break;default:t.error_message&&(i=t.error_message)}if(t.error_message){const n=t.error_message.toLowerCase();n.includes("not supported")||n.includes("unsupported")?(e=R.PLAID_BANK_NOT_SUPPORTED,i=U[e],s=!1,a="Try a different payment method"):(n.includes("expired")||n.includes("timeout"))&&(e=R.PLAID_TOKEN_EXPIRED,i=U[e],s=!0)}this.handleError({code:e,message:i,severity:B[e],originalError:t,retryable:s,userAction:a}),this.isAuthenticating=!1},this.handleError=t=>{this.error=t,this.plaidError.emit({code:t.code,message:t.message,severity:t.severity,data:{originalError:t.originalError,retryable:t.retryable,userAction:t.userAction,retryCount:this.retryCount}}),console.error("Plaid error:",t),t.retryable&&this.retryCount<this.maxRetries&&this.scheduleRetry()},this.scheduleRetry=()=>{this.isRetrying||(this.isRetrying=!0,this.retryCount++,setTimeout((()=>{this.isRetrying=!1,this.clearError(),this.waitForStoreAndInitialize()}),this.retryDelay*this.retryCount))},this.clearError=()=>{this.error&&(this.error=null,this.retryCount=0)},this.syncWithStore=()=>{var t;const e=(null===(t=h.selectedPaymentMethod)||void 0===t?void 0:t.type)===A.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=h.selectedPaymentMethod)||void 0===e?void 0:e.type)!==A.PLAID&&(h.selectedPaymentMethod={type:A.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.waitForStoreAndInitialize()},this.scriptRef.onerror=()=>{this.handleError({code:R.PLAID_SDK_LOAD_FAILED,message:U[R.PLAID_SDK_LOAD_FAILED],severity:B[R.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}componentWillLoad(){var t;this.isSelected=(null===(t=h.selectedPaymentMethod)||void 0===t?void 0:t.type)===A.PLAID}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return h.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,h.selectedPaymentMethod={type:A.PLAID},this.error)return this.clearError(),void this.waitForStoreAndInitialize();!this.plaidLink||this.publicToken||this.isAuthenticating||this.openPlaidLink()}async setSelected(t){this.isSelected=t,t&&(h.selectedPaymentMethod={type:A.PLAID})}async isCurrentlySelected(){return this.isSelected}async deselect(){this.isSelected=!1}async reset(){this.publicToken=null,this.clearError(),this.isAuthenticating=!1,this.linkToken=null,this.plaidLink=null,this.retryCount=0,this.isRetrying=!1,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.abortController&&(this.abortController.abort(),this.abortController=null)}async isReadyForAuthentication(){return!(!this.plaidLink||!this.linkToken||this.isAuthenticating)}async retry(){this.error&&this.error.retryable&&(this.clearError(),this.waitForStoreAndInitialize())}async getErrorInfo(){return this.error}componentDidLoad(){const t=d("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=t}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(!0!==h.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[PlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const t=e("img",{class:"plaid-logo-img",src:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=",alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return e(u,{class:"payment-method"},e("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:t=>this.scriptRef=t}),e("div",{title:"Pay with Plaid"},e("div",{onClick:t=>{t.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",t," "),(()=>this.error?e("div",{class:(this.error.severity===j.ERROR?"text-danger":this.error.severity===j.WARNING?"text-warning":"text-info")+" mt-2"},e("small",null,this.error.message),e("br",null),e("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&e("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?e("div",{class:"text-info mt-2"},e("small",null,"Connecting to your bank...")):this.publicToken?e("div",{class:"text-success mt-2"},e("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:e("div",{class:"text-muted mt-2"},e("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},Y=class{constructor(e){t(this,e),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),h.selectedPaymentMethod={id:t.id,type:t.type},h.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===A.SAVED_CARD&&h.disableCreditCard||t===A.SAVED_BANK_ACCOUNT&&h.disableBankAccount)}componentWillLoad(){h.paymentMethods.length||console.warn("No saved payment methods available."),h.disablePaymentMethodGroup&&console.warn("Payment method group is disabled.")}render(){return h.disablePaymentMethodGroup?null:e(u,null,e("div",{class:"saved-payment-methods"},h.paymentMethods.length?h.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((t=>e("div",{class:"radio-list-item p-3",part:o,onClick:this.onPaymentMethodOptionClick(t)},e("form-control-radio",{name:"paymentMethodType",value:null==t?void 0:t.id,checked:h.paymentToken===(null==t?void 0:t.id),label:`${x[null==t?void 0:t.brand]||""} *${null==t?void 0:t.acct_last_four}`})))):null))}},F=e("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),H=class{constructor(e){t(this,e),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.paymentMethodOptionId=A.SEZZLE,this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((e=>{t=e}));const e=Number(h.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:h.bnplProviderClientId,apiMode:h.bnplProviderMode,apiVersion:h.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(t){t.preventDefault(),i.startCheckout({checkout_url:h.bnplProviderCheckoutUrl})},onComplete:e=>t({bnpl:e.data}),onCancel:e=>t({bnpl:e.data}),onFailure:e=>t({bnpl:e.data})}),this.sezzleCheckout=i,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(e)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(t){return t.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}async handleSelectionClick(){h.selectedPaymentMethod={type:A.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var t,i;return!h.bnplEnabled||h.disableBnpl?(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null):e(u,{class:"payment-method"},e("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),e("div",null,e("div",null,"Buy now, pay later with ",F),this.installmentPlan&&e("small",null,e("span",null,null===(t=this.installmentPlan)||void 0===t?void 0:t.installments.length)," ",e("span",null,this.installmentPlan.schedule," payments of")," ",e("span",{class:"fw-bold"},r(null===(i=this.installmentPlan)||void 0===i?void 0:i.installments[0].amountInCents)))))}},V={[A.NEW_BANK_ACCOUNT]:"New bank account",[A.NEW_CARD]:"New credit or debit card"},Z="Payment form not ready",W="Validation error",q=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){k(),this.analytics=new f(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,h.selectedPaymentMethod={type:t.detail}}async fillBillingForm(t){var e;null===(e=this.billingFormRef)||void 0===e||e.fill(t)}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:b.TOKENIZE_ERROR,message:W}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(b.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:b.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:Z}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||h.authToken,account:this.accountId||h.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||h.authToken||this.emitError({errorCode:b.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||h.accountId||this.emitError({errorCode:b.TOKENIZE_ERROR,message:"Account ID is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"})}setDefaultSelectedPaymentMethod(){this.selectedPaymentMethod||(this.disableCreditCard?this.disableBankAccount||(this.selectedPaymentMethod=A.NEW_BANK_ACCOUNT,h.selectedPaymentMethod={type:A.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=A.NEW_CARD,h.selectedPaymentMethod={type:A.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const t=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=t}isSlottedWithinModularCheckout(){var t;let e=null===(t=this.host)||void 0===t?void 0:t.parentElement;for(;e;){if("JUSTIFI-MODULAR-CHECKOUT"===e.tagName)return!0;e=e.parentElement}return!1}get availablePaymentMethods(){const t=[];return this.disableCreditCard||t.push(A.NEW_CARD),this.disableBankAccount||t.push(A.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:j.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",Z);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||W;return{validationError:!0,error:{code:"validation_error",message:String(t),decline_code:void 0}}}return await this.performTokenization()}catch(t){return{error:t}}}async performTokenization(){var t,e;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(t=s.card)||void 0===t?void 0:t.token)||(null===(e=s.bank_account)||void 0===e?void 0:e.token),data:s}}buildPaymentMethodMetadata(t){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},t)}get paymentMethodGroupID(){return this.paymentMethodGroupId||h.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!h.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const i=this.selectedPaymentMethod===t&&void 0===h.selectedPaymentMethod.id;return e("div",{class:"payment-method"},e("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:i,label:V[t],hidden:this.shouldHideRadioInput}),i&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return e("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),e("div",{class:"mt-4"},e("justifi-billing-form",{ref:t=>this.billingFormRef=t,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),e("div",{class:"mt-4"},e("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return e(t===A.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:t=>this.paymentMethodFormRef=t})}render(){return e(u,{key:"5fc5dad15215fe24b421f4d6c13355fb849b8a76"},e("form",{key:"0e0330e5b11ee3ae0bef9e092fa2fb2a0a6af3e7"},e("fieldset",{key:"ee4c026ccda62a249e019a9e105e40ea465fc400"},e("div",{key:"15a8a86fa5be8a545745260d76a8c3b2569d6a0e",class:"row gy-3"},e("div",{key:"bbbeed6ee96311394a876b4beb206e8e335184c2",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),e("div",{key:"da2a2009abe4348e25a5fc712557e81e9f6c4c1f",class:"col-12"},e("justifi-button",{key:"050939c757999383226f281ee0eff1ec178be203",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return a(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}};export{z as justifi_checkout_summary,L as justifi_header,S as justifi_modular_checkout,Q as justifi_plaid_payment_method,Y as justifi_saved_payment_methods,H as justifi_sezzle_payment_method,q as justifi_tokenize_payment_method}
@@ -1 +1 @@
1
- import{r as e,h as t,H as a,c as s,g as r}from"./p-qipqIMyC.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import{E as i}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as o}from"./p-yH3TC3ZQ.js";import"./p-XYgDHrVL.js";import{n as l}from"./p-BnjCmwMr.js";import{s as c,e as d,j as n}from"./p-BHf9IqGw.js";import{Y as f,C as b,aj as h,N as p,ak as m,c as u,l as y,b as k,T as _,a as v}from"./p-RvUQ__Pq.js";import{S as x}from"./p-Xv8DuU3Y.js";import"./p-CZfYo5-1.js";import{F as j}from"./p-DCMrHeJI.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const g=class{constructor(t){e(this,t)}render(){return t("div",{key:"23f5fa6b191b3feea7677a85a421002642a86f50",class:"row gy-3"},t("div",{key:"da9d9698f15aeb4bb05baef8fb63c630fcff8a82",class:"col-12"},t("form-control-file",{key:"b84a8ec1753210f74989c04b5520f0e94c5a083d",name:"voided_check",label:"Voided Check",documentType:i.voidedCheck,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.voided_check,multiple:!0})),t("div",{key:"06d442df900406f122970bde6b2b293f2c9080ee",class:"col-12"},t("form-control-file",{key:"b3dc1d48900c5932c4d59f8b31a323193f0e86b4",name:"bank_statement",label:"Bank Statement",documentType:i.bankStatement,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.bank_statement,multiple:!0})))}},T=class{constructor(t){e(this,t)}render(){return t("div",{key:"da4dc9523bca84cdd02f7e5d47e513c426ed90fd",class:"row gy-3"},t("div",{key:"b625a293dec704cbbb132469fdbc8c5d99a660e1",class:"col-12"},t("form-control-text",{key:"b41460ddc605f73faf71233ccbbef7e34e690e5a",name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler,disabled:this.formDisabled})),t("div",{key:"e5560bcdba399baa2e54441436ef5c67936e9fef",class:"col-12"},t("form-control-text",{key:"18cd16931899f724fd92cb89f1b8d4cd41c5354c",name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler,disabled:this.formDisabled})),t("div",{key:"3bb589db98e5d65022576b602bda41f36e3a90d5",class:"col-12"},t("form-control-text",{key:"c870513b8895add114d5ec588561fa6f33a63514",name:"account_owner_name",label:"Account Owner Name",defaultValue:this.defaultValue.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler,disabled:this.formDisabled})),t("div",{key:"1783e7b4af2b012338fe2e1b4f1faa9b5e086bcd",class:"col-12"},t("form-control-select",{key:"6a9af0f6edeae133dce04b7f829abb802db4ac83",name:"account_type",label:"Account Type",options:o,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler,disabled:this.formDisabled})),t("div",{key:"3c3ffced96f67320b4c580be6f28dd8ef5d2c109",class:"col-12"},t("form-control-text",{key:"e85df115a9de08ad9abb3237f7bf6c6d23c84150",name:"account_number",label:"Account Number",defaultValue:this.defaultValue.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:l,disabled:this.formDisabled,helpText:"Please copy the account number as shown on your statement/check. Do not include spaces or dashes."})),t("div",{key:"5a25cb25160aff24d1f62df2115dbd248709141e",class:"col-12"},t("form-control-text",{key:"dfdf7dce470efb8eea65aa6daf562d190963bace",name:"routing_number",label:"Routing Number",defaultValue:this.defaultValue.routing_number,maxLength:9,errorText:this.errors.routing_number,inputHandler:this.inputHandler,keyDownHandler:l,disabled:this.formDisabled,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))}},H=class{constructor(t){e(this,t),this.documents=[],this.isLoading=!1}render(){return this.isLoading?t(x,{height:"50px"}):this.documents.length?t(a,null,t("div",{class:"card",part:f},t("div",{class:"card-body"},t("h5",{class:"card-title",part:b},"Documents Already on File"),t("div",{class:"table-responsive"},t("table",{class:"table table-sm table-borderless",part:h},t("thead",null,t("tr",null,t("th",{style:{width:"25%"},part:p,scope:"col"},"File Name"),t("th",{style:{width:"25%"},part:p,scope:"col"},"File Type"),t("th",{style:{width:"25%"},part:p,scope:"col"},"Document Type"),t("th",{style:{width:"25%"},part:p,scope:"col"},"Date Uploaded"))),t("tbody",null,this.documents.sort(((e,t)=>e.document_type.localeCompare(t.document_type))).map(((e,a)=>t("tr",{class:0===a?"border-bottom border-top":"border-bottom"},t("td",{part:m},e.file_name),t("td",{part:m},e.file_type),t("td",{part:m},c(e.document_type)),t("td",{part:m},`${d(e.created_at)} - ${n(e.created_at)}`))))))))),t("hr",null)):null}},w=class{constructor(t){e(this,t),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.fileSelected=s(this,"fileSelected"),this.isFocused=!1,this.handleFormControlInput=e=>{const t=e.target,a=t.getAttribute("name");this.inputHandler(a,t.value),this.formControlInput.emit({name:a,value:t.value})},this.changeHandler=()=>{const e=this.fileInput.files;e&&this.fileSelected.emit({fileList:e,document_type:this.documentType})}}componentDidLoad(){this.fileInput=this.el.querySelector("input")}get part(){let e=u;return this.errorText&&(e=k),this.disabled&&(e=_),this.isFocused&&(e=v),e}render(){return t(a,{key:"3f6adbe90fc89972562f658958433d77ca9ad67c"},t("div",{key:"522ea5f78109a2717e8b016c16d29c9444ebf0c2",class:"form-group d-flex flex-column"},t("div",{key:"39647185cf2b6fbe4317aa5ae609a971161974a7",class:"d-flex align-items-start gap-2"},t("label",{key:"18d7f1e782c74bfd9a1aad52c70d451e2d7ebdd5",part:y,class:"form-label",htmlFor:this.name},this.label),t("form-control-tooltip",{key:"3eab40969bc7d68b195093f7671244a2c1a0f537",helpText:this.helpText})),t("input",{key:"0acb164fc09a23fd8a8937222f527052bb02248e",ref:e=>this.fileInput=e,type:"file",name:this.name,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onChange:this.changeHandler,onInput:this.handleFormControlInput,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()}}),t(j,{key:"03689848a01a3844dcf4480d5f997a3a52338ea1",errorText:this.errorText,name:this.name})))}get el(){return r(this)}};export{g as bank_account_document_form_inputs,T as bank_account_form_inputs,H as business_documents_on_file,w as form_control_file}
1
+ import{r as e,h as t,H as a,c as s,g as r}from"./p-qipqIMyC.js";import"./p-Bp_QFeog.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import{E as i}from"./p-c4Mh3ZZ_.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as o}from"./p-yH3TC3ZQ.js";import"./p-XYgDHrVL.js";import{n as c}from"./p-BnjCmwMr.js";import{s as l,e as d,j as n}from"./p-BHf9IqGw.js";import{Y as f,C as b,aj as h,N as p,ak as m,c as u,l as y,b as k,T as _,a as v}from"./p-RvUQ__Pq.js";import{S as x}from"./p-Xv8DuU3Y.js";import"./p-CZfYo5-1.js";import{F as j}from"./p-DCMrHeJI.js";import"./p-DsAwPf2y.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const g=class{constructor(t){e(this,t)}render(){return t("div",{key:"c62d858a070a4611bead814bacd350e7faa4b400",class:"row gy-3"},t("div",{key:"0044e508f449953f9da16907d1a141a0b4b42f1f",class:"col-12"},t("form-control-file",{key:"add74fc5424ffdb64dbae5b2e0dddde39544e5e3",name:"voided_check",label:"Voided Check",documentType:i.voidedCheck,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.voided_check,multiple:!0})),t("div",{key:"0d69209999cb8ded788a12ac3bd46360a73b1443",class:"col-12"},t("form-control-file",{key:"73cf74f2a2cd19db35ac9e5191cb59a99098806b",name:"bank_statement",label:"Bank Statement",documentType:i.bankStatement,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.bank_statement,multiple:!0})))}},T=class{constructor(t){e(this,t)}render(){return t("div",{key:"1628c5430b9235c9e03eff78ccdbf9af49c7f455",class:"row gy-3"},t("div",{key:"c4af1f6adcf00c67cfc1c3e962ba716c471f8176",class:"col-12"},t("form-control-text",{key:"3cb9addf2e55fb8d7f653621d3adccf17ff0bc3d",name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler,disabled:this.formDisabled})),t("div",{key:"1eb8b918e676b267caa0c8808a4dbde740ca46df",class:"col-12"},t("form-control-text",{key:"e540eeac2975e58fb5a28dc670441babdc62f857",name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler,disabled:this.formDisabled})),t("div",{key:"102078fb6d9bc409abe06d7ef4d3bbc11edc1f7a",class:"col-12"},t("form-control-text",{key:"51f7801dab1d69ea38891e5b31c3c23166d2bdc6",name:"account_owner_name",label:"Account Owner Name",defaultValue:this.defaultValue.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler,disabled:this.formDisabled})),t("div",{key:"66d068a5c05b643e03f45f6cdb0a4f76720d5832",class:"col-12"},t("form-control-select",{key:"5fa5b53dc35132b0d4948d8ca857563e726599bb",name:"account_type",label:"Account Type",options:o,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler,disabled:this.formDisabled})),t("div",{key:"522d348ea1460b7d645028a5174fce5bd6704adb",class:"col-12"},t("form-control-text",{key:"b2f3c8f097c5f0956252ada807f75d80f0c20225",name:"account_number",label:"Account Number",defaultValue:this.defaultValue.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:c,disabled:this.formDisabled,helpText:"Please copy the account number as shown on your statement/check. Do not include spaces or dashes."})),t("div",{key:"627bfec99086214dad9f938a7c6f6650bb1023b8",class:"col-12"},t("form-control-text",{key:"a21cff4dbcbfb85dc851f1905a0dbeb99df81325",name:"routing_number",label:"Routing Number",defaultValue:this.defaultValue.routing_number,maxLength:9,errorText:this.errors.routing_number,inputHandler:this.inputHandler,keyDownHandler:c,disabled:this.formDisabled,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))}},H=class{constructor(t){e(this,t),this.documents=[],this.isLoading=!1}render(){return this.isLoading?t(x,{height:"50px"}):this.documents.length?t(a,null,t("div",{class:"card",part:f},t("div",{class:"card-body"},t("h5",{class:"card-title",part:b},"Documents Already on File"),t("div",{class:"table-responsive"},t("table",{class:"table table-sm table-borderless",part:h},t("thead",null,t("tr",null,t("th",{style:{width:"25%"},part:p,scope:"col"},"File Name"),t("th",{style:{width:"25%"},part:p,scope:"col"},"File Type"),t("th",{style:{width:"25%"},part:p,scope:"col"},"Document Type"),t("th",{style:{width:"25%"},part:p,scope:"col"},"Date Uploaded"))),t("tbody",null,this.documents.sort(((e,t)=>e.document_type.localeCompare(t.document_type))).map(((e,a)=>t("tr",{class:0===a?"border-bottom border-top":"border-bottom"},t("td",{part:m},e.file_name),t("td",{part:m},e.file_type),t("td",{part:m},l(e.document_type)),t("td",{part:m},`${d(e.created_at)} - ${n(e.created_at)}`))))))))),t("hr",null)):null}},w=class{constructor(t){e(this,t),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.fileSelected=s(this,"fileSelected"),this.isFocused=!1,this.handleFormControlInput=e=>{const t=e.target,a=t.getAttribute("name");this.inputHandler(a,t.value),this.formControlInput.emit({name:a,value:t.value})},this.changeHandler=()=>{const e=this.fileInput.files;e&&this.fileSelected.emit({fileList:e,document_type:this.documentType})}}componentDidLoad(){this.fileInput=this.el.querySelector("input")}get part(){let e=u;return this.errorText&&(e=k),this.disabled&&(e=_),this.isFocused&&(e=v),e}render(){return t(a,{key:"3f6adbe90fc89972562f658958433d77ca9ad67c"},t("div",{key:"522ea5f78109a2717e8b016c16d29c9444ebf0c2",class:"form-group d-flex flex-column"},t("div",{key:"39647185cf2b6fbe4317aa5ae609a971161974a7",class:"d-flex align-items-start gap-2"},t("label",{key:"18d7f1e782c74bfd9a1aad52c70d451e2d7ebdd5",part:y,class:"form-label",htmlFor:this.name},this.label),t("form-control-tooltip",{key:"3eab40969bc7d68b195093f7671244a2c1a0f537",helpText:this.helpText})),t("input",{key:"0acb164fc09a23fd8a8937222f527052bb02248e",ref:e=>this.fileInput=e,type:"file",name:this.name,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onChange:this.changeHandler,onInput:this.handleFormControlInput,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()}}),t(j,{key:"03689848a01a3844dcf4480d5f997a3a52338ea1",errorText:this.errorText,name:this.name})))}get el(){return r(this)}};export{g as bank_account_document_form_inputs,T as bank_account_form_inputs,H as business_documents_on_file,w as form_control_file}
@@ -1 +1 @@
1
- import{r as e,c as t,h as s}from"./p-qipqIMyC.js";import{f as i}from"./p-BHf9IqGw.js";import{z as a,ai as r}from"./p-RvUQ__Pq.js";import{B as d}from"./p-D6XirF21.js";import{S as c}from"./p-CLQx9p9q.js";import{S as o}from"./p-Xv8DuU3Y.js";import"./p-CZfYo5-1.js";import{C as n,a as h}from"./p-Cjcsf8ku.js";import{g as p,a as f}from"./p-D2muobcE.js";import{D as l}from"./p-DyOgQlh2.js";import{D as u}from"./p-Bg2SZArf.js";import{c as y,J as b}from"./p-D_5McRD_.js";import"./p-HXpYMWUU.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-BBpkkt2-.js";const m=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.submitEvent=t(this,"submit-event")}acceptDispute(){m({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"0f1028825a7a96a06e7219518ffed54bc0db1b2b"},this.isLoading&&s("div",{key:"f4b704182a5a7085827854634d38c56423cc2e1b",style:{marginBottom:"8px"}},s(o,{key:"b2062d8b683ab110c26fc30f1600c4500f668d87",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"b5d2afe1fdd2e5ee0ec60048a48778bcfa6c78d3",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"1e87c8936b3f2e26e680786927c5a4609aca0b83",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"49090493e3921353b7a830397795496bb234d112",part:a},s("h1",{key:"fd7b56a7cfeaa6820bf2cc121575314d075b5a83",class:"h4",part:r},"This payment is disputed"),s("p",{key:"72ba296695928baca8f7c5c3b1f858c596efedb2"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"cce733ff1bbca7a9530a442035cbae2995e018e7",class:"h5"},"Dispute details"),s("div",{key:"28b7f081e345112d99c52d05f205734995617253",class:"d-table gap-2"},s("div",{key:"d9476d8d0adfa3c6eccad229e94cd3824a720c7d",class:"d-table-row gap-2"},s("span",{key:"4d9e0714eee778c326ee1d70a32f79d90d3d4b09",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"b227edcf9b4b65b790d8aa98021d2662a12855bc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"b1b1cdaac5482f565a6f26af71c0b526b8c19f4e",class:"d-table-row gap-2"},s("span",{key:"0a479a9de96cce6e42bec90a17affe2c93ced44f",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"5d5020dda571f4465e2a358880ad5f20bc6171ea",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"a5f42c3fcbb5d14f8479d0a576d31a50f8fc6441",class:"d-table-row gap-2"},s("span",{key:"280fca5a101eb0e823eb9ccc13c746ac7ed62069",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"4dfc0b9a295ffc804b708d3590358256009e5376",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"654e7baccd08628bc90d050bad108011b49f9972",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"d0817cdb23bf33086c6ce5122f4ed5388027d96c",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"5446bef44a0ca747692d59fd5490409d00a9e285",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"17fbc5902badc4230c5485b326f480180c844768"},s("h1",{key:"fefa0234306588d9e7f56733872bf8c9793f51dd",class:"h4"},"This payment is disputed and under review"),s("p",{key:"eaad72aa8d9f65ca296379a2800180878ec8a7e5"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"ec1b0d728a7518f913c2a69976fa1f5fc8f76c74"},s("h1",{key:"9d42fad15fbeee507e2f364c3a35f143ff7599e2",class:"h4"},"This payment was disputed"),s("p",{key:"3b728a5544fe17a6c58c12f7e8eef290022945b6"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"6d1813508a657265546fbef00bd1e8f46ffaf740"},s("h1",{key:"de981fc2e06e860f47146647975965a903a39b55",class:"h4"},"This payment was disputed"),s("p",{key:"4e57ab86518bd678a3a5402b712d40d573b3a970"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.apiOrigin="https://wc-proxy.justifi.ai",this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)}}componentWillLoad(){y(),this.analytics=new b(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=m({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"dbdfd59a21c7e8ea4dfdaecb91f885f82540a27c"},s("justifi-dispute-response-core",{key:"3cff38e5995f0033c45c54fa195ffeebc27e189e","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.stepCompleteEvent=t(this,"complete-form-step-event"),this.submitEvent=t(this,"submit-event"),this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"20d075178a9d88cd73be32e52f8df6d3d360f8d7",class:"row gy-3"},s("div",{key:"6c1bc735f1a15709c596b5bea7cc3ce50e9a73f5",class:"col-12"},s("h1",{key:"27a0804924937ee7a8d01265bd0da2d9dd31d301",class:"h4",part:r},"Counter dispute")),s("div",{key:"b60822e91425c5c4af003169f47fd725daf9fb0f",class:"col-12"},this.currentStepComponent),s("div",{key:"d1be3f6be53de37836275067070cf4b5a2eb3e4a",class:"col-12"},s("div",{key:"48c8725d8de8b658e59ccfa851a6af6638e19ca5",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{v as justifi_dispute_notification,k as justifi_dispute_response,j as justifi_dispute_response_core}
1
+ import{r as e,c as t,h as s}from"./p-qipqIMyC.js";import{f as i}from"./p-BHf9IqGw.js";import{z as a,ai as r}from"./p-RvUQ__Pq.js";import{B as d}from"./p-D6XirF21.js";import{S as c}from"./p-CLQx9p9q.js";import{S as o}from"./p-Xv8DuU3Y.js";import"./p-CZfYo5-1.js";import{C as n,a as h}from"./p-Cjcsf8ku.js";import{g as p,a as f}from"./p-D2muobcE.js";import{D as l}from"./p-DyOgQlh2.js";import{D as u}from"./p-Bg2SZArf.js";import{c as y,J as b}from"./p-CtA2NMVz.js";import"./p-HXpYMWUU.js";import"./p-BUa0YOaw.js";import"./p-Bp_QFeog.js";import"./p-DsAwPf2y.js";import"./p-c4Mh3ZZ_.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-tyhA5jkt.js";const m=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.submitEvent=t(this,"submit-event")}acceptDispute(){m({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"0f1028825a7a96a06e7219518ffed54bc0db1b2b"},this.isLoading&&s("div",{key:"f4b704182a5a7085827854634d38c56423cc2e1b",style:{marginBottom:"8px"}},s(o,{key:"b2062d8b683ab110c26fc30f1600c4500f668d87",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"b5d2afe1fdd2e5ee0ec60048a48778bcfa6c78d3",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"1e87c8936b3f2e26e680786927c5a4609aca0b83",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"49090493e3921353b7a830397795496bb234d112",part:a},s("h1",{key:"fd7b56a7cfeaa6820bf2cc121575314d075b5a83",class:"h4",part:r},"This payment is disputed"),s("p",{key:"72ba296695928baca8f7c5c3b1f858c596efedb2"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"cce733ff1bbca7a9530a442035cbae2995e018e7",class:"h5"},"Dispute details"),s("div",{key:"28b7f081e345112d99c52d05f205734995617253",class:"d-table gap-2"},s("div",{key:"d9476d8d0adfa3c6eccad229e94cd3824a720c7d",class:"d-table-row gap-2"},s("span",{key:"4d9e0714eee778c326ee1d70a32f79d90d3d4b09",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"b227edcf9b4b65b790d8aa98021d2662a12855bc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"b1b1cdaac5482f565a6f26af71c0b526b8c19f4e",class:"d-table-row gap-2"},s("span",{key:"0a479a9de96cce6e42bec90a17affe2c93ced44f",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"5d5020dda571f4465e2a358880ad5f20bc6171ea",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"a5f42c3fcbb5d14f8479d0a576d31a50f8fc6441",class:"d-table-row gap-2"},s("span",{key:"280fca5a101eb0e823eb9ccc13c746ac7ed62069",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"4dfc0b9a295ffc804b708d3590358256009e5376",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"654e7baccd08628bc90d050bad108011b49f9972",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"d0817cdb23bf33086c6ce5122f4ed5388027d96c",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"5446bef44a0ca747692d59fd5490409d00a9e285",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"17fbc5902badc4230c5485b326f480180c844768"},s("h1",{key:"fefa0234306588d9e7f56733872bf8c9793f51dd",class:"h4"},"This payment is disputed and under review"),s("p",{key:"eaad72aa8d9f65ca296379a2800180878ec8a7e5"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"ec1b0d728a7518f913c2a69976fa1f5fc8f76c74"},s("h1",{key:"9d42fad15fbeee507e2f364c3a35f143ff7599e2",class:"h4"},"This payment was disputed"),s("p",{key:"3b728a5544fe17a6c58c12f7e8eef290022945b6"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"6d1813508a657265546fbef00bd1e8f46ffaf740"},s("h1",{key:"de981fc2e06e860f47146647975965a903a39b55",class:"h4"},"This payment was disputed"),s("p",{key:"4e57ab86518bd678a3a5402b712d40d573b3a970"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.apiOrigin="https://wc-proxy.justifi.ai",this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)}}componentWillLoad(){y(),this.analytics=new b(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=m({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"dbdfd59a21c7e8ea4dfdaecb91f885f82540a27c"},s("justifi-dispute-response-core",{key:"3cff38e5995f0033c45c54fa195ffeebc27e189e","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.stepCompleteEvent=t(this,"complete-form-step-event"),this.submitEvent=t(this,"submit-event"),this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"20d075178a9d88cd73be32e52f8df6d3d360f8d7",class:"row gy-3"},s("div",{key:"6c1bc735f1a15709c596b5bea7cc3ce50e9a73f5",class:"col-12"},s("h1",{key:"27a0804924937ee7a8d01265bd0da2d9dd31d301",class:"h4",part:r},"Counter dispute")),s("div",{key:"b60822e91425c5c4af003169f47fd725daf9fb0f",class:"col-12"},this.currentStepComponent),s("div",{key:"d1be3f6be53de37836275067070cf4b5a2eb3e4a",class:"col-12"},s("div",{key:"48c8725d8de8b658e59ccfa851a6af6638e19ca5",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{v as justifi_dispute_notification,k as justifi_dispute_response,j as justifi_dispute_response_core}