@justifi/webcomponents 6.12.6-rc.1 → 6.12.6

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 (328) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/{Analytics-CexlbLRl.js → Analytics-CuYtRPw5.js} +2 -2
  3. package/dist/cjs/{Plaid-KasiL5mp.js → Plaid-BRSyOOuw.js} +19 -14
  4. package/dist/cjs/{additional-questions-form-step_15.cjs.entry.js → additional-questions-form-step_14.cjs.entry.js} +169 -378
  5. package/dist/cjs/additional-questions_5.cjs.entry.js +7 -7
  6. package/dist/cjs/additional-statement_8.cjs.entry.js +1 -1
  7. package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +4 -4
  8. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  9. package/dist/cjs/{business-form-options-CnlrfbQ6.js → business-form-options-D_nM7NDk.js} +0 -51
  10. package/dist/cjs/{business-identity-schema-CC1wOwXd.js → business-identity-schema-DuFGX6_i.js} +7 -11
  11. package/dist/cjs/{business.service-BBovho58.js → business.service-Z9OACEQL.js} +1 -1
  12. package/dist/cjs/card-form.cjs.entry.js +2 -2
  13. package/dist/cjs/{check-pkg-version-jeIQGJ8A.js → check-pkg-version-CPWLIT6P.js} +1 -1
  14. package/dist/cjs/{checkout.service-C0M9hmsL.js → checkout.service-BZOyqXgW.js} +1 -1
  15. package/dist/cjs/{country-config-Ck-eEeZZ.js → country-config-aJp8ScEs.js} +0 -2
  16. package/dist/cjs/dispute-notification_2.cjs.entry.js +6 -6
  17. package/dist/cjs/{event-types-DDNVjmfR.js → event-types-AU1B76Vm.js} +1 -1
  18. package/dist/cjs/form-address-fields_3.cjs.entry.js +1 -1
  19. package/dist/cjs/form-control-number_2.cjs.entry.js +4 -5
  20. package/dist/cjs/{get-business-Ggw-UjXj.js → get-business-aR-C83KX.js} +2 -2
  21. package/dist/cjs/{get-payment-details-BVKRwME1.js → get-payment-details-dwhA02Zl.js} +2 -2
  22. package/dist/cjs/{get-subaccounts-RRmcS9xU.js → get-subaccounts-B1jmSa2d.js} +2 -2
  23. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  24. package/dist/cjs/{index.esm-BNETBIV_.js → index.esm-C1ZPG85l.js} +18 -0
  25. package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +11 -10
  26. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +5 -5
  27. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -5
  28. package/dist/cjs/justifi-billing-form-full.cjs.entry.js +1 -1
  29. package/dist/cjs/justifi-billing-form.cjs.entry.js +1 -1
  30. package/dist/cjs/justifi-business-details.cjs.entry.js +8 -8
  31. package/dist/cjs/justifi-business-form.cjs.entry.js +13 -13
  32. package/dist/cjs/justifi-card-billing-form-simple.cjs.entry.js +1 -1
  33. package/dist/cjs/justifi-card-form.cjs.entry.js +5 -5
  34. package/dist/cjs/justifi-checkout.cjs.entry.js +5 -5
  35. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +3 -3
  36. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +8 -8
  37. package/dist/cjs/justifi-dispute-management.cjs.entry.js +7 -7
  38. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +6 -6
  39. package/dist/cjs/justifi-order-terminals.cjs.entry.js +9 -9
  40. package/dist/cjs/justifi-payment-details.cjs.entry.js +8 -8
  41. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +9 -9
  42. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +7 -7
  43. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
  44. package/dist/cjs/justifi-payments-list.cjs.entry.js +7 -7
  45. package/dist/cjs/justifi-payout-details.cjs.entry.js +8 -8
  46. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +7 -7
  47. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
  48. package/dist/cjs/justifi-payouts-list.cjs.entry.js +9 -9
  49. package/dist/cjs/justifi-refund-payment.cjs.entry.js +9 -9
  50. package/dist/cjs/justifi-save-new-payment-method.cjs.entry.js +1 -1
  51. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +6 -6
  52. package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
  53. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +3 -3
  54. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +6 -6
  55. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +3 -3
  56. package/dist/cjs/justifi-terminals-list.cjs.entry.js +8 -8
  57. package/dist/cjs/loader.cjs.js +1 -1
  58. package/dist/cjs/{lodash-CxSkBibc.js → lodash-C4mGy21w.js} +38 -27
  59. package/dist/cjs/{package-CDegPd7E.js → package-Dxjq_cJI.js} +1 -1
  60. package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
  61. package/dist/cjs/{payment-provisioning-actions-Cn8bgHKu.js → payment-provisioning-actions-BiSpysjW.js} +2 -2
  62. package/dist/cjs/payment-provisioning-form-buttons_2.cjs.entry.js +2 -3
  63. package/dist/cjs/{payment.service-CbIxt30x.js → payment.service-ByrgA_QZ.js} +1 -1
  64. package/dist/cjs/{payout.service-DVMvsdAf.js → payout.service-CnQm_BpU.js} +1 -1
  65. package/dist/cjs/{payouts-status-CzS2CLGW.js → payouts-status-AuS3Mp0V.js} +2 -2
  66. package/dist/cjs/{plaid.service-DNT_DX6z.js → plaid.service-Dlb8EUR8.js} +1 -1
  67. package/dist/cjs/{schema-validations-DackMxv7.js → schema-validations-DNPcvDh5.js} +8 -11
  68. package/dist/cjs/styled-host-DAi5SuFa.js +11 -0
  69. package/dist/cjs/{terminal.service-BBHixg-d.js → terminal.service-BdwHQ3Vv.js} +1 -1
  70. package/dist/cjs/{utils-kDsk4nqH.js → utils-FVGp6se3.js} +1 -1
  71. package/dist/cjs/webcomponents.cjs.js +1 -1
  72. package/dist/collection/api/Document.js +7 -14
  73. package/dist/collection/collection-manifest.json +0 -2
  74. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
  75. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +3 -5
  76. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +2 -4
  77. package/dist/collection/components/business-forms/owner-form/owner-form.js +1 -46
  78. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/additional-questions-form-step.js +1 -1
  79. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +114 -6
  80. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
  81. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +0 -8
  82. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +2 -4
  83. package/dist/collection/components/business-forms/payment-provisioning/justifi-payment-provisioning.js +1 -1
  84. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +2 -3
  85. package/dist/collection/components/business-forms/schemas/business-bank-account-schema.js +38 -10
  86. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +1 -1
  87. package/dist/collection/components/business-forms/schemas/business-identity-schema.js +3 -7
  88. package/dist/collection/components/business-forms/schemas/schema-validations.js +5 -8
  89. package/dist/collection/components/business-forms/utils/business-form-options.js +0 -50
  90. package/dist/collection/components/business-forms/utils/country-config.js +0 -2
  91. package/dist/collection/components/modular-checkout/sub-components/justifi-google-pay.js +8 -6
  92. package/dist/collection/ui-components/form/form-control-file.js +1 -1
  93. package/dist/docs.json +76 -502
  94. package/dist/esm/{Analytics-5J6H0ALl.js → Analytics-CwckfiSK.js} +2 -2
  95. package/dist/esm/{Plaid-BM3JUIG5.js → Plaid-l6nNIjab.js} +19 -15
  96. package/dist/esm/{additional-questions-form-step_15.entry.js → additional-questions-form-step_14.entry.js} +169 -377
  97. package/dist/esm/additional-questions_5.entry.js +8 -8
  98. package/dist/esm/additional-statement_8.entry.js +1 -1
  99. package/dist/esm/bank-account-billing-form-simple_4.entry.js +4 -4
  100. package/dist/esm/bank-account-form.entry.js +2 -2
  101. package/dist/esm/{business-form-options-DXjZp4Rl.js → business-form-options-DRalxlqN.js} +1 -51
  102. package/dist/esm/{business-identity-schema-D8L_UfWl.js → business-identity-schema-0Q3kck3C.js} +7 -11
  103. package/dist/esm/{business.service-C4BD3pf7.js → business.service-C31wbMVs.js} +1 -1
  104. package/dist/esm/card-form.entry.js +2 -2
  105. package/dist/esm/{check-pkg-version-C7cHTIM0.js → check-pkg-version-Dy2NK3Nn.js} +1 -1
  106. package/dist/esm/{checkout.service-DmWeKNQs.js → checkout.service-cVdOGDuI.js} +1 -1
  107. package/dist/esm/{country-config-BW2dUoTJ.js → country-config-CdvhLcnT.js} +0 -2
  108. package/dist/esm/dispute-notification_2.entry.js +6 -6
  109. package/dist/esm/{event-types-eIqsrwmW.js → event-types-DalU_6SB.js} +1 -1
  110. package/dist/esm/form-address-fields_3.entry.js +1 -1
  111. package/dist/esm/form-control-number_2.entry.js +4 -5
  112. package/dist/esm/{get-business-DtFHdc37.js → get-business-Gg6qn5on.js} +2 -2
  113. package/dist/esm/{get-payment-details-26GxiYgv.js → get-payment-details-BiWgSJau.js} +2 -2
  114. package/dist/esm/{get-subaccounts-xkGMPstt.js → get-subaccounts-CkjZeR9U.js} +2 -2
  115. package/dist/esm/hidden-input_2.entry.js +1 -1
  116. package/dist/esm/{index.esm-KCSohgHx.js → index.esm-BHdVU4hV.js} +18 -1
  117. package/dist/esm/justifi-apple-pay_11.entry.js +11 -10
  118. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +5 -5
  119. package/dist/esm/justifi-bank-account-form.entry.js +5 -5
  120. package/dist/esm/justifi-billing-form-full.entry.js +1 -1
  121. package/dist/esm/justifi-billing-form.entry.js +1 -1
  122. package/dist/esm/justifi-business-details.entry.js +8 -8
  123. package/dist/esm/justifi-business-form.entry.js +13 -13
  124. package/dist/esm/justifi-card-billing-form-simple.entry.js +1 -1
  125. package/dist/esm/justifi-card-form.entry.js +5 -5
  126. package/dist/esm/justifi-checkout.entry.js +5 -5
  127. package/dist/esm/justifi-checkouts-list-filters.entry.js +3 -3
  128. package/dist/esm/justifi-checkouts-list.entry.js +8 -8
  129. package/dist/esm/justifi-dispute-management.entry.js +7 -7
  130. package/dist/esm/justifi-gross-payment-chart.entry.js +6 -6
  131. package/dist/esm/justifi-order-terminals.entry.js +9 -9
  132. package/dist/esm/justifi-payment-details.entry.js +8 -8
  133. package/dist/esm/justifi-payment-provisioning.entry.js +9 -9
  134. package/dist/esm/justifi-payment-transactions-list.entry.js +7 -7
  135. package/dist/esm/justifi-payments-list-filters.entry.js +2 -2
  136. package/dist/esm/justifi-payments-list.entry.js +7 -7
  137. package/dist/esm/justifi-payout-details.entry.js +8 -8
  138. package/dist/esm/justifi-payout-transactions-list.entry.js +7 -7
  139. package/dist/esm/justifi-payouts-list-filters.entry.js +2 -2
  140. package/dist/esm/justifi-payouts-list.entry.js +9 -9
  141. package/dist/esm/justifi-refund-payment.entry.js +9 -9
  142. package/dist/esm/justifi-save-new-payment-method.entry.js +1 -1
  143. package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
  144. package/dist/esm/justifi-skeleton.entry.js +1 -1
  145. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +3 -3
  146. package/dist/esm/justifi-terminal-orders-list.entry.js +6 -6
  147. package/dist/esm/justifi-terminals-list-filters.entry.js +3 -3
  148. package/dist/esm/justifi-terminals-list.entry.js +8 -8
  149. package/dist/esm/loader.js +1 -1
  150. package/dist/esm/{lodash-CrGKVSPp.js → lodash-BF_QgjtL.js} +38 -27
  151. package/dist/esm/{package-8R9xLun-.js → package-DAZd_gFd.js} +1 -1
  152. package/dist/esm/payment-method-option.entry.js +1 -1
  153. package/dist/esm/{payment-provisioning-actions-fWdNDUdq.js → payment-provisioning-actions-cl5xIYnF.js} +2 -2
  154. package/dist/esm/payment-provisioning-form-buttons_2.entry.js +2 -3
  155. package/dist/esm/{payment.service-CWR7jF-K.js → payment.service-5_u-UzTY.js} +1 -1
  156. package/dist/esm/{payout.service-CFU362cH.js → payout.service-D2zS5y8N.js} +1 -1
  157. package/dist/esm/{payouts-status-D2G7FKu1.js → payouts-status-DCjCGTaa.js} +2 -2
  158. package/dist/esm/{plaid.service-0hd1i5Ga.js → plaid.service-BiJ65YG8.js} +1 -1
  159. package/dist/esm/{schema-validations-CjqWFLKt.js → schema-validations-A1o1biOB.js} +8 -11
  160. package/dist/esm/styled-host-D6byRazK.js +9 -0
  161. package/dist/esm/{terminal.service-Dr6dERcJ.js → terminal.service-CIxDfM7V.js} +1 -1
  162. package/dist/esm/{utils-q7KOrlSX.js → utils-C1B2hVAB.js} +1 -1
  163. package/dist/esm/webcomponents.js +1 -1
  164. package/dist/module/Plaid.js +19 -15
  165. package/dist/module/additional-questions-form-step2.js +5 -11
  166. package/dist/module/bank-account-document-form-inputs.js +1 -55
  167. package/dist/module/bank-account-document-form-inputs2.js +57 -0
  168. package/dist/module/business-bank-account-form-step2.js +177 -24
  169. package/dist/module/business-core-info-form-step2.js +2 -2
  170. package/dist/module/business-core-info-schema.js +1 -1
  171. package/dist/module/business-core-info2.js +3 -3
  172. package/dist/module/business-documents-on-file2.js +1 -1
  173. package/dist/module/business-form-options.js +1 -51
  174. package/dist/module/business-identity-schema.js +3 -7
  175. package/dist/module/business-owners-form-step2.js +0 -8
  176. package/dist/module/business-representative-form-inputs2.js +3 -5
  177. package/dist/module/business-representative2.js +5 -6
  178. package/dist/module/button.js +1 -1
  179. package/dist/module/country-config.js +0 -2
  180. package/dist/module/form-control-number2.js +1 -1
  181. package/dist/module/form-control-textarea2.js +1 -1
  182. package/dist/module/form.js +18 -1
  183. package/dist/module/hidden-input2.js +1 -1
  184. package/dist/module/iframe-input2.js +1 -1
  185. package/dist/module/justifi-checkouts-list-filters.js +1 -1
  186. package/dist/module/justifi-checkouts-list.js +2 -2
  187. package/dist/module/justifi-dispute-management.js +1 -1
  188. package/dist/module/justifi-google-pay2.js +4 -3
  189. package/dist/module/justifi-modular-checkout2.js +1 -1
  190. package/dist/module/justifi-order-terminals.js +2 -2
  191. package/dist/module/justifi-payment-details.js +1 -1
  192. package/dist/module/justifi-payment-provisioning.js +27 -33
  193. package/dist/module/justifi-payment-transactions-list.js +2 -2
  194. package/dist/module/justifi-payments-list.js +1 -1
  195. package/dist/module/justifi-payout-details.js +1 -1
  196. package/dist/module/justifi-payout-transactions-list.js +2 -2
  197. package/dist/module/justifi-payouts-list-filters.js +1 -1
  198. package/dist/module/justifi-payouts-list.js +2 -2
  199. package/dist/module/justifi-refund-payment.js +1 -1
  200. package/dist/module/justifi-terminal-orders-list-filters.js +1 -1
  201. package/dist/module/justifi-terminal-orders-list.js +2 -2
  202. package/dist/module/justifi-terminals-list-filters.js +1 -1
  203. package/dist/module/justifi-terminals-list.js +2 -2
  204. package/dist/module/lodash.js +38 -27
  205. package/dist/module/owner-form-inputs2.js +3 -5
  206. package/dist/module/owner-form2.js +1 -10
  207. package/dist/module/package.js +1 -1
  208. package/dist/module/parts.js +1 -1
  209. package/dist/module/payment-provisioning-actions.js +1 -1
  210. package/dist/module/payment-provisioning-form-steps2.js +28 -35
  211. package/dist/module/plaid-verification2.js +1 -1
  212. package/dist/module/schema-validations.js +5 -8
  213. package/dist/module/skeleton.js +1 -1
  214. package/dist/module/styled-host.js +1 -1
  215. package/dist/module/table.js +1 -1
  216. package/dist/module/terminal-quantity-selector2.js +1 -1
  217. package/dist/types/api/Document.d.ts +2 -15
  218. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +0 -2
  219. package/dist/types/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.d.ts +12 -1
  220. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-form-steps.d.ts +0 -1
  221. package/dist/types/components/business-forms/schemas/business-bank-account-schema.d.ts +4 -4
  222. package/dist/types/components/business-forms/utils/business-form-options.d.ts +0 -1
  223. package/dist/types/components/modular-checkout/sub-components/justifi-google-pay.d.ts +1 -1
  224. package/dist/types/components.d.ts +10 -71
  225. package/dist/webcomponents/p-034fa691.entry.js +1 -0
  226. package/dist/webcomponents/{p-086f7eea.entry.js → p-07eaee91.entry.js} +1 -1
  227. package/dist/webcomponents/{p-2e063c5d.entry.js → p-08ab97ce.entry.js} +1 -1
  228. package/dist/webcomponents/{p-80fdd013.entry.js → p-1f34b2f7.entry.js} +1 -1
  229. package/dist/webcomponents/{p-3bcac405.entry.js → p-279c17ac.entry.js} +1 -1
  230. package/dist/webcomponents/{p-29b82954.entry.js → p-2a5ee558.entry.js} +1 -1
  231. package/dist/webcomponents/p-2aac2ab6.entry.js +1 -0
  232. package/dist/webcomponents/p-37254105.entry.js +1 -0
  233. package/dist/webcomponents/{p-a7e0ab9b.entry.js → p-38209a25.entry.js} +1 -1
  234. package/dist/webcomponents/{p-4b14b7e7.entry.js → p-3cefb032.entry.js} +1 -1
  235. package/dist/webcomponents/{p-8ed1bc07.entry.js → p-3ef07f42.entry.js} +1 -1
  236. package/dist/webcomponents/{p-a5ad9183.entry.js → p-41637e4a.entry.js} +1 -1
  237. package/dist/webcomponents/{p-92d8a14b.entry.js → p-4b39a470.entry.js} +1 -1
  238. package/dist/webcomponents/{p-6b21947c.entry.js → p-4ee55e7d.entry.js} +1 -1
  239. package/dist/webcomponents/p-5G1OMxZz.js +1 -0
  240. package/dist/webcomponents/p-6904c62c.entry.js +1 -0
  241. package/dist/webcomponents/{p-5f071ee0.entry.js → p-7377f7d1.entry.js} +1 -1
  242. package/dist/webcomponents/{p-48a866ae.entry.js → p-78c4668b.entry.js} +1 -1
  243. package/dist/webcomponents/{p-c2e09203.entry.js → p-8e56430a.entry.js} +1 -1
  244. package/dist/webcomponents/{p-947950cc.entry.js → p-9153c121.entry.js} +1 -1
  245. package/dist/webcomponents/p-9b5ca32c.entry.js +1 -0
  246. package/dist/webcomponents/{p-04d6d725.entry.js → p-9d676f54.entry.js} +1 -1
  247. package/dist/webcomponents/{p-BrFax4_P.js → p-APOabprT.js} +1 -1
  248. package/dist/webcomponents/p-Aacb4jqT.js +1 -0
  249. package/dist/webcomponents/{p-CeW0EPHy.js → p-Axa3cgnH.js} +1 -1
  250. package/dist/webcomponents/{p-CL8LyqRI.js → p-BJu1-9kE.js} +1 -1
  251. package/dist/webcomponents/{p-czJ2qSU1.js → p-BXyADlAH.js} +1 -1
  252. package/dist/webcomponents/{p-xWuaNtJy.js → p-Ba8jdOkX.js} +1 -1
  253. package/dist/webcomponents/{p-DvnFba1A.js → p-BdpSLMs7.js} +1 -1
  254. package/dist/webcomponents/p-BqNNwq6C.js +1 -0
  255. package/dist/webcomponents/{p-BBSnDYJw.js → p-Bt4GjEWL.js} +1 -1
  256. package/dist/webcomponents/{p-C-zuQNNP.js → p-BxKbnILQ.js} +1 -1
  257. package/dist/webcomponents/{p-D9sqTVmd.js → p-CKiAlBsU.js} +1 -1
  258. package/dist/webcomponents/{p-CDu7TeCZ.js → p-Cm9f5fyh.js} +1 -1
  259. package/dist/webcomponents/p-D8ytux5N.js +1 -0
  260. package/dist/webcomponents/p-DAZd_gFd.js +1 -0
  261. package/dist/webcomponents/{p-DdeBubpX.js → p-Dk26hk5T.js} +1 -1
  262. package/dist/webcomponents/p-DrMJliVY.js +1 -0
  263. package/dist/webcomponents/{p-Dzv0P2Ly.js → p-NZS8uCtH.js} +1 -1
  264. package/dist/webcomponents/p-OeJ-3w3l.js +9 -0
  265. package/dist/webcomponents/p-XIWgia4J.js +1 -0
  266. package/dist/webcomponents/{p-8db8d7e7.entry.js → p-a2c25cc4.entry.js} +1 -1
  267. package/dist/webcomponents/{p-de1ccbea.entry.js → p-a56e43a1.entry.js} +1 -1
  268. package/dist/webcomponents/{p-a3b48ba3.entry.js → p-a7a1b168.entry.js} +1 -1
  269. package/dist/webcomponents/{p-85c0abdb.entry.js → p-a9e82502.entry.js} +1 -1
  270. package/dist/webcomponents/{p-BSyTbuZy.js → p-av6jyzyC.js} +1 -1
  271. package/dist/webcomponents/{p-0b169fac.entry.js → p-b0b6083f.entry.js} +1 -1
  272. package/dist/webcomponents/{p-86eb32d8.entry.js → p-b21010cb.entry.js} +1 -1
  273. package/dist/webcomponents/{p-1e34c488.entry.js → p-b62ff001.entry.js} +1 -1
  274. package/dist/webcomponents/{p-c1b48216.entry.js → p-b8351983.entry.js} +1 -1
  275. package/dist/webcomponents/{p-3960e6b7.entry.js → p-bc2dddf3.entry.js} +1 -1
  276. package/dist/webcomponents/{p-3e10a0de.entry.js → p-c4767c7b.entry.js} +1 -1
  277. package/dist/webcomponents/p-c8bc235f.entry.js +1 -0
  278. package/dist/webcomponents/{p-0a4fcb15.entry.js → p-ca87c609.entry.js} +1 -1
  279. package/dist/webcomponents/{p-ba2ab989.entry.js → p-cf3e3394.entry.js} +1 -1
  280. package/dist/webcomponents/{p-e0e6c2df.entry.js → p-d01a1076.entry.js} +1 -1
  281. package/dist/webcomponents/{p-a4520dba.entry.js → p-d5edbea3.entry.js} +1 -1
  282. package/dist/webcomponents/{p-b17ce21d.entry.js → p-d79c5ee4.entry.js} +1 -1
  283. package/dist/webcomponents/{p-562447ad.entry.js → p-e02d7751.entry.js} +4 -4
  284. package/dist/webcomponents/{p-c3cc4ad6.entry.js → p-e07506b7.entry.js} +1 -1
  285. package/dist/webcomponents/{p-cc558e25.entry.js → p-e17b92ec.entry.js} +1 -1
  286. package/dist/webcomponents/p-ea254f14.entry.js +1 -0
  287. package/dist/webcomponents/{p-ca1c2048.entry.js → p-ebb7b693.entry.js} +1 -1
  288. package/dist/webcomponents/{p-0e4cda77.entry.js → p-f1b9cbf0.entry.js} +1 -1
  289. package/dist/webcomponents/{p-Cz0yhyYu.js → p-fE5A37L5.js} +1 -1
  290. package/dist/webcomponents/p-ff8cf16c.entry.js +1 -0
  291. package/dist/webcomponents/p-nb_LhbJq.js +1 -0
  292. package/dist/webcomponents/{p--RbNhyet.js → p-oTtn8xDw.js} +1 -1
  293. package/dist/webcomponents/webcomponents.esm.js +1 -1
  294. package/package.json +14 -14
  295. package/dist/cjs/bank-account-document-form-inputs.cjs.entry.js +0 -21
  296. package/dist/cjs/styled-host-Ch0-dxF-.js +0 -11
  297. package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.js +0 -435
  298. package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-list.js +0 -52
  299. package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-options.js +0 -72
  300. package/dist/esm/bank-account-document-form-inputs.entry.js +0 -19
  301. package/dist/esm/styled-host-D84RBv1W.js +0 -9
  302. package/dist/module/document-upload-form-step.d.ts +0 -11
  303. package/dist/module/document-upload-form-step.js +0 -6
  304. package/dist/module/document-upload-form-step2.js +0 -397
  305. package/dist/module/document-upload-list.d.ts +0 -11
  306. package/dist/module/document-upload-list.js +0 -6
  307. package/dist/module/document-upload-list2.js +0 -46
  308. package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.d.ts +0 -44
  309. package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-list.d.ts +0 -6
  310. package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-options.d.ts +0 -44
  311. package/dist/webcomponents/p-37676092.entry.js +0 -1
  312. package/dist/webcomponents/p-54ee2a30.entry.js +0 -1
  313. package/dist/webcomponents/p-58adef16.entry.js +0 -1
  314. package/dist/webcomponents/p-8R9xLun-.js +0 -1
  315. package/dist/webcomponents/p-92e7ce54.entry.js +0 -1
  316. package/dist/webcomponents/p-9ce2a98a.entry.js +0 -1
  317. package/dist/webcomponents/p-B1yVkh15.js +0 -1
  318. package/dist/webcomponents/p-BzXQDB0t.js +0 -1
  319. package/dist/webcomponents/p-C_ifLmT1.js +0 -9
  320. package/dist/webcomponents/p-D9ZHVy-j.js +0 -1
  321. package/dist/webcomponents/p-DV4n8kZd.js +0 -1
  322. package/dist/webcomponents/p-DzEdYT8R.js +0 -1
  323. package/dist/webcomponents/p-a2ed63df.entry.js +0 -1
  324. package/dist/webcomponents/p-a9976353.entry.js +0 -1
  325. package/dist/webcomponents/p-c9599fc7.entry.js +0 -1
  326. package/dist/webcomponents/p-cab840bd.entry.js +0 -1
  327. package/dist/webcomponents/p-n_pmf4AT.js +0 -1
  328. package/dist/webcomponents/p-vUN_uvAi.js +0 -1
@@ -1,32 +1,32 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-p7cvUYAE.js');
4
- var Plaid = require('./Plaid-KasiL5mp.js');
5
- var paymentProvisioningActions = require('./payment-provisioning-actions-Cn8bgHKu.js');
6
- var business_service = require('./business.service-BBovho58.js');
7
- var businessIdentitySchema = require('./business-identity-schema-CC1wOwXd.js');
8
- var index_esm = require('./index.esm-BNETBIV_.js');
4
+ var Plaid = require('./Plaid-BRSyOOuw.js');
5
+ var paymentProvisioningActions = require('./payment-provisioning-actions-BiSpysjW.js');
6
+ var business_service = require('./business.service-Z9OACEQL.js');
7
+ var businessIdentitySchema = require('./business-identity-schema-DuFGX6_i.js');
8
+ var index_esm = require('./index.esm-C1ZPG85l.js');
9
9
  var Business = require('./Business-oBifyXkW.js');
10
10
  var formInputMasks = require('./form-input-masks-BnNFJ3IJ.js');
11
11
  var parts = require('./parts-BXshb_S-.js');
12
12
  var paymentProvisioningLoading = require('./payment-provisioning-loading-tM9WWmxv.js');
13
- var businessFormOptions = require('./business-form-options-CnlrfbQ6.js');
13
+ var businessFormOptions = require('./business-form-options-D_nM7NDk.js');
14
14
  var eventTypes = require('./event-types-DNOUef41.js');
15
- var utils = require('./utils-DAyWinG2.js');
16
15
  require('./config-state-BIgGhhe9.js');
17
16
  require('./dinero-BwNN_k7x.js');
18
17
  require('./Pagination-Dediz133.js');
19
- var schemaValidations = require('./schema-validations-DackMxv7.js');
18
+ var utils = require('./utils-DAyWinG2.js');
19
+ var schemaValidations = require('./schema-validations-DNPcvDh5.js');
20
20
  var button = require('./button-CR9Rl1-o.js');
21
21
  require('./event-types-YOY5TKUN.js');
22
- var countryConfig = require('./country-config-Ck-eEeZZ.js');
22
+ var countryConfig = require('./country-config-aJp8ScEs.js');
23
23
  var utils$1 = require('./utils-BHi4j5rB.js');
24
24
  var skeleton = require('./skeleton-DvRCiQlA.js');
25
25
  var inputHandlers = require('./input-handlers-_51J5q7J.js');
26
26
  var Api = require('./Api-Bukk55YZ.js');
27
- var styledHost = require('./styled-host-Ch0-dxF-.js');
28
- var plaid_service = require('./plaid.service-DNT_DX6z.js');
29
- require('./utils-kDsk4nqH.js');
27
+ var styledHost = require('./styled-host-DAi5SuFa.js');
28
+ var plaid_service = require('./plaid.service-Dlb8EUR8.js');
29
+ require('./utils-FVGp6se3.js');
30
30
  require('./_commonjsHelpers-BJu3ubxk.js');
31
31
  require('./index-W-zoNiyM.js');
32
32
 
@@ -181,7 +181,7 @@ const AdditionalQuestionsFormStep = class {
181
181
  if (this.isLoading) {
182
182
  return index.h(paymentProvisioningLoading.PaymentProvisioningLoading, null);
183
183
  }
184
- return (index.h("form", null, index.h("fieldset", null, index.h("div", { class: "d-flex align-items-center gap-2" }, index.h("legend", { class: "mb-0", part: parts.heading2 }, "Additional Questions"), index.h("form-control-tooltip", { helpText: "This information helps us understand the business and identify and monitor trends to safeguard you and your customers." })), index.h("hr", { class: "mt-2" }), index.h("div", { class: "row gy-3" }, index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-monetary-provisioning", { name: "business_revenue", label: "What is your business' estimated annual revenue from its primary business activities?", inputHandler: this.inputHandler, errorText: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue, maskOptions: formInputMasks.CURRENCY_MASK.WHOLE })), index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-monetary-provisioning", { name: "business_payment_volume", label: "What is your business' annual credit card & ACH volume anticipated to process?", inputHandler: this.inputHandler, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume, maskOptions: formInputMasks.CURRENCY_MASK.WHOLE })), index.h("div", { class: "col-12" }, index.h("form-control-number", { name: "business_average_transaction_amount", label: "What is your average transaction size?", inputHandler: this.inputHandler, errorText: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.business_average_transaction_amount, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_average_transaction_amount })), index.h("div", { class: "col-12" }, index.h("form-control-select", { name: "business_when_service_received", label: "On average, how long after paying will your customers typically receive their goods or services?", inputHandler: this.inputHandler, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.business_when_service_received, options: businessFormOptions.businessServiceReceivedOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_when_service_received })), index.h("div", { class: "col-12" }, index.h("form-control-text", { name: "business_other_payment_details", label: "Is there anything else you would like us to know about how your customers pay the business? (optional)", inputHandler: this.inputHandler, errorText: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.business_other_payment_details, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_other_payment_details }))))));
184
+ return (index.h("form", null, index.h("fieldset", null, index.h("div", { class: "d-flex align-items-center gap-2" }, index.h("legend", { class: "mb-0", part: parts.heading2 }, "Additional Questions"), index.h("form-control-tooltip", { helpText: "This information helps us understand the business and identify and monitor trends to safeguard you and your customers." })), index.h("hr", { class: "mt-2" }), index.h("div", { class: "row gy-3" }, index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-monetary-provisioning", { name: "business_revenue", label: "What is your business' estimated annual revenue from its primary business activities?", inputHandler: this.inputHandler, errorText: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue, maskOptions: formInputMasks.CURRENCY_MASK.WHOLE })), index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-monetary-provisioning", { name: "business_payment_volume", label: "What is your business' annual credit card & ACH volume anticipated to process?", inputHandler: this.inputHandler, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume, maskOptions: formInputMasks.CURRENCY_MASK.WHOLE })), index.h("div", { class: "col-12" }, index.h("form-control-text", { name: "business_average_transaction_amount", label: "What is your average transaction size?", inputHandler: this.inputHandler, errorText: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.business_average_transaction_amount, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_average_transaction_amount })), index.h("div", { class: "col-12" }, index.h("form-control-select", { name: "business_when_service_received", label: "On average, how long after paying will your customers typically receive their goods or services?", inputHandler: this.inputHandler, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.business_when_service_received, options: businessFormOptions.businessServiceReceivedOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_when_service_received })), index.h("div", { class: "col-12" }, index.h("form-control-text", { name: "business_other_payment_details", label: "Is there anything else you would like us to know about how your customers pay the business? (optional)", inputHandler: this.inputHandler, errorText: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.business_other_payment_details, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_other_payment_details }))))));
185
185
  }
186
186
  static get watchers() { return {
187
187
  "authToken": ["propChanged"],
@@ -190,6 +190,15 @@ const AdditionalQuestionsFormStep = class {
190
190
  }; }
191
191
  };
192
192
 
193
+ const BankAccountDocumentFormInputs = class {
194
+ constructor(hostRef) {
195
+ index.registerInstance(this, hostRef);
196
+ }
197
+ render() {
198
+ return (index.h("div", { key: 'd0dacb95d07d3e4ca9bc2c9f23b6c490871da4e9', class: "row gy-3" }, index.h("div", { key: '02ed406f38558badf9f591e076b120d09c71f83b', class: "col-12" }, index.h("form-control-file", { key: '11ff1dc68264b9e5aa561ffe19b423abc1a00c78', name: "voided_check", label: "Voided Check", documentType: Plaid.EntityDocumentType.voidedCheck, inputHandler: this.inputHandler, onFileSelected: this.storeFiles, errorText: this.errors["voided_check"], multiple: true })), index.h("div", { key: '71d26407522a75a54489155566c18af1a64c1417', class: "col-12" }, index.h("form-control-file", { key: '7ea42e03a44c223a5fedc273e94e635e70d54f4b', name: "bank_statement", label: "Bank Statement", documentType: Plaid.EntityDocumentType.bankStatement, inputHandler: this.inputHandler, onFileSelected: this.storeFiles, errorText: this.errors["bank_statement"], multiple: true }))));
199
+ }
200
+ };
201
+
193
202
  const BankAccountFormInputs = class {
194
203
  constructor(hostRef) {
195
204
  index.registerInstance(this, hostRef);
@@ -210,6 +219,9 @@ const BankAccountFormInputsCanada = class {
210
219
  }
211
220
  };
212
221
 
222
+ const checkExistingDocs = (documents, documentType) => {
223
+ return documents.some((doc) => doc.document_type === documentType);
224
+ };
213
225
  const buildCommonFieldRules = (allowOptionalFields) => {
214
226
  if (allowOptionalFields) {
215
227
  return {
@@ -228,6 +240,30 @@ const buildCommonFieldRules = (allowOptionalFields) => {
228
240
  account_number: schemaValidations.accountNumberValidation.required('Enter account number'),
229
241
  };
230
242
  };
243
+ const buildDocumentRules = (documents, allowOptionalFields) => {
244
+ if (allowOptionalFields) {
245
+ return {
246
+ voided_check: index_esm.create$8().nullable(),
247
+ bank_statement: index_esm.create$8().nullable(),
248
+ };
249
+ }
250
+ const existingVoidedCheck = checkExistingDocs(documents, Plaid.EntityDocumentType.voidedCheck);
251
+ const existingBankStatement = checkExistingDocs(documents, Plaid.EntityDocumentType.bankStatement);
252
+ const existingDocument = existingVoidedCheck || existingBankStatement;
253
+ const documentErrorText = 'Please upload either a voided check or a bank statement. Only one is required.';
254
+ return {
255
+ voided_check: index_esm.create$8().when('bank_statement', {
256
+ is: (val) => !val && !existingDocument,
257
+ then: (schema) => schema.required(documentErrorText),
258
+ otherwise: (schema) => schema.notRequired(),
259
+ }),
260
+ bank_statement: index_esm.create$8().when('voided_check', {
261
+ is: (val) => !val && !existingDocument,
262
+ then: (schema) => schema.required(documentErrorText),
263
+ otherwise: (schema) => schema.notRequired(),
264
+ }),
265
+ };
266
+ };
231
267
  const buildUSARules = (allowOptionalFields) => {
232
268
  if (allowOptionalFields) {
233
269
  return { routing_number: schemaValidations.routingNumberValidation.nullable() };
@@ -252,17 +288,17 @@ const buildCANRules = (allowOptionalFields) => {
252
288
  transit_number: transitNumberValidation.required('Enter transit number'),
253
289
  };
254
290
  };
255
- const businessBankAccountSchemaUSA = (allowOptionalFields) => {
256
- const shape = Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildUSARules(allowOptionalFields));
257
- return index_esm.create$3().shape(shape);
291
+ const businessBankAccountSchemaUSA = (documents, allowOptionalFields) => {
292
+ const shape = Object.assign(Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildUSARules(allowOptionalFields)), buildDocumentRules(documents, allowOptionalFields));
293
+ return index_esm.create$3().shape(shape, [['voided_check', 'bank_statement']]);
258
294
  };
259
- const businessBankAccountSchemaCAN = (allowOptionalFields) => {
260
- const shape = Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildCANRules(allowOptionalFields));
261
- return index_esm.create$3().shape(shape);
295
+ const businessBankAccountSchemaCAN = (documents, allowOptionalFields) => {
296
+ const shape = Object.assign(Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildCANRules(allowOptionalFields)), buildDocumentRules(documents, allowOptionalFields));
297
+ return index_esm.create$3().shape(shape, [['voided_check', 'bank_statement']]);
262
298
  };
263
299
  const bankAccountSchemaByCountry = {
264
- [Business.CountryCode.USA]: (allowOptionalFields) => businessBankAccountSchemaUSA(allowOptionalFields),
265
- [Business.CountryCode.CAN]: (allowOptionalFields) => businessBankAccountSchemaCAN(allowOptionalFields),
300
+ [Business.CountryCode.USA]: (allowOptionalFields, documents = []) => businessBankAccountSchemaUSA(documents, allowOptionalFields),
301
+ [Business.CountryCode.CAN]: (allowOptionalFields, documents = []) => businessBankAccountSchemaCAN(documents, allowOptionalFields),
266
302
  };
267
303
 
268
304
  const BusinessBankAccountFormStep = class {
@@ -273,13 +309,15 @@ const BusinessBankAccountFormStep = class {
273
309
  this.formLoading = index.createEvent(this, "formLoading", 7);
274
310
  this.errors = {};
275
311
  this.bankAccount = {};
312
+ this.existingDocuments = [];
313
+ this.documentData = new Plaid.EntityDocumentStorage();
276
314
  this.isLoading = false;
277
315
  this.viewMode = 'manual';
278
316
  this.bankAccountVerification = false;
279
317
  this.platformAccountId = null;
280
318
  this.getSchema = () => {
281
319
  const schema = bankAccountSchemaByCountry[this.country];
282
- return schema(this.allowOptionalFields);
320
+ return schema(this.allowOptionalFields, this.existingDocuments);
283
321
  };
284
322
  this.initializeFormController = () => {
285
323
  this.formController = new index_esm.FormController(this.getSchema());
@@ -296,6 +334,12 @@ const BusinessBankAccountFormStep = class {
296
334
  this.inputHandler = (name, value) => {
297
335
  this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
298
336
  };
337
+ this.storeFiles = (e) => {
338
+ const fileList = Array.from(e.detail.fileList);
339
+ const docType = e.detail.document_type;
340
+ const documentList = fileList.map(file => new Plaid.EntityDocument({ file, document_type: docType }, this.businessId));
341
+ this.documentData[docType] = documentList;
342
+ };
299
343
  this.getData = () => {
300
344
  this.isLoading = true;
301
345
  this.getBusiness({
@@ -318,10 +362,12 @@ const BusinessBankAccountFormStep = class {
318
362
  };
319
363
  this.handleChangeBankAccount = () => {
320
364
  this.viewMode = this.plaidAvailable ? 'plaid' : 'manual';
365
+ this.documentData = new Plaid.EntityDocumentStorage();
321
366
  this.initializeFormController();
322
367
  };
323
368
  this.handleCancel = () => {
324
369
  this.viewMode = this.existingBankAccount ? 'readonly' : 'plaid';
370
+ this.documentData = new Plaid.EntityDocumentStorage();
325
371
  this.initializeFormController();
326
372
  };
327
373
  this.handleToggleToManualEntry = () => {
@@ -337,6 +383,66 @@ const BusinessBankAccountFormStep = class {
337
383
  });
338
384
  });
339
385
  };
386
+ this.postDocumentRecordData = async (docData) => {
387
+ this.isLoading = true;
388
+ const payload = docData.record_data;
389
+ return new Promise((resolve) => {
390
+ this.postDocumentRecord({
391
+ payload,
392
+ onSuccess: (response) => {
393
+ resolve(this.handleDocRecordResponse(docData, response));
394
+ },
395
+ onError: ({ error, code, severity }) => {
396
+ this.errorEvent.emit({
397
+ message: error,
398
+ errorCode: code,
399
+ severity: severity
400
+ });
401
+ resolve(false);
402
+ },
403
+ });
404
+ });
405
+ };
406
+ this.handleDocRecordResponse = (docData, response) => {
407
+ if (response.error) {
408
+ this.errorEvent.emit({
409
+ errorCode: Plaid.ComponentErrorCodes.POST_ERROR,
410
+ message: response.error.message,
411
+ severity: Plaid.ComponentErrorSeverity.ERROR,
412
+ data: response.error,
413
+ });
414
+ return false;
415
+ }
416
+ else {
417
+ docData.setPresignedUrl(response.data.presigned_url);
418
+ return true;
419
+ }
420
+ };
421
+ this.uploadDocument = async (docData) => {
422
+ if (!docData.presigned_url) {
423
+ throw new Error('Presigned URL is not set');
424
+ }
425
+ const fileData = await docData.getFileData();
426
+ const response = await fetch(docData.presigned_url, {
427
+ method: 'PUT',
428
+ body: fileData
429
+ });
430
+ return this.handleUploadResponse(response);
431
+ };
432
+ this.handleUploadResponse = (response) => {
433
+ if (response.error) {
434
+ this.errorEvent.emit({
435
+ errorCode: Plaid.ComponentErrorCodes.POST_ERROR,
436
+ message: response.error.message,
437
+ severity: Plaid.ComponentErrorSeverity.ERROR,
438
+ data: response.error,
439
+ });
440
+ return false;
441
+ }
442
+ else {
443
+ return true;
444
+ }
445
+ };
340
446
  }
341
447
  propChanged() {
342
448
  this.initializeApi();
@@ -375,6 +481,10 @@ const BusinessBankAccountFormStep = class {
375
481
  authToken: this.authToken,
376
482
  service: new business_service.BusinessBankAccountService()
377
483
  });
484
+ this.postDocumentRecord = paymentProvisioningActions.makePostDocumentRecord({
485
+ authToken: this.authToken,
486
+ service: new business_service.DocumentRecordService()
487
+ });
378
488
  }
379
489
  else {
380
490
  this.errorEvent.emit({
@@ -400,7 +510,7 @@ const BusinessBankAccountFormStep = class {
400
510
  return this.bankAccountVerification || this.existingBankAccount;
401
511
  }
402
512
  processBusinessResponse(data) {
403
- const { bank_accounts, settings, platform_account_id } = data;
513
+ const { bank_accounts, documents, settings, platform_account_id } = data;
404
514
  if (bank_accounts.length > 0) {
405
515
  this.bankAccount = new BankAccount(bank_accounts[bank_accounts.length - 1]);
406
516
  }
@@ -408,6 +518,7 @@ const BusinessBankAccountFormStep = class {
408
518
  this.bankAccount = new BankAccount({});
409
519
  this.bankAccount.business_id = this.businessId;
410
520
  }
521
+ this.existingDocuments = documents;
411
522
  this.bankAccountVerification = settings.bank_account_verification === true;
412
523
  this.platformAccountId = platform_account_id;
413
524
  }
@@ -428,6 +539,11 @@ const BusinessBankAccountFormStep = class {
428
539
  const bankAccountPosted = await this.postBankAccountData();
429
540
  if (!bankAccountPosted)
430
541
  return;
542
+ }
543
+ const documentsUploaded = await this.postBusinessDocuments();
544
+ if (!documentsUploaded)
545
+ return;
546
+ if (this.viewMode === 'manual') {
431
547
  this.viewMode = 'readonly';
432
548
  await this.refreshBankAccountData();
433
549
  }
@@ -491,6 +607,27 @@ const BusinessBankAccountFormStep = class {
491
607
  });
492
608
  });
493
609
  }
610
+ async postBusinessDocuments() {
611
+ this.isLoading = true;
612
+ try {
613
+ const docArray = Object.values(this.documentData).flat();
614
+ if (!docArray.length) {
615
+ return true;
616
+ }
617
+ const recordsCreated = await Promise.all(docArray.map((docData) => this.postDocumentRecordData(docData))); // Create document records
618
+ if (recordsCreated.includes(false)) {
619
+ return false;
620
+ } // Exit if document record creation fails
621
+ const uploadsCompleted = await Promise.all(docArray.map((docData) => this.uploadDocument(docData))); // Upload documents to AWS presigned URLs
622
+ if (uploadsCompleted.includes(false)) {
623
+ return false;
624
+ } // Exit if any upload fails
625
+ return true;
626
+ }
627
+ finally {
628
+ this.isLoading = false;
629
+ }
630
+ }
494
631
  renderBankAccountInputs(disabled) {
495
632
  const defaultValue = this.formController.getInitialValues();
496
633
  return this.country === Business.CountryCode.CAN ? (index.h("bank-account-form-inputs-canada", { defaultValue: defaultValue, errors: this.errors, inputHandler: this.inputHandler, formDisabled: disabled })) : (index.h("bank-account-form-inputs", { defaultValue: defaultValue, errors: this.errors, inputHandler: this.inputHandler, formDisabled: disabled }));
@@ -507,11 +644,14 @@ const BusinessBankAccountFormStep = class {
507
644
  renderManualEntryView() {
508
645
  return (index.h("div", null, this.plaidAvailable && (index.h("div", { class: "mb-3" }, index.h(button.Button, { type: "button", variant: "secondary", onClick: this.handleToggleToPlaidVerification, disabled: this.isLoading, part: parts.buttonSecondary }, "Link bank account with Plaid instead"))), this.renderBankAccountInputs(false), index.h("div", { class: "mt-3 d-flex gap-2" }, this.showCancel && (index.h(button.Button, { variant: "secondary", type: "button", onClick: this.handleCancel, disabled: this.isLoading, part: parts.buttonSecondary }, "Cancel")), index.h(button.Button, { variant: "primary", type: "button", onClick: this.handleSaveBankAccount, disabled: this.isLoading, isLoading: this.isLoading }, "Save Bank Account"))));
509
646
  }
647
+ renderDocumentUploads() {
648
+ return (index.h("fieldset", { class: "mt-4" }, index.h("div", { class: "d-flex align-items-center gap-2" }, index.h("legend", { class: "mb-0", part: parts.heading2 }, "Document Uploads"), index.h("form-control-tooltip", { helpText: "One document (voided check or bank statement) is required for underwriting purposes. It needs to visibly show the name tied to the account and the account number. Various file formats such as PDF, DOC, DOCX, JPEG are accepted. Multiple files can be uploaded for each document category." })), index.h("hr", { class: "mt-2" }), index.h("business-documents-on-file", { documents: this.existingDocuments, isLoading: this.isLoading }), index.h("bank-account-document-form-inputs", { inputHandler: this.inputHandler, errors: this.errors, storeFiles: this.storeFiles })));
649
+ }
510
650
  render() {
511
651
  if (this.isLoading) {
512
652
  return index.h(paymentProvisioningLoading.PaymentProvisioningLoading, null);
513
653
  }
514
- return (index.h("form", null, index.h("fieldset", { class: "mb-4" }, index.h("div", { class: "d-flex align-items-center gap-2" }, index.h("legend", { class: "mb-0", part: parts.heading2 }, "Bank Account Info"), index.h("form-control-tooltip", { helpText: "This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship." })), index.h("hr", { class: "mt-2" }), this.viewMode === 'readonly' && this.renderReadonlyView(), this.viewMode === 'plaid' && this.renderPlaidView(), this.viewMode === 'manual' && this.renderManualEntryView())));
654
+ return (index.h("form", null, index.h("fieldset", { class: "mb-4" }, index.h("div", { class: "d-flex align-items-center gap-2" }, index.h("legend", { class: "mb-0", part: parts.heading2 }, "Bank Account Info"), index.h("form-control-tooltip", { helpText: "This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship." })), index.h("hr", { class: "mt-2" }), this.viewMode === 'readonly' && this.renderReadonlyView(), this.viewMode === 'plaid' && this.renderPlaidView(), this.viewMode === 'manual' && this.renderManualEntryView()), this.viewMode !== 'plaid' && this.renderDocumentUploads()));
515
655
  }
516
656
  static get watchers() { return {
517
657
  "authToken": ["propChanged"],
@@ -641,7 +781,7 @@ const BusinessCoreInfoFormStep = class {
641
781
  if (this.isLoading) {
642
782
  return index.h(paymentProvisioningLoading.PaymentProvisioningLoading, null);
643
783
  }
644
- return (index.h("form", null, index.h("fieldset", null, index.h("div", { class: "d-flex align-items-center gap-2" }, index.h("legend", { class: "mb-0", part: parts.heading2 }, "Business Information")), index.h("hr", { class: "mt-2" }), index.h("div", { class: "row gy-3" }, index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-text", { name: "legal_name", label: "Business Name", defaultValue: coreInfoDefaultValue.legal_name, errorText: this.errors.legal_name, inputHandler: this.inputHandler, helpText: "Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)." })), index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, errorText: this.errors.doing_business_as, inputHandler: this.inputHandler, helpText: "Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)" })), index.h("div", { class: "col-12 col-md-8" }, index.h("form-control-select", { name: "classification", label: "Business Classification", options: businessFormOptions.businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), index.h("div", { class: "col-12 col-md-4" }, index.h("form-control-date", { name: "date_of_incorporation", label: "Date of Registration", defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler, helpText: "Describe what you sell" })), index.h("div", { class: "col-12 col-md-6" }, (!((_a = this.coreInfo) === null || _a === void 0 ? void 0 : _a.tax_id_last4) || this.isEditingTaxId) ? (index.h("form-control-number-masked", { name: "tax_id", label: countryConfig.countryLabels[this.country].taxIdLabelOptional || countryConfig.countryLabels[this.country].taxIdLabel, defaultValue: this.isEditingTaxId ? '' : coreInfoDefaultValue.tax_id, errorText: this.errors.tax_id, inputHandler: this.inputHandler, mask: '000000000', helpText: countryConfig.countryLabels[this.country].taxIdHelpText })) : (index.h("div", null, index.h("label", { class: "form-label", part: parts.label }, countryConfig.countryLabels[this.country].taxIdLabel), index.h("div", { class: "input-group mb-3" }, index.h("input", { type: "text", class: "form-control", part: parts.inputDisabled, value: `****${(_b = this.coreInfo) === null || _b === void 0 ? void 0 : _b.tax_id_last4}`, disabled: true }), index.h("button", { class: "btn btn-secondary", type: "button", part: parts.buttonSecondary, onClick: () => {
784
+ return (index.h("form", null, index.h("fieldset", null, index.h("div", { class: "d-flex align-items-center gap-2" }, index.h("legend", { class: "mb-0", part: parts.heading2 }, "Business Information")), index.h("hr", { class: "mt-2" }), index.h("div", { class: "row gy-3" }, index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-text", { name: "legal_name", label: "Business Name", defaultValue: coreInfoDefaultValue.legal_name, errorText: this.errors.legal_name, inputHandler: this.inputHandler, helpText: "Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)." })), index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, errorText: this.errors.doing_business_as, inputHandler: this.inputHandler, helpText: "Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)" })), index.h("div", { class: "col-12 col-md-8" }, index.h("form-control-select", { name: "classification", label: "Business Classification", options: businessFormOptions.businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), index.h("div", { class: "col-12 col-md-4" }, index.h("form-control-date", { name: "date_of_incorporation", label: "Date of Registration", defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler, helpText: "Describe what you sell" })), index.h("div", { class: "col-12 col-md-6" }, (!((_a = this.coreInfo) === null || _a === void 0 ? void 0 : _a.tax_id_last4) || this.isEditingTaxId) ? (index.h("form-control-number-masked", { name: "tax_id", label: countryConfig.countryLabels[this.country].taxIdLabel, defaultValue: this.isEditingTaxId ? '' : coreInfoDefaultValue.tax_id, errorText: this.errors.tax_id, inputHandler: this.inputHandler, mask: '000000000', helpText: countryConfig.countryLabels[this.country].taxIdHelpText })) : (index.h("div", null, index.h("label", { class: "form-label", part: parts.label }, countryConfig.countryLabels[this.country].taxIdLabel), index.h("div", { class: "input-group mb-3" }, index.h("input", { type: "text", class: "form-control", part: parts.inputDisabled, value: `****${(_b = this.coreInfo) === null || _b === void 0 ? void 0 : _b.tax_id_last4}`, disabled: true }), index.h("button", { class: "btn btn-secondary", type: "button", part: parts.buttonSecondary, onClick: () => {
645
785
  this.isEditingTaxId = true;
646
786
  // Clear last4-equivalent and current value if any future conditional validation depends on it
647
787
  this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { tax_id: '', tax_id_last4: null }));
@@ -793,14 +933,6 @@ const BusinessOwnersFormStep = class {
793
933
  if (!formsValid) {
794
934
  return;
795
935
  }
796
- if (!this.allowOptionalFields) {
797
- const percentages = await Promise.all(this.refs.map(ref => ref.getOwnershipPercentage()));
798
- const total = percentages.reduce((sum, p) => sum + (parseFloat(p) || 0), 0);
799
- if (total !== 100) {
800
- await Promise.all(this.refs.map(ref => ref.setOwnershipPercentageError('Ownership percentages must total 100%')));
801
- return;
802
- }
803
- }
804
936
  const formSubmissions = this.refs.map(ref => ref.submit());
805
937
  const submissionsValid = (await Promise.all(formSubmissions)).every(result => result);
806
938
  if (!submissionsValid) {
@@ -878,14 +1010,14 @@ const BusinessRepresentativeFormInputs = class {
878
1010
  }
879
1011
  render() {
880
1012
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
881
- return (index.h("form", { key: '2346f250e4e2982b5b5b2624d039f551b5b5ed4e' }, index.h("fieldset", { key: '7b496e6157e5eec02ef0d263c68fbd1e001c75ac' }, index.h("div", { key: 'b86d993c7fbee2269e48c7d4ea51826f199fecd4', class: "d-flex align-items-center gap-2" }, index.h("legend", { key: '2b013e6068bbbca54a0852093ab4a2fae4ce64d2', class: "mb-0", part: parts.heading2 }, "Representative"), index.h("form-control-tooltip", { key: '01e0f1d6ba2d5ee852593f7015a3ba7e0d980df9', helpText: "The representative for your business needs to be someone who has significant control over managing your business's finance. You will have an opportunity to add owners later in the form." })), index.h("hr", { key: '4bec34756ec7081e01809175bc3d2b6af0532537', class: "mt-2" }), index.h("div", { key: '6965720fabb1f12c6bb3c5a81f74ae12f44037b2', class: "row gy-3" }, index.h("div", { key: 'efbb768ba1e66d5ef47f792c39a17921b40e0eba', class: "col-12 col-md-8" }, index.h("form-control-text", { key: '28477d3798ba7d14aee9201e84b276d8e85a21df', name: "name", label: "Full Name", defaultValue: (_a = this.representativeDefaultValue) === null || _a === void 0 ? void 0 : _a.name, errorText: this.errors.name, inputHandler: this.inputHandler })), index.h("div", { key: '28f17ccbe4da476256acd9c5a4e78a6a641ba6e9', class: "col-12 col-md-4" }, index.h("form-control-select", { key: 'dae6a93a0bc057abb97024277be0f10de01514e2', name: "title", label: "Title", options: businessFormOptions.businessTitleOptions, defaultValue: (_b = this.representativeDefaultValue) === null || _b === void 0 ? void 0 : _b.title, errorText: this.errors.title, inputHandler: this.inputHandler })), index.h("div", { key: '2f9a45774adaa0040df2da1a8000d1ee61e16bf5', class: "col-12 col-md-6" }, index.h("form-control-text", { key: '66a2a1ea8b54c03c012d76a74654ee19a9f958a7', name: "email", label: "Email Address", defaultValue: (_c = this.representativeDefaultValue) === null || _c === void 0 ? void 0 : _c.email, errorText: this.errors.email, inputHandler: this.inputHandler })), index.h("div", { key: '3b34f0cb11d358db2220c01aac90e8b7ba3cc01b', class: "col-12 col-md-6" }, index.h("form-control-number-masked", { key: '52c62ec653fb917a248a302f7cb5ad46dc7bcc23', name: "phone", label: "Phone Number", defaultValue: (_d = this.representativeDefaultValue) === null || _d === void 0 ? void 0 : _d.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: formInputMasks.PHONE_MASKS.US })), index.h("div", { key: 'd287ec225af1541cca227d3b8bc54466cbb86b07', class: "col-12 col-md-4" }, index.h("form-control-date", { key: '7e1ff6cc40b01dc7f6ad0ad84d73c0e59eea0d6f', name: "dob_full", label: "Birth Date", defaultValue: (_e = this.representativeDefaultValue) === null || _e === void 0 ? void 0 : _e.dob_full, errorText: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: (e) => inputHandlers.updateDateOfBirthFormValues(e, this.formController), helpText: "Must be 18 or older." })), index.h("div", { key: '283b09c845f1a12f4974f82a26fffbf7c5f608ba', class: "col-12 col-md-8" }, (!((_f = this.representativeDefaultValue) === null || _f === void 0 ? void 0 : _f.ssn_last4) || this.isEditingIdentification) ? (index.h("form-control-number-masked", { name: "identification_number", label: this.country === Business.CountryCode.CAN ? countryConfig.countryLabels[this.country].idNumberLabelOptional : countryConfig.countryLabels[this.country].idNumberLabel, defaultValue: this.isEditingIdentification ? '' : (_g = this.representativeDefaultValue) === null || _g === void 0 ? void 0 : _g.identification_number, errorText: this.errors.identification_number, inputHandler: this.inputHandler, mask: formInputMasks.IDENTITY_MASKS[this.country], helpText: countryConfig.countryLabels[this.country].identityHelpText })) : (index.h("div", null, index.h("label", { class: "form-label", part: parts.label }, this.country === Business.CountryCode.CAN ? countryConfig.countryLabels[this.country].idNumberLabelOptional : countryConfig.countryLabels[this.country].idNumberLabel), index.h("div", { class: "input-group mb-3" }, index.h("input", { type: "text", class: "form-control", part: parts.inputDisabled, value: `****${(_h = this.representativeDefaultValue) === null || _h === void 0 ? void 0 : _h.ssn_last4}`, disabled: true }), index.h("button", { class: "btn btn-secondary", type: "button", part: parts.buttonSecondary, onClick: () => {
1013
+ return (index.h("form", { key: 'ef49167cc726b3d4efa128503553a77a7627ebee' }, index.h("fieldset", { key: '3714ce7eab6e9cee062911564d1c2635b68dfc8b' }, index.h("div", { key: '4f27236b0438e29d7449bf5e9f71c00c7245effa', class: "d-flex align-items-center gap-2" }, index.h("legend", { key: 'adc144da314549264571b245c5388ab56c1dbbf1', class: "mb-0", part: parts.heading2 }, "Representative"), index.h("form-control-tooltip", { key: 'bcc76add04febe984427103a594aa63cab17bd27', helpText: "The representative for your business needs to be someone who has significant control over managing your business's finance. You will have an opportunity to add owners later in the form." })), index.h("hr", { key: '98bfed19989ee57e451a7005f3e60af16cc5d3b5', class: "mt-2" }), index.h("div", { key: '8f5e0e3deed2627ecf9f77290f268c0e2ee68bfa', class: "row gy-3" }, index.h("div", { key: 'b1205284a54a608b9c3b6be386e134849c9c6b25', class: "col-12 col-md-8" }, index.h("form-control-text", { key: '36fcd91ca263adfd9fb69dc88f15404f93a8bc13', name: "name", label: "Full Name", defaultValue: (_a = this.representativeDefaultValue) === null || _a === void 0 ? void 0 : _a.name, errorText: this.errors.name, inputHandler: this.inputHandler })), index.h("div", { key: '879337d3c6a120f5dc9de3cd3364b34b9c4689df', class: "col-12 col-md-4" }, index.h("form-control-text", { key: 'ff2e4d29e76b93693735b35cbaca4416f0cd28a0', name: "title", label: "Title", defaultValue: (_b = this.representativeDefaultValue) === null || _b === void 0 ? void 0 : _b.title, errorText: this.errors.title, inputHandler: this.inputHandler, helpText: "Role at your business, e.g. President, CEO, Treasurer." })), index.h("div", { key: '2a011b74b4c203ae4a309d7d76ea8fd0631a5f2c', class: "col-12 col-md-6" }, index.h("form-control-text", { key: '1ef20c59829ed3abe81cc53355bbafd5d4894360', name: "email", label: "Email Address", defaultValue: (_c = this.representativeDefaultValue) === null || _c === void 0 ? void 0 : _c.email, errorText: this.errors.email, inputHandler: this.inputHandler })), index.h("div", { key: '460dad175238fdfea8c79666343943a95aac0fd5', class: "col-12 col-md-6" }, index.h("form-control-number-masked", { key: '7bd3ad79f6da1d33e38c2246d9c0378c2ef8b7d7', name: "phone", label: "Phone Number", defaultValue: (_d = this.representativeDefaultValue) === null || _d === void 0 ? void 0 : _d.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: formInputMasks.PHONE_MASKS.US })), index.h("div", { key: 'cda84bfc9f88a35177a42b7f9ec4c58292600c0b', class: "col-12 col-md-4" }, index.h("form-control-date", { key: '5ed66fabc97afc94a5839135add25dbcb5237900', name: "dob_full", label: "Birth Date", defaultValue: (_e = this.representativeDefaultValue) === null || _e === void 0 ? void 0 : _e.dob_full, errorText: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: (e) => inputHandlers.updateDateOfBirthFormValues(e, this.formController), helpText: "Must be 18 or older." })), index.h("div", { key: '0e19619fd081ea9dacd0eb25388a4c7b2c993312', class: "col-12 col-md-8" }, (!((_f = this.representativeDefaultValue) === null || _f === void 0 ? void 0 : _f.ssn_last4) || this.isEditingIdentification) ? (index.h("form-control-number-masked", { name: "identification_number", label: countryConfig.countryLabels[this.country].idNumberLabel, defaultValue: this.isEditingIdentification ? '' : (_g = this.representativeDefaultValue) === null || _g === void 0 ? void 0 : _g.identification_number, errorText: this.errors.identification_number, inputHandler: this.inputHandler, mask: formInputMasks.IDENTITY_MASKS[this.country], helpText: countryConfig.countryLabels[this.country].identityHelpText })) : (index.h("div", null, index.h("label", { class: "form-label", part: parts.label }, countryConfig.countryLabels[this.country].idNumberLabel), index.h("div", { class: "input-group mb-3" }, index.h("input", { type: "text", class: "form-control", part: parts.inputDisabled, value: `****${(_h = this.representativeDefaultValue) === null || _h === void 0 ? void 0 : _h.ssn_last4}`, disabled: true }), index.h("button", { class: "btn btn-secondary", type: "button", part: parts.buttonSecondary, onClick: () => {
882
1014
  this.isEditingIdentification = true;
883
1015
  // Clear current value to force validation
884
1016
  inputHandlers.updateFormValues(this.formController, {
885
1017
  identification_number: '',
886
1018
  ssn_last4: null
887
1019
  });
888
- } }, "Change"))))), index.h("div", { key: '0a40679570df7b85faa7530797ebc21ca8794263', class: "col-12" }, index.h("identity-address-form", { key: '5a1590251365260413ab63ce9a417d3d71c71e84', errors: this.errors.address, defaultValues: (_j = this.representativeDefaultValue) === null || _j === void 0 ? void 0 : _j.address, handleFormUpdate: this.onAddressFormUpdate, country: this.country }))))));
1020
+ } }, "Change"))))), index.h("div", { key: '6647390b209f5a630bf60e8952a7b0e70c92ca8a', class: "col-12" }, index.h("identity-address-form", { key: '9755d0450fc8d83ba0a98a304455df346ff33e7f', errors: this.errors.address, defaultValues: (_j = this.representativeDefaultValue) === null || _j === void 0 ? void 0 : _j.address, handleFormUpdate: this.onAddressFormUpdate, country: this.country }))))));
889
1021
  }
890
1022
  };
891
1023
 
@@ -1138,339 +1270,6 @@ const BusinessTermsConditionsFormStep = class {
1138
1270
  }
1139
1271
  };
1140
1272
 
1141
- const businessDocumentOptions = [
1142
- { label: 'Select a document type', value: '' },
1143
- { label: 'Articles of Incorporation', value: 'articles_of_incorporation' },
1144
- { label: 'Business Registration', value: 'business_registration' },
1145
- ];
1146
- const financialDocumentOptions = [
1147
- { label: 'Select a document type', value: '' },
1148
- { label: 'Voided Check', value: 'voided_check' },
1149
- { label: 'Bank Statement', value: 'bank_statement' },
1150
- ];
1151
- const personalDocGroup1Options = [
1152
- { label: 'Select a document type', value: '' },
1153
- { label: 'Canadian Passport', value: 'passport' },
1154
- { label: 'Canadian Driver\'s License', value: 'driver_license' },
1155
- { label: 'Canadian Government Issued ID Card', value: 'government_id' },
1156
- { label: 'Permanent Resident Card', value: 'resident_card' },
1157
- { label: 'Certificate of Indian Status', value: 'status_card' },
1158
- { label: 'US State Issued Driver\'s License', value: 'driver_license' },
1159
- ];
1160
- const personalDocGroup2Options = [
1161
- { label: 'Select a document type', value: '' },
1162
- { label: 'Nexus Card (Photo ID)', value: 'nexus_card' },
1163
- { label: 'Canadian Citizenship/Naturalization Card or Certificate', value: 'citizenship_card' },
1164
- { label: 'Foreign Passport', value: 'foreign_passport' },
1165
- { label: 'Canadian Birth Certificate', value: 'birth_certificate' },
1166
- { label: 'Social Insurance Number (SIN) Card', value: 'sin_card' },
1167
- { label: 'Social Security Number (SSN) Card', value: 'ssn_card' },
1168
- ];
1169
- const staticCategories = [
1170
- {
1171
- label: 'Business Document',
1172
- value: 'business_document',
1173
- docTypeOptions: businessDocumentOptions,
1174
- },
1175
- {
1176
- label: 'Financial Document',
1177
- value: 'financial_document',
1178
- docTypeOptions: financialDocumentOptions,
1179
- },
1180
- ];
1181
- function buildOwnerCategories(owners) {
1182
- const group1Opts = personalDocGroup1Options.filter(o => o.value !== '');
1183
- const group2Opts = personalDocGroup2Options.filter(o => o.value !== '');
1184
- return owners.map(owner => ({
1185
- label: `${owner.name} - Identity Document`,
1186
- value: `personal_${owner.id}`,
1187
- identityId: owner.id,
1188
- docTypeOptions: [
1189
- { label: 'Select a document type', value: '' },
1190
- { label: '── Group 1 ──', value: '_group1_header' },
1191
- ...group1Opts,
1192
- { label: '── Group 2 ──', value: '_group2_header' },
1193
- ...group2Opts,
1194
- ],
1195
- }));
1196
- }
1197
- const financialOnlyCategories = [
1198
- {
1199
- label: 'Financial Document',
1200
- value: 'financial_document',
1201
- docTypeOptions: financialDocumentOptions,
1202
- },
1203
- ];
1204
- function buildAllCategories(owners, country) {
1205
- if (country === Business.CountryCode.USA) {
1206
- return financialOnlyCategories;
1207
- }
1208
- return [...staticCategories, ...buildOwnerCategories(owners)];
1209
- }
1210
- const personalDocGroup1Types = new Set(personalDocGroup1Options.filter(o => o.value).map(o => o.value));
1211
- const personalDocGroup2Types = new Set(personalDocGroup2Options.filter(o => o.value).map(o => o.value));
1212
-
1213
- const DocumentUploadFormStep = class {
1214
- constructor(hostRef) {
1215
- index.registerInstance(this, hostRef);
1216
- this.errorEvent = index.createEvent(this, "error-event", 7);
1217
- this.stepCompleteEvent = index.createEvent(this, "complete-form-step-event", 7);
1218
- this.formLoading = index.createEvent(this, "formLoading", 7);
1219
- this.owners = [];
1220
- this.existingDocuments = [];
1221
- this.selectedCategory = '';
1222
- this.selectedDocType = '';
1223
- this.uploadQueue = [];
1224
- this.isLoading = false;
1225
- this.errors = {};
1226
- this.fileInputKey = 0;
1227
- this.categories = [];
1228
- this.getData = () => {
1229
- this.isLoading = true;
1230
- this.getBusiness({
1231
- onSuccess: (response) => {
1232
- const { owners, documents } = response.data;
1233
- this.owners = owners || [];
1234
- this.existingDocuments = documents || [];
1235
- this.categories = buildAllCategories(this.owners, this.country);
1236
- },
1237
- onError: ({ error, code, severity }) => {
1238
- this.errorEvent.emit({
1239
- message: error,
1240
- errorCode: code,
1241
- severity: severity,
1242
- });
1243
- },
1244
- final: () => {
1245
- this.isLoading = false;
1246
- }
1247
- });
1248
- };
1249
- this.handleCategoryChange = (_name, value) => {
1250
- this.selectedCategory = value;
1251
- this.selectedDocType = '';
1252
- };
1253
- this.handleDocTypeChange = (_name, value) => {
1254
- if (value.startsWith('_') && value.endsWith('_header'))
1255
- return;
1256
- this.selectedDocType = value;
1257
- };
1258
- this.handleFileSelected = async (e) => {
1259
- const fileList = Array.from(e.detail.fileList);
1260
- const category = this.categories.find(c => c.value === this.selectedCategory);
1261
- if (!category)
1262
- return;
1263
- const docTypeOption = category.docTypeOptions.find(o => o.value === this.selectedDocType);
1264
- const docTypeLabel = (docTypeOption === null || docTypeOption === void 0 ? void 0 : docTypeOption.label) || this.selectedDocType;
1265
- const newEntries = fileList.map(file => ({
1266
- categoryLabel: category.label,
1267
- categoryValue: category.value,
1268
- docTypeLabel,
1269
- docTypeValue: this.selectedDocType,
1270
- fileName: file.name,
1271
- file,
1272
- identityId: category.identityId,
1273
- status: 'uploading',
1274
- }));
1275
- const startIndex = this.uploadQueue.length;
1276
- this.uploadQueue = [...this.uploadQueue, ...newEntries];
1277
- this.selectedCategory = '';
1278
- this.selectedDocType = '';
1279
- this.fileInputKey++;
1280
- await Promise.all(newEntries.map(async (entry, i) => {
1281
- const index = startIndex + i;
1282
- try {
1283
- const docData = new Plaid.EntityDocument({ file: entry.file, document_type: entry.docTypeValue }, this.businessId, entry.identityId);
1284
- const recordCreated = await this.postDocumentRecordData(docData);
1285
- if (!recordCreated) {
1286
- this.uploadQueue = this.uploadQueue.map((e, j) => j === index ? Object.assign(Object.assign({}, e), { status: 'error' }) : e);
1287
- return;
1288
- }
1289
- const uploaded = await this.uploadDocument(docData);
1290
- this.uploadQueue = this.uploadQueue.map((e, j) => j === index ? Object.assign(Object.assign({}, e), { status: uploaded ? 'uploaded' : 'error' }) : e);
1291
- }
1292
- catch (_a) {
1293
- this.uploadQueue = this.uploadQueue.map((e, j) => j === index ? Object.assign(Object.assign({}, e), { status: 'error' }) : e);
1294
- }
1295
- }));
1296
- };
1297
- this.postDocumentRecordData = async (docData) => {
1298
- const payload = docData.record_data;
1299
- return new Promise((resolve) => {
1300
- this.postDocumentRecord({
1301
- payload,
1302
- onSuccess: (response) => {
1303
- resolve(this.handleDocRecordResponse(docData, response));
1304
- },
1305
- onError: ({ error, code, severity }) => {
1306
- this.errorEvent.emit({
1307
- message: error,
1308
- errorCode: code,
1309
- severity: severity,
1310
- });
1311
- resolve(false);
1312
- },
1313
- });
1314
- });
1315
- };
1316
- this.handleDocRecordResponse = (docData, response) => {
1317
- if (response.error) {
1318
- this.errorEvent.emit({
1319
- errorCode: Plaid.ComponentErrorCodes.POST_ERROR,
1320
- message: response.error.message,
1321
- severity: Plaid.ComponentErrorSeverity.ERROR,
1322
- data: response.error,
1323
- });
1324
- return false;
1325
- }
1326
- else {
1327
- docData.setPresignedUrl(response.data.presigned_url);
1328
- return true;
1329
- }
1330
- };
1331
- this.uploadDocument = async (docData) => {
1332
- if (!docData.presigned_url) {
1333
- throw new Error('Presigned URL is not set');
1334
- }
1335
- const fileData = await docData.getFileData();
1336
- const response = await fetch(docData.presigned_url, {
1337
- method: 'PUT',
1338
- body: fileData,
1339
- });
1340
- if (!response.ok) {
1341
- this.errorEvent.emit({
1342
- errorCode: Plaid.ComponentErrorCodes.POST_ERROR,
1343
- message: 'Failed to upload document',
1344
- severity: Plaid.ComponentErrorSeverity.ERROR,
1345
- });
1346
- return false;
1347
- }
1348
- return true;
1349
- };
1350
- }
1351
- propChanged() {
1352
- this.initializeApi();
1353
- }
1354
- watchHandler(newValue) {
1355
- this.formLoading.emit(newValue);
1356
- }
1357
- async validateAndSubmit({ onSuccess }) {
1358
- const validationErrors = this.validate();
1359
- if (Object.keys(validationErrors).length > 0) {
1360
- this.errors = validationErrors;
1361
- return;
1362
- }
1363
- this.errors = {};
1364
- this.stepCompleteEvent.emit({ response: null, formStep: eventTypes.BusinessFormStep.documentUpload });
1365
- onSuccess();
1366
- }
1367
- componentWillLoad() {
1368
- this.initializeApi();
1369
- if (this.getBusiness) {
1370
- this.getData();
1371
- }
1372
- }
1373
- initializeApi() {
1374
- if (this.authToken && this.businessId) {
1375
- this.getBusiness = paymentProvisioningActions.makeGetBusiness({
1376
- authToken: this.authToken,
1377
- businessId: this.businessId,
1378
- service: new business_service.BusinessService()
1379
- });
1380
- this.postDocumentRecord = paymentProvisioningActions.makePostDocumentRecord({
1381
- authToken: this.authToken,
1382
- service: new business_service.DocumentRecordService()
1383
- });
1384
- }
1385
- else {
1386
- this.errorEvent.emit({
1387
- message: 'Missing required props',
1388
- errorCode: Plaid.ComponentErrorCodes.MISSING_PROPS,
1389
- severity: Plaid.ComponentErrorSeverity.ERROR,
1390
- });
1391
- }
1392
- }
1393
- get categoryOptions() {
1394
- return [
1395
- { label: 'Select a category', value: '' },
1396
- ...this.categories.map(c => ({ label: c.label, value: c.value })),
1397
- ];
1398
- }
1399
- get docTypeOptions() {
1400
- if (!this.selectedCategory) {
1401
- return [{ label: 'Select a category first', value: '' }];
1402
- }
1403
- const category = this.categories.find(c => c.value === this.selectedCategory);
1404
- return (category === null || category === void 0 ? void 0 : category.docTypeOptions) || [{ label: 'Select a category first', value: '' }];
1405
- }
1406
- validate() {
1407
- if (this.allowOptionalFields)
1408
- return {};
1409
- const errors = {};
1410
- const financialDocTypes = ['voided_check', 'bank_statement'];
1411
- const hasExistingDoc = (types) => this.existingDocuments.some(doc => types.includes(doc.document_type));
1412
- const hasUploadedDoc = (categoryValue) => this.uploadQueue.some(entry => entry.categoryValue === categoryValue && entry.status === 'uploaded');
1413
- if (!hasUploadedDoc('financial_document') && !hasExistingDoc(financialDocTypes)) {
1414
- errors['financial_document'] = 'Please upload a financial document';
1415
- }
1416
- if (this.country === Business.CountryCode.CAN) {
1417
- const businessDocTypes = ['articles_of_incorporation', 'business_registration'];
1418
- if (!hasUploadedDoc('business_document') && !hasExistingDoc(businessDocTypes)) {
1419
- errors['business_document'] = 'Please upload a business document';
1420
- }
1421
- for (const owner of this.owners) {
1422
- const ownerCategoryValue = `personal_${owner.id}`;
1423
- const ownerDocs = this.uploadQueue.filter(entry => entry.categoryValue === ownerCategoryValue && entry.status === 'uploaded');
1424
- const hasGroup1 = ownerDocs.some(d => personalDocGroup1Types.has(d.docTypeValue));
1425
- const hasGroup2 = ownerDocs.some(d => personalDocGroup2Types.has(d.docTypeValue));
1426
- if (!hasGroup1) {
1427
- errors[`personal_group1_${owner.id}`] =
1428
- `Please upload a Group 1 identity document for ${owner.name}`;
1429
- }
1430
- if (!hasGroup2) {
1431
- errors[`personal_group2_${owner.id}`] =
1432
- `Please upload a Group 2 identity document for ${owner.name}`;
1433
- }
1434
- }
1435
- }
1436
- return errors;
1437
- }
1438
- render() {
1439
- if (this.isLoading) {
1440
- return index.h(paymentProvisioningLoading.PaymentProvisioningLoading, null);
1441
- }
1442
- return (index.h("form", null, index.h("fieldset", null, index.h("legend", { class: "mb-0", part: parts.heading2 }, "Document Uploads"), index.h("hr", { class: "mt-2" }), index.h("business-documents-on-file", { documents: this.existingDocuments, isLoading: this.isLoading })), index.h("fieldset", { class: "mt-4" }, index.h("div", { class: "d-flex align-items-center gap-2" }, index.h("legend", { class: "mb-0", part: parts.heading2 }, "Add Document"), index.h("form-control-tooltip", { helpText: "Upload documents one at a time. Select the category and type, then choose a file. For identity documents, two documents from different groups are required per owner." })), index.h("hr", { class: "mt-2" }), index.h("div", { class: "row gy-3" }, index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-select", { name: "document_category", label: "Document Category", options: this.categoryOptions, defaultValue: this.selectedCategory, inputHandler: this.handleCategoryChange })), index.h("div", { class: "col-12 col-md-6" }, index.h("form-control-select", { name: "document_type", label: "Document Type", options: this.docTypeOptions, defaultValue: this.selectedDocType, inputHandler: this.handleDocTypeChange, disabled: !this.selectedCategory })), index.h("div", { class: "col-12" }, index.h("form-control-file", { key: this.fileInputKey, name: "document_file", label: "Upload Document", documentType: this.selectedDocType, onFileSelected: this.handleFileSelected, disabled: !this.selectedDocType, multiple: false })))), index.h("document-upload-list", { documents: this.uploadQueue }), Object.keys(this.errors).length > 0 && (index.h("div", { class: "alert alert-danger mt-3" }, index.h("ul", { class: "mb-0" }, Object.values(this.errors).map(err => index.h("li", null, err)))))));
1443
- }
1444
- static get watchers() { return {
1445
- "authToken": ["propChanged"],
1446
- "businessId": ["propChanged"],
1447
- "isLoading": ["watchHandler"]
1448
- }; }
1449
- };
1450
-
1451
- const DocumentUploadList = class {
1452
- constructor(hostRef) {
1453
- index.registerInstance(this, hostRef);
1454
- this.documents = [];
1455
- }
1456
- renderStatus(status) {
1457
- switch (status) {
1458
- case 'uploading':
1459
- return index.h("span", { class: "badge bg-info" }, "Uploading...");
1460
- case 'uploaded':
1461
- return index.h("span", { class: "badge bg-success" }, "Uploaded");
1462
- case 'error':
1463
- return index.h("span", { class: "badge bg-danger" }, "Error");
1464
- }
1465
- }
1466
- render() {
1467
- if (!this.documents.length) {
1468
- return null;
1469
- }
1470
- return (index.h("div", { class: "mt-4" }, index.h("div", { class: "card", part: parts.card }, index.h("div", { class: "card-body" }, index.h("h5", { class: "card-title", part: parts.heading2 }, "Uploaded Documents"), index.h("div", { class: "table-responsive" }, index.h("table", { class: "table table-sm table-borderless", part: parts.table }, index.h("thead", null, index.h("tr", null, index.h("th", { style: { width: '25%' }, part: parts.tableHeadCell, scope: "col" }, "Category"), index.h("th", { style: { width: '25%' }, part: parts.tableHeadCell, scope: "col" }, "Document Type"), index.h("th", { style: { width: '30%' }, part: parts.tableHeadCell, scope: "col" }, "File Name"), index.h("th", { style: { width: '20%' }, part: parts.tableHeadCell, scope: "col" }, "Status"))), index.h("tbody", null, this.documents.map((doc, index$1) => (index.h("tr", { class: index$1 === 0 ? 'border-bottom border-top' : 'border-bottom' }, index.h("td", { part: parts.tableCell }, doc.categoryLabel), index.h("td", { part: parts.tableCell }, doc.docTypeLabel), index.h("td", { part: parts.tableCell }, doc.fileName), index.h("td", { part: parts.tableCell }, this.renderStatus(doc.status))))))))))));
1471
- }
1472
- };
1473
-
1474
1273
  const LegalAddressFormStep = class {
1475
1274
  constructor(hostRef) {
1476
1275
  index.registerInstance(this, hostRef);
@@ -1682,13 +1481,6 @@ const OwnerForm = class {
1682
1481
  async returnOwnerData() {
1683
1482
  return this.ownerId;
1684
1483
  }
1685
- async getOwnershipPercentage() {
1686
- var _a;
1687
- return ((_a = this.formController.values.getValue()) === null || _a === void 0 ? void 0 : _a.ownership_percentage) || null;
1688
- }
1689
- async setOwnershipPercentageError(message) {
1690
- this.formController.setFieldError('ownership_percentage', message);
1691
- }
1692
1484
  async validate() {
1693
1485
  return this.formController.validate();
1694
1486
  }
@@ -1763,7 +1555,7 @@ const OwnerForm = class {
1763
1555
  });
1764
1556
  }
1765
1557
  render() {
1766
- return (index.h(index.Host, { key: 'b168e9f5a52416984e6a04ab5f0771b63ee28b2e', style: { display: 'block' } }, index.h("form", { key: 'd22a6aae3f5debd30d87b3bd37c67390a46c4590', onSubmit: this.validateAndSubmit }, index.h("fieldset", { key: '30597bc1f4983bddbdc0ed45e6be7e715d0b9b8e' }, index.h("legend", { key: '508f2a777bd0422572002053f6c167242252850d', class: "fw-semibold fs-5", part: parts.heading3 }, this.formTitle), index.h("br", { key: '2dd17c21e931a2a9c15489828c7d1d0542ff4de4' }), index.h("div", { key: 'e9d7d7a10546e5e1bdabb0a994d994c47cd77bd6', class: "row gy-3" }, index.h("owner-form-inputs", { key: 'e556391c25a05d3f89601f1e0ac3834a5c26becd', ownerDefaultValue: this.formController.getInitialValues(), errors: this.errors, formController: this.formController, country: this.country }), index.h("div", { key: '48eb9390459f2ca619914e54726c9a0ae1290e31', class: "d-flex gap-2 justify-content-start" }, index.h(button.Button, { key: 'f9ccd8732981cdec9675332cc8f5c14d4938cbad', variant: "secondary", type: "button", onClick: this.handleRemoveOwner, hidden: !this.showRemoveButton }, "Remove"), index.h(button.Button, { key: '607a54ce6c4c0af42f3f8c7cbe1374a69752eca3', variant: "primary", type: "submit", onClick: this.handleAddOwner, disabled: this.isLoading }, this.submitButtonText))), index.h("hr", { key: '9ec1f815d8c3335daf2a4f98c2679930e22956e3' })))));
1558
+ return (index.h(index.Host, { key: '1661676befd63f9308edcb02be179db71b7c9d99', style: { display: 'block' } }, index.h("form", { key: '4961f358ca8953156477d455cacb19e4dec3cc29', onSubmit: this.validateAndSubmit }, index.h("fieldset", { key: '27ecfec87ae93a1bdec94f3cc925558dc8f0ff23' }, index.h("legend", { key: '4c194cf9e08e6fab9982b95a4b12c3c3a8cecdc3', class: "fw-semibold fs-5", part: parts.heading3 }, this.formTitle), index.h("br", { key: 'ef1f9b184dac866d27cfa245106d90db0954fa51' }), index.h("div", { key: '2936ecc396220f8b80e5d8454bc6f6f70cb3ae73', class: "row gy-3" }, index.h("owner-form-inputs", { key: 'f34d38b718ed7fde67102aa1034b5e6377e001f8', ownerDefaultValue: this.formController.getInitialValues(), errors: this.errors, formController: this.formController, country: this.country }), index.h("div", { key: '2d5266bc1a7f4aeb12cab8a494107f2668b2fb0e', class: "d-flex gap-2 justify-content-start" }, index.h(button.Button, { key: '39631fd0364221ac2a274d8aa794a1f3c8d28780', variant: "secondary", type: "button", onClick: this.handleRemoveOwner, hidden: !this.showRemoveButton }, "Remove"), index.h(button.Button, { key: '120fbae294f8f67bd14fe0be5dc1bcf881ffd489', variant: "primary", type: "submit", onClick: this.handleAddOwner, disabled: this.isLoading }, this.submitButtonText))), index.h("hr", { key: '73eccba19a595b67f64139769a495d5a27e02b2f' })))));
1767
1559
  }
1768
1560
  static get watchers() { return {
1769
1561
  "isLoading": ["loadingWatcher"]
@@ -2083,6 +1875,7 @@ const PlaidVerification = class {
2083
1875
  };
2084
1876
 
2085
1877
  exports.additional_questions_form_step = AdditionalQuestionsFormStep;
1878
+ exports.bank_account_document_form_inputs = BankAccountDocumentFormInputs;
2086
1879
  exports.bank_account_form_inputs = BankAccountFormInputs;
2087
1880
  exports.bank_account_form_inputs_canada = BankAccountFormInputsCanada;
2088
1881
  exports.business_bank_account_form_step = BusinessBankAccountFormStep;
@@ -2092,8 +1885,6 @@ exports.business_owners_form_step = BusinessOwnersFormStep;
2092
1885
  exports.business_representative_form_inputs = BusinessRepresentativeFormInputs;
2093
1886
  exports.business_representative_form_step = BusinessRepresentativeFormStep;
2094
1887
  exports.business_terms_conditions_form_step = BusinessTermsConditionsFormStep;
2095
- exports.document_upload_form_step = DocumentUploadFormStep;
2096
- exports.document_upload_list = DocumentUploadList;
2097
1888
  exports.legal_address_form_step = LegalAddressFormStep;
2098
1889
  exports.owner_form = OwnerForm;
2099
1890
  exports.plaid_verification = PlaidVerification;