@justifi/webcomponents 4.19.3-rc-2 → 4.20.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 (383) hide show
  1. package/dist/cjs/{Analytics-adc90fc6.js → Analytics-03981aad.js} +4 -3
  2. package/dist/cjs/{Api-3bc6e43f.js → Api-b98b256f.js} +3 -3
  3. package/dist/cjs/{Business-aacbe893.js → Business-aa799fec.js} +104 -9
  4. package/dist/cjs/additional-questions-details_5.cjs.entry.js +1 -1
  5. package/dist/cjs/{business-additional-questions-schema-cf545610.js → business-additional-questions-schema-26b0eecb.js} +1 -1
  6. package/dist/cjs/business-details-core.cjs.entry.js +1 -1
  7. package/dist/cjs/{business-form-options-582467fe.js → business-form-options-5db0bd5e.js} +2 -2
  8. package/dist/cjs/{payload-parsers-1cbc3b57.js → business-identity-schema-503ecb77.js} +1 -47
  9. package/dist/cjs/{business.service-090a21e1.js → business.service-031c0084.js} +7 -6
  10. package/dist/cjs/check-pkg-version-89d6d146.js +24 -0
  11. package/dist/cjs/config-05767cba.js +15 -0
  12. package/dist/cjs/custom-popper.cjs.entry.js +1894 -0
  13. package/dist/cjs/form-alert_5.cjs.entry.js +2 -2
  14. package/dist/cjs/form-control-checkbox_9.cjs.entry.js +26 -26
  15. package/dist/cjs/form-control-date_3.cjs.entry.js +4 -4
  16. package/dist/cjs/form-control-error-text_4.cjs.entry.js +9 -9
  17. package/dist/cjs/{get-payout-csv-238e839a.js → get-payout-csv-3a3260ec.js} +5 -4
  18. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +1 -1
  19. package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +15 -14
  20. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +6 -5
  21. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +4 -4
  22. package/dist/cjs/justifi-business-details.cjs.entry.js +8 -5
  23. package/dist/cjs/justifi-business-form.cjs.entry.js +17 -14
  24. package/dist/cjs/justifi-card-form.cjs.entry.js +6 -5
  25. package/dist/cjs/justifi-checkout-core.cjs.entry.js +5 -5
  26. package/dist/cjs/justifi-checkout.cjs.entry.js +10 -7
  27. package/dist/cjs/justifi-details.cjs.entry.js +1 -1
  28. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +7 -4
  29. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +10 -12
  30. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +12 -11
  31. package/dist/cjs/justifi-payment-details.cjs.entry.js +7 -4
  32. package/dist/cjs/justifi-payment-form.cjs.entry.js +11 -8
  33. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +2 -2
  34. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +1 -1
  35. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +9 -6
  36. package/dist/cjs/justifi-payments-list.cjs.entry.js +7 -4
  37. package/dist/cjs/justifi-payout-details.cjs.entry.js +7 -4
  38. package/dist/cjs/justifi-payouts-list.cjs.entry.js +7 -4
  39. package/dist/cjs/justifi-refund-form.cjs.entry.js +5 -4
  40. package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +2 -2
  41. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +9 -6
  42. package/dist/cjs/loader.cjs.js +1 -1
  43. package/dist/cjs/{package-22d30c5d.js → package-7fdd14b9.js} +4 -2
  44. package/dist/cjs/payment-details-core.cjs.entry.js +2 -2
  45. package/dist/cjs/{payment.service-c92635c8.js → payment.service-4b1c0a20.js} +4 -3
  46. package/dist/cjs/payments-list-core.cjs.entry.js +18 -13
  47. package/dist/cjs/payments-list-filters_2.cjs.entry.js +17266 -0
  48. package/dist/cjs/payout-details-core.cjs.entry.js +3 -3
  49. package/dist/cjs/payouts-list-core.cjs.entry.js +4 -4
  50. package/dist/cjs/{schema-validations-2733de42.js → schema-validations-0a7e46a3.js} +1 -1
  51. package/dist/cjs/styled-host-9e0b67b3.js +14 -0
  52. package/dist/cjs/{utils-89d86e29.js → utils-af1b60a9.js} +0 -16
  53. package/dist/cjs/utils-f8a6962c.js +25 -0
  54. package/dist/cjs/webcomponents.cjs.js +1 -1
  55. package/dist/collection/api/Api.js +3 -3
  56. package/dist/collection/api/Business.js +66 -7
  57. package/dist/collection/api/Identity.js +39 -3
  58. package/dist/collection/api/services/analytics.service.js +2 -1
  59. package/dist/collection/api/services/business.service.js +6 -5
  60. package/dist/collection/api/services/checkout.service.js +3 -2
  61. package/dist/collection/api/services/insurance.service.js +3 -2
  62. package/dist/collection/api/services/payment.service.js +3 -2
  63. package/dist/collection/api/services/payout.service.js +4 -3
  64. package/dist/collection/api/services/provision.service.js +2 -1
  65. package/dist/collection/api/services/reports.service.js +2 -1
  66. package/dist/collection/collection-manifest.json +4 -1
  67. package/dist/collection/components/bank-account-form/bank-account-form.js +4 -3
  68. package/dist/collection/components/business-details/business-details.js +2 -0
  69. package/dist/collection/components/business-forms/business-form/business-form.js +7 -5
  70. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +4 -5
  71. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.js +3 -3
  72. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +4 -3
  73. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.js +3 -5
  74. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.js +3 -3
  75. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.js +3 -4
  76. package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +4 -3
  77. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.js +3 -4
  78. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +3 -1
  79. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +4 -3
  80. package/dist/collection/components/business-forms/utils/business-form-options.js +1 -1
  81. package/dist/collection/components/card-form/card-form.js +4 -3
  82. package/dist/collection/components/checkout/checkout-core.js +4 -4
  83. package/dist/collection/components/checkout/checkout.js +4 -2
  84. package/dist/collection/components/checkout/new-payment-method.js +4 -6
  85. package/dist/collection/components/checkout/payment-method-options.js +4 -3
  86. package/dist/collection/components/checkout/saved-payment-method.js +4 -3
  87. package/dist/collection/components/checkout/sezzle-payment-method.js +4 -3
  88. package/dist/collection/components/form/form-control-date.js +26 -28
  89. package/dist/collection/components/form/form-control-select.js +45 -45
  90. package/dist/collection/components/form/form-control-text.js +34 -34
  91. package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +2 -0
  92. package/dist/collection/components/insurance/season-interruption/season-interruption-insurance.js +3 -1
  93. package/dist/collection/components/payment-details/payment-details.js +2 -0
  94. package/dist/collection/components/payment-form/payment-form.js +6 -3
  95. package/dist/collection/components/payments-list/payments-list-core.js +14 -9
  96. package/dist/collection/components/payments-list/payments-list-filters.js +84 -0
  97. package/dist/collection/components/payments-list/payments-list.js +2 -0
  98. package/dist/collection/components/payout-details/payout-details-core.js +1 -1
  99. package/dist/collection/components/payout-details/payout-details.js +2 -0
  100. package/dist/collection/components/payouts-list/payouts-list-core.js +2 -2
  101. package/dist/collection/components/payouts-list/payouts-list.js +2 -0
  102. package/dist/collection/components/refund-form/refund-form.js +3 -2
  103. package/dist/collection/ui-components/custom-popper/custom-popper.js +239 -0
  104. package/dist/collection/ui-components/filters/table-filters-menu.js +89 -0
  105. package/dist/collection/ui-components/filters/utils.js +20 -0
  106. package/dist/collection/utils/check-pkg-version.js +19 -0
  107. package/dist/config.js +11 -0
  108. package/dist/docs.json +531 -27
  109. package/dist/{webcomponents/p-15eafa87.js → esm/Analytics-3103f8e9.js} +4 -3
  110. package/dist/esm/{Api-b09a2f6a.js → Api-c8abc2e0.js} +3 -3
  111. package/dist/esm/{Business-e218b4f4.js → Business-b73d5055.js} +104 -9
  112. package/dist/esm/additional-questions-details_5.entry.js +1 -1
  113. package/dist/esm/{business-additional-questions-schema-956e3caf.js → business-additional-questions-schema-a5583cf8.js} +1 -1
  114. package/dist/esm/business-details-core.entry.js +1 -1
  115. package/dist/esm/{business-form-options-7a9a74fc.js → business-form-options-d790973e.js} +2 -2
  116. package/dist/esm/{payload-parsers-acb719d1.js → business-identity-schema-9e3269fb.js} +2 -44
  117. package/dist/esm/{business.service-37d0cc72.js → business.service-1f589b6e.js} +7 -6
  118. package/dist/esm/check-pkg-version-44e6ad15.js +22 -0
  119. package/dist/esm/config-27764a9d.js +13 -0
  120. package/dist/esm/custom-popper.entry.js +1890 -0
  121. package/dist/esm/form-alert_5.entry.js +2 -2
  122. package/dist/esm/form-control-checkbox_9.entry.js +21 -21
  123. package/dist/esm/form-control-date_3.entry.js +4 -4
  124. package/dist/esm/form-control-error-text_4.entry.js +9 -9
  125. package/dist/esm/{get-payout-csv-a702a0d9.js → get-payout-csv-93427146.js} +5 -4
  126. package/dist/esm/gross-payment-chart-core.entry.js +1 -1
  127. package/dist/esm/justifi-additional-questions-form-step_10.entry.js +15 -14
  128. package/dist/esm/justifi-bank-account-form.entry.js +6 -5
  129. package/dist/esm/justifi-billing-form_2.entry.js +4 -4
  130. package/dist/esm/justifi-business-details.entry.js +8 -5
  131. package/dist/esm/justifi-business-form.entry.js +16 -13
  132. package/dist/esm/justifi-card-form.entry.js +6 -5
  133. package/dist/esm/justifi-checkout-core.entry.js +5 -5
  134. package/dist/esm/justifi-checkout.entry.js +10 -7
  135. package/dist/esm/justifi-details.entry.js +1 -1
  136. package/dist/esm/justifi-gross-payment-chart.entry.js +7 -4
  137. package/dist/esm/justifi-new-payment-method_4.entry.js +10 -12
  138. package/dist/esm/justifi-owner-form_3.entry.js +11 -10
  139. package/dist/esm/justifi-payment-details.entry.js +7 -4
  140. package/dist/esm/justifi-payment-form.entry.js +11 -8
  141. package/dist/esm/justifi-payment-method-form.entry.js +2 -2
  142. package/dist/esm/justifi-payment-provisioning-core.entry.js +1 -1
  143. package/dist/esm/justifi-payment-provisioning.entry.js +9 -6
  144. package/dist/esm/justifi-payments-list.entry.js +7 -4
  145. package/dist/esm/justifi-payout-details.entry.js +7 -4
  146. package/dist/esm/justifi-payouts-list.entry.js +7 -4
  147. package/dist/esm/justifi-refund-form.entry.js +5 -4
  148. package/dist/esm/justifi-season-interruption-insurance-core.entry.js +2 -2
  149. package/dist/esm/justifi-season-interruption-insurance.entry.js +9 -6
  150. package/dist/esm/loader.js +1 -1
  151. package/dist/{webcomponents/p-2e8f4937.js → esm/package-0e3cc41e.js} +4 -2
  152. package/dist/esm/payment-details-core.entry.js +2 -2
  153. package/dist/esm/{payment.service-9359fe15.js → payment.service-02c596b9.js} +4 -3
  154. package/dist/esm/payments-list-core.entry.js +16 -11
  155. package/dist/esm/payments-list-filters_2.entry.js +17261 -0
  156. package/dist/esm/payout-details-core.entry.js +3 -3
  157. package/dist/esm/payouts-list-core.entry.js +4 -4
  158. package/dist/esm/{schema-validations-a83ff220.js → schema-validations-e725d701.js} +2 -2
  159. package/dist/esm/styled-host-3171ae1f.js +12 -0
  160. package/dist/esm/utils-3a4d8f3a.js +22 -0
  161. package/dist/{webcomponents/p-83125497.js → esm/utils-e66d8bca.js} +1 -16
  162. package/dist/esm/webcomponents.js +1 -1
  163. package/dist/module/Analytics.js +2 -1
  164. package/dist/module/Api.js +3 -3
  165. package/dist/module/Business.js +104 -9
  166. package/dist/module/business-additional-questions-form-step-core.js +3 -3
  167. package/dist/module/business-bank-account-form-step.js +4 -3
  168. package/dist/module/business-core-info-form-step-core.js +3 -5
  169. package/dist/module/business-document-upload-form-step.js +4 -3
  170. package/dist/module/business-document-upload-input-group.js +1 -1
  171. package/dist/module/business-documents-on-file.js +1 -1
  172. package/dist/module/business-form-options.js +1 -1
  173. package/dist/module/business-owners-form-step-core.js +3 -3
  174. package/dist/module/business-representative-form-step-core.js +3 -4
  175. package/dist/module/business-terms-conditions-form-step.js +4 -3
  176. package/dist/module/business.service.js +6 -5
  177. package/dist/module/check-pkg-version.js +22 -0
  178. package/dist/module/checkout-core.js +3 -3
  179. package/dist/module/config.js +13 -0
  180. package/dist/module/custom-popper.d.ts +11 -0
  181. package/dist/module/custom-popper.js +6 -0
  182. package/dist/module/custom-popper2.js +1912 -0
  183. package/dist/module/form-control-date2.js +7 -7
  184. package/dist/module/form-control-select2.js +9 -9
  185. package/dist/module/form-control-text2.js +7 -7
  186. package/dist/module/get-payout-csv.js +4 -3
  187. package/dist/module/justifi-bank-account-form.js +3 -2
  188. package/dist/module/justifi-business-details.js +2 -0
  189. package/dist/module/justifi-business-form.js +7 -5
  190. package/dist/module/justifi-card-form.js +3 -2
  191. package/dist/module/justifi-checkout.js +7 -4
  192. package/dist/module/justifi-gross-payment-chart.js +4 -1
  193. package/dist/module/justifi-payment-details.js +2 -0
  194. package/dist/module/justifi-payment-form.js +6 -3
  195. package/dist/module/justifi-payment-provisioning.js +5 -2
  196. package/dist/module/justifi-payments-list.js +42 -10
  197. package/dist/module/justifi-payout-details.js +2 -0
  198. package/dist/module/justifi-payouts-list.js +2 -0
  199. package/dist/module/justifi-refund-form.js +3 -2
  200. package/dist/module/justifi-season-interruption-insurance.js +6 -3
  201. package/dist/module/legal-address-form-step-core.js +3 -4
  202. package/dist/module/new-payment-method.js +3 -5
  203. package/dist/module/owner-form-core2.js +4 -5
  204. package/dist/module/package.js +4 -2
  205. package/dist/module/payment-details-core2.js +1 -1
  206. package/dist/module/payment-method-options.js +3 -2
  207. package/dist/module/payment.service.js +3 -2
  208. package/dist/module/payments-list-core2.js +52 -18
  209. package/dist/module/payments-list-filters.d.ts +11 -0
  210. package/dist/module/payments-list-filters.js +6 -0
  211. package/dist/module/payments-list-filters2.js +17294 -0
  212. package/dist/module/payout-details-core2.js +2 -2
  213. package/dist/module/payouts-list-core2.js +3 -3
  214. package/dist/module/saved-payment-method.js +4 -3
  215. package/dist/module/sezzle-payment-method.js +3 -2
  216. package/dist/module/styled-host.js +1 -1
  217. package/dist/module/table-filters-menu.d.ts +11 -0
  218. package/dist/module/table-filters-menu.js +6 -0
  219. package/dist/module/table-filters-menu2.js +80 -0
  220. package/dist/module/utils2.js +1 -16
  221. package/dist/types/api/Business.d.ts +87 -1
  222. package/dist/types/api/Identity.d.ts +45 -1
  223. package/dist/types/api/Payment.d.ts +8 -0
  224. package/dist/types/components/business-forms/owner-form/owner-form-core.d.ts +44 -1
  225. package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.d.ts +11 -1
  226. package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.d.ts +11 -1
  227. package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.d.ts +24 -1
  228. package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.d.ts +11 -1
  229. package/dist/types/components/checkout/new-payment-method.d.ts +0 -1
  230. package/dist/types/components/form/form-control-date.d.ts +4 -4
  231. package/dist/types/components/form/form-control-select.d.ts +6 -6
  232. package/dist/types/components/form/form-control-text.d.ts +4 -4
  233. package/dist/types/components/payments-list/payments-list-core.d.ts +6 -5
  234. package/dist/types/components/payments-list/payments-list-filters.d.ts +13 -0
  235. package/dist/types/components.d.ts +89 -10
  236. package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +11 -0
  237. package/dist/types/ui-components/custom-popper/custom-popper.d.ts +21 -0
  238. package/dist/types/ui-components/filters/table-filters-menu.d.ts +11 -0
  239. package/dist/types/ui-components/filters/utils.d.ts +2 -0
  240. package/dist/types/utils/check-pkg-version.d.ts +1 -0
  241. package/dist/webcomponents/index.esm.js +0 -1
  242. package/dist/webcomponents/p-056e75be.entry.js +1 -0
  243. package/dist/webcomponents/p-05718341.entry.js +1 -0
  244. package/dist/webcomponents/p-08b0fb31.js +1 -41
  245. package/dist/webcomponents/p-0de026dd.entry.js +1 -0
  246. package/dist/webcomponents/p-0e84986e.entry.js +10 -0
  247. package/dist/webcomponents/p-0f7b9555.entry.js +1 -0
  248. package/dist/webcomponents/p-14c91ffd.js +1 -20
  249. package/dist/webcomponents/p-1612894d.js +1 -0
  250. package/dist/webcomponents/p-1815a43b.js +1 -0
  251. package/dist/webcomponents/p-1ad5995e.js +1 -3599
  252. package/dist/webcomponents/p-1eee25f3.entry.js +19 -0
  253. package/dist/webcomponents/p-1ff8810b.js +1 -29
  254. package/dist/webcomponents/p-20dafb46.entry.js +1 -0
  255. package/dist/webcomponents/p-2338affa.js +1 -213
  256. package/dist/webcomponents/p-277aee05.js +1 -0
  257. package/dist/webcomponents/p-2b6c9c4f.js +1 -7
  258. package/dist/webcomponents/p-2c51d29f.js +1 -0
  259. package/dist/webcomponents/p-2eab3c90.js +1 -3052
  260. package/dist/webcomponents/p-3a1f19f3.entry.js +1 -0
  261. package/dist/webcomponents/p-3c7fac29.entry.js +1 -0
  262. package/dist/webcomponents/p-401d6607.js +1 -0
  263. package/dist/webcomponents/p-428e9b64.entry.js +1 -0
  264. package/dist/webcomponents/p-430f81c6.entry.js +1 -0
  265. package/dist/webcomponents/p-437f9114.js +1 -0
  266. package/dist/webcomponents/p-44055818.js +1 -0
  267. package/dist/webcomponents/p-4628cc9b.entry.js +1 -0
  268. package/dist/webcomponents/p-4cc9df76.entry.js +1 -0
  269. package/dist/webcomponents/p-5022f21c.js +1 -0
  270. package/dist/webcomponents/p-525db3e8.js +1 -22
  271. package/dist/webcomponents/p-55182a59.js +1 -0
  272. package/dist/webcomponents/p-5540a47c.entry.js +1 -0
  273. package/dist/webcomponents/p-56f6ce4c.js +1 -10
  274. package/dist/webcomponents/p-570a0f02.entry.js +1 -0
  275. package/dist/webcomponents/p-5968ff8a.js +1 -178
  276. package/dist/webcomponents/p-59cf5391.entry.js +1 -0
  277. package/dist/webcomponents/p-5a62fca2.js +1 -0
  278. package/dist/webcomponents/p-5e2c9ec8.js +1 -0
  279. package/dist/webcomponents/p-5e7c60d8.js +1 -0
  280. package/dist/webcomponents/p-6078a370.js +1 -244
  281. package/dist/webcomponents/p-6ac806ff.entry.js +1 -0
  282. package/dist/webcomponents/p-7bdffc78.entry.js +1 -0
  283. package/dist/webcomponents/p-7d3be485.js +1 -0
  284. package/dist/webcomponents/p-7d85af5c.js +1 -16
  285. package/dist/webcomponents/p-7ddfce86.entry.js +1 -0
  286. package/dist/webcomponents/p-7fe67d7f.entry.js +1 -0
  287. package/dist/webcomponents/p-7ff329b1.js +1 -0
  288. package/dist/webcomponents/p-804c0f1f.entry.js +1 -0
  289. package/dist/webcomponents/p-8115b2f4.js +1 -28
  290. package/dist/webcomponents/p-8281f09a.js +1 -0
  291. package/dist/webcomponents/p-8921a478.entry.js +1 -0
  292. package/dist/webcomponents/p-8a7112a0.entry.js +1 -0
  293. package/dist/webcomponents/p-8c83b73e.entry.js +1 -0
  294. package/dist/webcomponents/p-8d03a7bd.entry.js +1 -0
  295. package/dist/webcomponents/p-8df7bde8.js +1 -27
  296. package/dist/webcomponents/p-938bf2b4.entry.js +1 -0
  297. package/dist/webcomponents/p-9b154d98.entry.js +1 -0
  298. package/dist/webcomponents/p-9c9c7dac.js +1 -24
  299. package/dist/webcomponents/p-ad47f37c.entry.js +1 -0
  300. package/dist/webcomponents/p-aedb421f.entry.js +1 -0
  301. package/dist/webcomponents/p-b14da2fd.entry.js +1 -0
  302. package/dist/webcomponents/p-bbed6107.entry.js +1 -0
  303. package/dist/webcomponents/p-bdc91c61.entry.js +1 -0
  304. package/dist/webcomponents/p-c64ce69d.entry.js +1 -0
  305. package/dist/webcomponents/p-d76002d5.entry.js +1 -0
  306. package/dist/webcomponents/p-d8355f91.entry.js +1 -0
  307. package/dist/webcomponents/p-d89bad72.js +1 -39
  308. package/dist/webcomponents/p-da1d174d.entry.js +1 -0
  309. package/dist/webcomponents/p-dbc1d7b3.entry.js +1 -0
  310. package/dist/webcomponents/p-dce846bf.js +1 -27
  311. package/dist/webcomponents/p-df21aaad.js +1 -120
  312. package/dist/webcomponents/p-e1255160.js +1 -3
  313. package/dist/webcomponents/p-e2c88817.entry.js +1 -0
  314. package/dist/webcomponents/p-e31f0f3e.entry.js +1 -0
  315. package/dist/webcomponents/p-e333620e.js +1 -34
  316. package/dist/webcomponents/p-e3f4a2a6.js +1 -0
  317. package/dist/webcomponents/p-e3fab0e2.js +1 -43
  318. package/dist/webcomponents/p-eea79a55.entry.js +1 -0
  319. package/dist/webcomponents/p-f0866375.entry.js +1 -0
  320. package/dist/webcomponents/p-f6a2dc78.entry.js +1 -0
  321. package/dist/webcomponents/p-fad19d75.js +2 -1638
  322. package/dist/webcomponents/webcomponents.css +4 -362
  323. package/dist/webcomponents/webcomponents.esm.js +1 -20
  324. package/package.json +4 -2
  325. package/dist/cjs/styled-host-cc053016.js +0 -14
  326. package/dist/collection/components/business-forms/utils/payload-parsers.js +0 -41
  327. package/dist/esm/Analytics-a8eb7344.js +0 -77
  328. package/dist/esm/package-ccb774a9.js +0 -79
  329. package/dist/esm/styled-host-ab9da520.js +0 -12
  330. package/dist/esm/utils-3c1dd2fa.js +0 -4027
  331. package/dist/module/payload-parsers.js +0 -43
  332. package/dist/types/components/business-forms/utils/payload-parsers.d.ts +0 -4
  333. package/dist/webcomponents/p-01a404ca.entry.js +0 -44
  334. package/dist/webcomponents/p-03d35880.entry.js +0 -130
  335. package/dist/webcomponents/p-06ff0429.entry.js +0 -65
  336. package/dist/webcomponents/p-0e1bc91e.js +0 -28
  337. package/dist/webcomponents/p-10875f3d.entry.js +0 -97
  338. package/dist/webcomponents/p-157acba8.entry.js +0 -98
  339. package/dist/webcomponents/p-18fa0479.entry.js +0 -131
  340. package/dist/webcomponents/p-1a5120f4.entry.js +0 -145
  341. package/dist/webcomponents/p-24dc023a.entry.js +0 -791
  342. package/dist/webcomponents/p-25d8cd65.entry.js +0 -102
  343. package/dist/webcomponents/p-27d87fe2.entry.js +0 -133
  344. package/dist/webcomponents/p-29c0b182.js +0 -114
  345. package/dist/webcomponents/p-3395e896.entry.js +0 -74
  346. package/dist/webcomponents/p-3fd13ca3.js +0 -52
  347. package/dist/webcomponents/p-47d79529.js +0 -18
  348. package/dist/webcomponents/p-53ecc8b9.entry.js +0 -261
  349. package/dist/webcomponents/p-5482d030.entry.js +0 -21
  350. package/dist/webcomponents/p-576826b1.entry.js +0 -43
  351. package/dist/webcomponents/p-5f835b89.entry.js +0 -606
  352. package/dist/webcomponents/p-6124b1b3.entry.js +0 -80
  353. package/dist/webcomponents/p-70a2aa74.entry.js +0 -76
  354. package/dist/webcomponents/p-7582b554.entry.js +0 -18
  355. package/dist/webcomponents/p-75fd6367.entry.js +0 -149
  356. package/dist/webcomponents/p-79646550.entry.js +0 -61
  357. package/dist/webcomponents/p-800d31fe.entry.js +0 -162
  358. package/dist/webcomponents/p-85fc69e5.js +0 -90
  359. package/dist/webcomponents/p-89887332.js +0 -301
  360. package/dist/webcomponents/p-8eb774df.entry.js +0 -54
  361. package/dist/webcomponents/p-9e17630d.entry.js +0 -1684
  362. package/dist/webcomponents/p-9f94bbb6.entry.js +0 -118
  363. package/dist/webcomponents/p-a4e8573e.entry.js +0 -94
  364. package/dist/webcomponents/p-a5a225d9.entry.js +0 -125
  365. package/dist/webcomponents/p-a5fb51dc.entry.js +0 -131
  366. package/dist/webcomponents/p-ab4816e1.entry.js +0 -117
  367. package/dist/webcomponents/p-ac086069.entry.js +0 -58
  368. package/dist/webcomponents/p-af244664.js +0 -126
  369. package/dist/webcomponents/p-b4b8b531.js +0 -44
  370. package/dist/webcomponents/p-b82c146f.entry.js +0 -111
  371. package/dist/webcomponents/p-ba4bae6f.js +0 -12
  372. package/dist/webcomponents/p-ba5fae28.js +0 -90
  373. package/dist/webcomponents/p-bd66f9d2.entry.js +0 -101
  374. package/dist/webcomponents/p-cc39384f.entry.js +0 -99
  375. package/dist/webcomponents/p-d17aee2b.entry.js +0 -26
  376. package/dist/webcomponents/p-dad3e069.entry.js +0 -298
  377. package/dist/webcomponents/p-e1e7525b.entry.js +0 -73
  378. package/dist/webcomponents/p-e356f280.entry.js +0 -29
  379. package/dist/webcomponents/p-e9a5cb95.entry.js +0 -94
  380. package/dist/webcomponents/p-ec854a3e.entry.js +0 -11053
  381. package/dist/webcomponents/p-edc37d1f.entry.js +0 -75
  382. package/dist/webcomponents/p-f02b75dc.entry.js +0 -96
  383. package/dist/{globals.d.ts → types/global.d.ts} +1 -1
@@ -1,90 +0,0 @@
1
- import { a as BusinessClassification } from './p-af244664.js';
2
-
3
- const businessClassificationOptions = [
4
- {
5
- label: 'Choose business classification',
6
- value: '',
7
- },
8
- {
9
- label: 'Sole Proprietor',
10
- value: BusinessClassification.sole_proprietor,
11
- },
12
- {
13
- label: 'Partnership',
14
- value: BusinessClassification.partnership,
15
- },
16
- {
17
- label: 'Corporation',
18
- value: BusinessClassification.corporation,
19
- },
20
- {
21
- label: 'Public Company',
22
- value: BusinessClassification.public_company,
23
- },
24
- {
25
- label: 'Limited',
26
- value: BusinessClassification.limited,
27
- },
28
- {
29
- label: 'Non Profit',
30
- value: BusinessClassification.non_profit,
31
- },
32
- {
33
- label: 'Government',
34
- value: BusinessClassification.government,
35
- },
36
- ];
37
- const businessServiceReceivedOptions = [
38
- {
39
- label: 'Within 7 days',
40
- value: 'Within 7 days',
41
- },
42
- {
43
- label: 'Within 30 days',
44
- value: 'Within 30 days',
45
- },
46
- {
47
- label: 'Within 90 days',
48
- value: 'Within 90 days',
49
- },
50
- {
51
- label: 'Within 120 days',
52
- value: 'Within 120 days',
53
- },
54
- {
55
- label: 'More than 120 days',
56
- value: 'More than 120 days',
57
- }
58
- ];
59
- const recurringPaymentsOptions = [
60
- {
61
- label: 'Yes',
62
- value: 'Yes',
63
- },
64
- {
65
- label: 'No',
66
- value: 'No',
67
- }
68
- ];
69
- const seasonalBusinessOptions = [
70
- {
71
- label: 'Yes. The majority of the business revenue is generated in 3-6 months.',
72
- value: 'Yes',
73
- },
74
- {
75
- label: 'No. The business revenue is generated evenly throughout the year.',
76
- value: 'No',
77
- }
78
- ];
79
- const bankAccountTypeOptions = [
80
- {
81
- label: 'Checking',
82
- value: 'checking',
83
- },
84
- {
85
- label: 'Savings',
86
- value: 'savings',
87
- }
88
- ];
89
-
90
- export { businessServiceReceivedOptions as a, businessClassificationOptions as b, bankAccountTypeOptions as c, recurringPaymentsOptions as r, seasonalBusinessOptions as s };
@@ -1,101 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
- import { c as create$3, d as create$5, F as FormController } from './p-2eab3c90.js';
3
- import { A as Api } from './p-29c0b182.js';
4
- import './p-56f6ce4c.js';
5
- import './p-df21aaad.js';
6
- import './p-e3fab0e2.js';
7
- import { C as CURRENCY_MASK } from './p-525db3e8.js';
8
- import { S as StyledHost } from './p-ba4bae6f.js';
9
-
10
- const RefundFormSchema = create$3().shape({
11
- amount: create$5()
12
- .required('Amount is required')
13
- .typeError('Amount must be a number')
14
- .positive('Amount must be positive')
15
- .test('amount', 'Refund amount cannot be more than the original payment amount', function (value) {
16
- return value <= this.options.context.amount;
17
- })
18
- .nullable(),
19
- });
20
-
21
- const refundFormCss = ":host{display:block}*::part(input){font-family:var(--jfi-layout-font-family);background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}.btn{font-family:var(--jfi-layout-font-family);color:var(--jfi-submit-button-color);background-color:var(--jfi-submit-button-background-color);border-color:var(--jfi-submit-button-border-color);padding:var(--jfi-submit-button-padding);font-size:var(--jfi-submit-button-font-size);border-radius:var(--jfi-submit-button-border-radius);width:var(--jfi-submit-button-width);box-shadow:var(--jfi-submit-button-box-shadow)}.btn:hover{color:var(--jfi-submit-button-color-hover);background-color:var(--jfi-submit-button-background-color-hover);border-color:var(--jfi-submit-button-border-color-hover)}.btn:focus{color:var(--jfi-submit-button-color-focus);background-color:var(--jfi-submit-button-background-color-focus);border-color:var(--jfi-submit-button-border-color-focus)}.btn:active{color:var(--jfi-submit-button-color-active);background-color:var(--jfi-submit-button-background-color-active);border-color:var(--jfi-submit-button-border-color-active)}";
22
- const JustifiRefundFormStyle0 = refundFormCss;
23
-
24
- const RefundForm = class {
25
- constructor(hostRef) {
26
- registerInstance(this, hostRef);
27
- this.submitted = createEvent(this, "submitted", 7);
28
- this.authToken = undefined;
29
- this.paymentId = undefined;
30
- this.amount = 0;
31
- this.submitButtonText = 'Submit';
32
- this.withButton = undefined;
33
- this.refundInfoText = undefined;
34
- this.errors = {};
35
- this.isSubmitting = false;
36
- }
37
- componentWillLoad() {
38
- this.formController = new FormController(RefundFormSchema);
39
- this.formController.setInitialValues({
40
- amount: this.amount,
41
- message: '',
42
- });
43
- this.initializeApi();
44
- }
45
- componentDidLoad() {
46
- this.formController.errors.subscribe(errors => {
47
- this.errors = Object.assign({}, errors);
48
- });
49
- }
50
- /**
51
- * Handles the form submission.
52
- * Prevents the default form action, validates the form, and emits the 'submitted' event.
53
- */
54
- async handleSubmit(event) {
55
- event.preventDefault();
56
- this.formController.validateAndSubmit(this.submitRefund.bind(this), {
57
- amount: this.amount,
58
- });
59
- }
60
- /**
61
- * Submits the refund request to the API.
62
- */
63
- async submitRefund() {
64
- this.isSubmitting = true;
65
- const refundFields = this.formController.values.getValue();
66
- try {
67
- await this.api.post(`payments/${this.paymentId}/refunds`, refundFields);
68
- this.submitted.emit(refundFields);
69
- }
70
- catch (error) {
71
- console.error('Error submitting refund:', error);
72
- this.submitted.emit(error);
73
- }
74
- finally {
75
- this.isSubmitting = false;
76
- }
77
- }
78
- /**
79
- * Handles input changes, updating the refundFields state.
80
- */
81
- handleInput(field, value) {
82
- this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [field]: value }));
83
- }
84
- /**
85
- * Initializes the API with the given authentication token.
86
- * Logs a warning if the auth token is missing.
87
- */
88
- initializeApi() {
89
- if (!this.authToken) {
90
- console.warn('Warning: Missing auth-token.');
91
- }
92
- this.api = Api({ authToken: this.authToken, apiOrigin: "" });
93
- }
94
- render() {
95
- var _a;
96
- return (h(StyledHost, { key: '8d31f1a9bf936c9e11f8eca1dc55e614b9fa5939' }, h("h1", { key: 'be589740535ee8a5ab6d4af7151d7ae026f08002' }, "Refund"), this.refundInfoText && (h("div", { key: 'b1d40507dec53bac422f99a3d62678c78c0c2038', class: "d-flex align-items-center flex-row gap-4 border-top border-bottom my-4 p-3", role: "alert" }, h("img", { key: 'cc76014eef0d826bec5ec09355dc5fc747fd2070', src: "/info-icon.svg", alt: "Information", height: "30", width: "30" }), h("p", { key: 'c2efa0f2acdf3faaa6e2974d0535f48799e3cbbd', class: "m-0", innerHTML: this.refundInfoText }))), h("form", { key: '68220114781378f6507651414c87532171bebb31', onSubmit: e => this.handleSubmit(e), class: "d-grid gap-4" }, h("div", { key: '075545e9837316fe160760e0dba9a5104654dd2b', class: "form-group" }, h("form-control-monetary", { key: 'c8ff8a822d2b74b2f80b33cd6cd2b42ceebbff11', name: "amount", label: "Refund Amount", defaultValue: ((_a = this.amount) === null || _a === void 0 ? void 0 : _a.toString()) || '', maskOptions: CURRENCY_MASK.DECIMAL, inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.amount })), h("div", { key: '92093284e763466be5138ea6d788145d5d47bd87', class: "form-group" }, h("form-control-text", { key: 'ddf9e221d43d84ad7436261c5755e673224aa82e', name: "notes", label: "Additional Notes", inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.notes })), this.withButton && (h("div", { key: '58abbbabce09d82da4032ef0e08e6cfac1433153', class: "form-group d-flex flex-row-reverse" }, h("button", { key: '3e703ef633e0d45ba70425dc6d58bcd2d590ce1b', type: "submit", disabled: !!this.isSubmitting, class: "btn btn-primary ml-auto" }, this.submitButtonText))))));
97
- }
98
- };
99
- RefundForm.style = JustifiRefundFormStyle0;
100
-
101
- export { RefundForm as justifi_refund_form };
@@ -1,99 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
- import { m as makeGetPayoutCSV, P as PayoutService } from './p-b4b8b531.js';
3
- import './p-56f6ce4c.js';
4
- import './p-df21aaad.js';
5
- import { P as Payout } from './p-e3fab0e2.js';
6
- import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
7
- import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
8
- import { E as ErrorState } from './p-dce846bf.js';
9
- import { J as JustifiAnalytics } from './p-15eafa87.js';
10
- import './p-29c0b182.js';
11
- import './p-2e8f4937.js';
12
-
13
- const makeGetPayoutDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
14
- var _a;
15
- try {
16
- const response = await service.fetchPayout(id, authToken);
17
- if (!response.error) {
18
- const payout = new Payout(response.data);
19
- onSuccess(payout);
20
- }
21
- else {
22
- const errorMessage = getErrorMessage(response.error);
23
- const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
24
- onError({
25
- error: errorMessage,
26
- code,
27
- severity: ComponentErrorSeverity.ERROR,
28
- });
29
- }
30
- }
31
- catch (error) {
32
- const errorMessage = getErrorMessage(error);
33
- const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
34
- onError({
35
- error: errorMessage,
36
- code,
37
- severity: ComponentErrorSeverity.ERROR,
38
- });
39
- }
40
- };
41
-
42
- const PayoutDetails = class {
43
- constructor(hostRef) {
44
- registerInstance(this, hostRef);
45
- this.errorEvent = createEvent(this, "error-event", 7);
46
- this.handleErrorEvent = (event) => {
47
- this.errorMessage = event.detail.message;
48
- this.errorEvent.emit(event.detail);
49
- };
50
- this.payoutId = undefined;
51
- this.authToken = undefined;
52
- this.getPayout = undefined;
53
- this.getPayoutCSV = undefined;
54
- this.errorMessage = null;
55
- }
56
- componentWillLoad() {
57
- this.analytics = new JustifiAnalytics(this);
58
- this.initializeServices();
59
- }
60
- disconnectedCallback() {
61
- this.analytics.cleanup();
62
- }
63
- propChanged() {
64
- this.initializeServices();
65
- }
66
- initializeServices() {
67
- if (this.payoutId && this.authToken) {
68
- this.getPayout = makeGetPayoutDetails({
69
- id: this.payoutId,
70
- authToken: this.authToken,
71
- service: new PayoutService()
72
- });
73
- this.getPayoutCSV = makeGetPayoutCSV({
74
- authToken: this.authToken,
75
- service: new PayoutService()
76
- });
77
- }
78
- else {
79
- this.errorMessage = 'Failed to load payout details. payoutId or authToken is not provided.';
80
- this.errorEvent.emit({
81
- message: this.errorMessage,
82
- errorCode: ComponentErrorCodes.MISSING_PROPS,
83
- severity: ComponentErrorSeverity.ERROR
84
- });
85
- }
86
- }
87
- render() {
88
- if (this.errorMessage) {
89
- return ErrorState(this.errorMessage);
90
- }
91
- return (h("payout-details-core", { getPayout: this.getPayout, getPayoutCSV: this.getPayoutCSV, "onError-event": this.handleErrorEvent }));
92
- }
93
- static get watchers() { return {
94
- "payoutId": ["propChanged"],
95
- "authToken": ["propChanged"]
96
- }; }
97
- };
98
-
99
- export { PayoutDetails as justifi_payout_details };
@@ -1,26 +0,0 @@
1
- import { r as registerInstance, h } from './p-fad19d75.js';
2
- import { u as updateFormValues, a as updateAddressFormValues, b as updateDateOfBirthFormValues } from './p-7d85af5c.js';
3
- import { P as PHONE_MASKS, S as SSN_MASK } from './p-525db3e8.js';
4
- import './p-1ff8810b.js';
5
- import './p-6078a370.js';
6
-
7
- const RepresentativeFormInputs = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- this.inputHandler = (name, value) => {
11
- updateFormValues(this.formController, { [name]: value });
12
- };
13
- this.onAddressFormUpdate = (values) => {
14
- updateAddressFormValues(this.formController, Object.assign(Object.assign({}, this.formController.values.getValue().address), values));
15
- };
16
- this.representativeDefaultValue = undefined;
17
- this.errors = undefined;
18
- this.formController = undefined;
19
- }
20
- render() {
21
- var _a, _b, _c, _d, _e, _f, _g;
22
- return (h("form", { key: '8b46b3b30681c7e7f30395a2cac575a7bd7ac998' }, h("fieldset", { key: 'e6b8f2ebca22c295fd6897c0e8862200171c2b4d' }, h("legend", { key: '8f8f52240f5ccc3f5d43507681dc970b4260bb1b' }, "Representative"), h("hr", { key: '8b07c69a514534ab731e7c01b6ee4c7a0e59e06e' }), h("div", { key: '79f44ba9dcbcf9d010aed92e332f686ca7127285', class: 'row gy-3' }, h("div", { key: '2a1aeb5ddee1dafc40e108cfb2e9ed6f4d8bc183', class: 'col-12 col-md-8' }, h("form-control-text", { key: '6e089f2d4f734da266e94b38ec1435dc3f461d5f', name: 'name', label: 'Full Name', defaultValue: (_a = this.representativeDefaultValue) === null || _a === void 0 ? void 0 : _a.name, errorText: this.errors.name, inputHandler: this.inputHandler })), h("div", { key: 'c86421e524752e017180aef58e01229bf751e941', class: 'col-12 col-md-4' }, h("form-control-text", { key: 'ad8105f6d9a46397eb481666c19468376716544c', name: 'title', label: 'Title', defaultValue: (_b = this.representativeDefaultValue) === null || _b === void 0 ? void 0 : _b.title, errorText: this.errors.title, inputHandler: this.inputHandler })), h("div", { key: '7775905e46c00337a98ab668c8453e14d27bfc4d', class: 'col-12 col-md-6' }, h("form-control-text", { key: 'e810f2395101a1e48d8d3ff66617ac82d0ec90b3', name: 'email', label: 'Email Address', defaultValue: (_c = this.representativeDefaultValue) === null || _c === void 0 ? void 0 : _c.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: '66a91e85d1902e32668407e684774820c02dce67', class: 'col-12 col-md-6' }, h("form-control-number-masked", { key: 'aad97ca95c5b2ec728ea00916a46ff4b84661b96', 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: PHONE_MASKS.US })), h("div", { key: '3cd56ea0ac1e472e905c8113f6335868c39882f1', class: 'col-12 col-md-4' }, h("form-control-date", { key: '2f6d505220cacc08a80029ada089370f3841d9ed', 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) => updateDateOfBirthFormValues(e, this.formController) })), h("div", { key: 'cf2df0af006a50d3533b798607025b4d6ee82ca0', class: 'col-12 col-md-8' }, h("form-control-number-masked", { key: '033e4264a1466d300891b2328c0bfaced7acb04d', name: 'identification_number', label: 'SSN', defaultValue: (_f = this.representativeDefaultValue) === null || _f === void 0 ? void 0 : _f.identification_number, errorText: this.errors.identification_number, inputHandler: this.inputHandler, mask: SSN_MASK })), h("div", { key: '2dc7be12d65203da4d4e0bdd995256a7bdc5bf37', class: 'col-12' }, h("justifi-identity-address-form", { key: '47916ab24bf990be3541b72bfa2dc46cccca5a31', errors: this.errors.address, defaultValues: (_g = this.representativeDefaultValue) === null || _g === void 0 ? void 0 : _g.address, handleFormUpdate: this.onAddressFormUpdate }))))));
23
- }
24
- };
25
-
26
- export { RepresentativeFormInputs as justifi_business_representative_form_inputs };
@@ -1,298 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment } from './p-fad19d75.js';
2
- import { a as PaymentMethodTypes } from './p-df21aaad.js';
3
- import { g as snakeToCamel, f as formatCurrency } from './p-83125497.js';
4
-
5
- const PaymentMethodTypeLabels = {
6
- bankAccount: 'New bank account',
7
- card: 'New credit or debit card',
8
- };
9
- const NewPaymentMethod = class {
10
- constructor(hostRef) {
11
- registerInstance(this, hostRef);
12
- this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
13
- this.onPaymentMethodOptionClick = () => {
14
- this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
15
- };
16
- this.iframeOrigin = "";
17
- this.authToken = undefined;
18
- this.accountId = undefined;
19
- this.paymentMethodOption = undefined;
20
- this.paymentMethodGroupId = undefined;
21
- this.isSelected = undefined;
22
- this.saveNewPaymentMethodChecked = false;
23
- }
24
- componentWillLoad() {
25
- console.log('NewPaymentMethod: componentWillLoad iframeOrigin', this, this.iframeOrigin);
26
- }
27
- handleCheckboxChanged(event) {
28
- this.saveNewPaymentMethodChecked = event.detail;
29
- }
30
- async fillBillingForm(fields) {
31
- this.billingFormRef.fill(fields);
32
- }
33
- async resolvePaymentMethod(insuranceValidation) {
34
- var _a, _b;
35
- if (!this.paymentMethodFormRef || !this.billingFormRef)
36
- return;
37
- const isValid = await this.validate();
38
- if (!isValid || !insuranceValidation.isValid) {
39
- return { validationError: true };
40
- }
41
- const tokenizeResponse = await this.tokenize();
42
- if (tokenizeResponse.error) {
43
- return { error: tokenizeResponse.error };
44
- }
45
- else {
46
- const tokenizeRessponseData = tokenizeResponse.data;
47
- return { token: ((_a = tokenizeRessponseData.card) === null || _a === void 0 ? void 0 : _a.token) || ((_b = tokenizeRessponseData.bank_account) === null || _b === void 0 ? void 0 : _b.token) };
48
- }
49
- }
50
- async validate() {
51
- const billingFormValidation = await this.billingFormRef.validate();
52
- const paymentMethodFormValidation = await this.paymentMethodFormRef.validate();
53
- return billingFormValidation.isValid && paymentMethodFormValidation.isValid;
54
- }
55
- async tokenize() {
56
- try {
57
- const billingFormFieldValues = await this.billingFormRef.getValues();
58
- let paymentMethodData;
59
- if (this.saveNewPaymentMethodChecked) {
60
- paymentMethodData = Object.assign(Object.assign({}, billingFormFieldValues), { payment_method_group_id: this.paymentMethodGroupId });
61
- }
62
- else {
63
- paymentMethodData = Object.assign({}, billingFormFieldValues);
64
- }
65
- const clientId = this.authToken;
66
- const tokenizeResponse = await this.paymentMethodFormRef.tokenize(clientId, paymentMethodData, this.accountId);
67
- return tokenizeResponse;
68
- }
69
- catch (error) {
70
- return error;
71
- }
72
- }
73
- showNewPaymentMethodForm() {
74
- var _a;
75
- return (h("div", { class: "mt-2 pb-4 border-bottom" }, h("div", { class: "mb-3" }, h("justifi-payment-method-form", { ref: (el) => (this.paymentMethodFormRef = el), "payment-method-form-type": (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, "iframe-origin": this.iframeOrigin })), h("h3", { class: "fs-6 fw-bold lh-lg mb-4" }, "Billing address"), h("justifi-billing-form", { ref: (el) => (this.billingFormRef = el) }), h("justifi-save-new-payment-method", { hidden: !this.paymentMethodGroupId })));
76
- }
77
- render() {
78
- var _a, _b, _c, _d;
79
- return (h("div", { key: 'd597ba8b0ac2a650a14a79d002a91ef3edf604a4', class: "payment-method" }, h("div", { key: 'a287f7ffd480f17f0f1093d71b9d02fe3db39e0f', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: 'f53d08d048cc242414fcf6794614ad2334db81bb', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '01712a80a30df19a7b540434532cffb4cb3b61e8', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, PaymentMethodTypeLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.id])), this.isSelected ? this.showNewPaymentMethodForm() : null));
80
- }
81
- };
82
-
83
- class PaymentMethodOption {
84
- constructor(paymentMethod) {
85
- this.id = paymentMethod.id;
86
- this.brand = paymentMethod.brand;
87
- this.acct_last_four = paymentMethod.acct_last_four;
88
- this.type = snakeToCamel(paymentMethod.type);
89
- }
90
- }
91
- var CardBrandLabels;
92
- (function (CardBrandLabels) {
93
- CardBrandLabels["american_express"] = "American Express";
94
- CardBrandLabels["diners_club"] = "Diners Club";
95
- CardBrandLabels["discover"] = "Discover";
96
- CardBrandLabels["jcb"] = "JCB";
97
- CardBrandLabels["mastercard"] = "Mastercard";
98
- CardBrandLabels["china_unionpay"] = "UnionPay";
99
- CardBrandLabels["visa"] = "Visa";
100
- CardBrandLabels["unknown"] = "Unknown";
101
- })(CardBrandLabels || (CardBrandLabels = {}));
102
-
103
- const paymentMethodOptionsCss = ":host{display:block}.payment-method-header{cursor:pointer;color:var(--jfi-radio-button-group-color);background-color:var(--jfi-radio-button-group-background-color);border-bottom:var(--jfi-radio-button-group-divider)}.payment-method-header:hover{color:var(--jfi-radio-button-group-color-hover);background-color:var(--jfi-radio-button-group-background-color-hover)}";
104
- const JustifiPaymentMethodOptionsStyle0 = paymentMethodOptionsCss;
105
-
106
- const formCheckInputCss = ".form-check-input,label{cursor:pointer}.form-check-input{background-color:var(--jfi-radio-button-background-color);border-color:var(--jfi-radio-button-border-color)}.form-check-input:checked,.form-check-input:checked:focus{background-color:var(--jfi-radio-button-background-color-selected);border-color:var(--jfi-radio-button-border-color-selected)}.form-check-input:focus{border-color:var(--jfi-radio-button-border-color-focus);box-shadow:var(--jfi-radio-button-box-shadow-focus)}";
107
- const JustifiPaymentMethodOptionsStyle1 = formCheckInputCss;
108
-
109
- const PaymentMethodOptions = class {
110
- constructor(hostRef) {
111
- registerInstance(this, hostRef);
112
- this.toggleCreatingNewPaymentMethod = createEvent(this, "toggleCreatingNewPaymentMethod", 7);
113
- this.showCard = undefined;
114
- this.showAch = undefined;
115
- this.showBnpl = undefined;
116
- this.showSavedPaymentMethods = undefined;
117
- this.paymentMethodGroupId = undefined;
118
- this.bnpl = undefined;
119
- this.insuranceToggled = undefined;
120
- this.authToken = undefined;
121
- this.accountId = undefined;
122
- this.iframeOrigin = "";
123
- this.savedPaymentMethods = [];
124
- this.paymentAmount = undefined;
125
- this.selectedPaymentMethodId = undefined;
126
- this.paymentMethodOptions = [];
127
- }
128
- async fillBillingForm(fields) {
129
- const newPaymentMethodElement = this.selectedPaymentMethodOptionRef;
130
- if (newPaymentMethodElement.fillBillingForm) {
131
- newPaymentMethodElement.fillBillingForm(fields);
132
- }
133
- }
134
- connectedCallback() {
135
- this.paymentMethodsChanged();
136
- }
137
- paymentMethodsChanged() {
138
- var _a, _b;
139
- this.paymentMethodOptions = this.savedPaymentMethods
140
- .map((paymentMethod) => new PaymentMethodOption(paymentMethod))
141
- .filter((paymentMethod) => {
142
- // Don't saved card or bank account if they are disabled
143
- return ((this.showCard || paymentMethod.type !== PaymentMethodTypes.card) &&
144
- (this.showAch || paymentMethod.type !== PaymentMethodTypes.bankAccount));
145
- });
146
- if (this.showBnpl && ((_a = this.bnpl) === null || _a === void 0 ? void 0 : _a.provider) === 'sezzle' && !this.insuranceToggled) {
147
- this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.sezzle }));
148
- }
149
- if (this.showCard) {
150
- this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.card }));
151
- }
152
- if (this.showAch) {
153
- this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.bankAccount }));
154
- }
155
- if (!this.selectedPaymentMethodId) {
156
- this.selectedPaymentMethodId = (_b = this.paymentMethodOptions[0]) === null || _b === void 0 ? void 0 : _b.id;
157
- }
158
- }
159
- paymentMethodOptionSelected(event) {
160
- this.selectedPaymentMethodId = event.detail.id;
161
- }
162
- async resolvePaymentMethod(insuranceValidation) {
163
- var _a;
164
- return await ((_a = this.selectedPaymentMethodOptionRef) === null || _a === void 0 ? void 0 : _a.resolvePaymentMethod(insuranceValidation));
165
- }
166
- render() {
167
- var _a;
168
- return (h(Host, { key: '7ee40a1bdc9ec15596e870b48cbe7b6bbc20537c' }, (_a = this.paymentMethodOptions) === null || _a === void 0 ? void 0 : _a.map((paymentMethodOption) => {
169
- const newCard = paymentMethodOption.id === PaymentMethodTypes.card;
170
- const newBankAccount = paymentMethodOption.id === PaymentMethodTypes.bankAccount;
171
- const isSelected = this.selectedPaymentMethodId === paymentMethodOption.id;
172
- const sezzle = paymentMethodOption.id === PaymentMethodTypes.sezzle;
173
- if (newCard || newBankAccount) {
174
- return (h("justifi-new-payment-method", { paymentMethodOption: paymentMethodOption, authToken: this.authToken, "account-id": this.accountId, "is-selected": isSelected, paymentMethodGroupId: this.paymentMethodGroupId, ref: (el) => {
175
- if (isSelected) {
176
- this.selectedPaymentMethodOptionRef = el;
177
- }
178
- } }));
179
- }
180
- else if (sezzle) {
181
- return (h("justifi-sezzle-payment-method", { paymentMethodOption: paymentMethodOption, "is-selected": isSelected, paymentAmount: this.paymentAmount, bnpl: this.bnpl, ref: (el) => {
182
- if (isSelected) {
183
- this.selectedPaymentMethodOptionRef = el;
184
- }
185
- } }));
186
- }
187
- else if (this.showSavedPaymentMethods) {
188
- return (h("justifi-saved-payment-method", { paymentMethodOption: paymentMethodOption, "is-selected": isSelected, ref: (el) => {
189
- if (isSelected) {
190
- this.selectedPaymentMethodOptionRef = el;
191
- }
192
- } }));
193
- }
194
- })));
195
- }
196
- static get watchers() { return {
197
- "savedPaymentMethods": ["paymentMethodsChanged"]
198
- }; }
199
- };
200
- PaymentMethodOptions.style = JustifiPaymentMethodOptionsStyle0 + JustifiPaymentMethodOptionsStyle1;
201
-
202
- const SavedPaymentMethod = class {
203
- constructor(hostRef) {
204
- registerInstance(this, hostRef);
205
- this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
206
- this.onPaymentMethodOptionClick = () => {
207
- this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
208
- };
209
- this.iframeOrigin = "";
210
- this.paymentMethodOption = undefined;
211
- this.isSelected = undefined;
212
- }
213
- async resolvePaymentMethod(insuranceValidation) {
214
- var _a;
215
- if (!insuranceValidation.isValid) {
216
- return { validationError: true };
217
- }
218
- return { token: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id };
219
- }
220
- ;
221
- render() {
222
- var _a, _b, _c, _d, _e;
223
- return (h(Fragment, { key: '247dafc3fe4011c5f6a2202690310eedfa5422c8' }, h("div", { key: '9cfb0b6ca9c10e5cc6173832bb8211ddb1d0ae5b', class: "payment-method" }, h("div", { key: 'd247cc4cf9f7bf43d7153134c66a921b5bfc49bc', class: "payment-method-header p-3", onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '180c3aa6c4153bccf7cb620b6df49cc288754cd2', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '6ec14d77e8171a1ddb37c686189878a7ebb4b4f4', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, CardBrandLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.brand], " *", (_e = this.paymentMethodOption) === null || _e === void 0 ? void 0 :
224
- _e.acct_last_four)))));
225
- }
226
- };
227
-
228
- const sezzleLogo = (h("img", { class: "sezzle-smart-button-logo-img", src: "https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg", alt: "Sezzle", style: {
229
- display: 'inline',
230
- width: '80px',
231
- marginLeft: '5px',
232
- marginTop: '-5px',
233
- } }));
234
- const SezzlePaymentMethod = class {
235
- constructor(hostRef) {
236
- registerInstance(this, hostRef);
237
- this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
238
- this.onPaymentMethodOptionClick = () => {
239
- this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
240
- };
241
- this.initializeSezzleCheckout = () => {
242
- let resolveSezzlePromise;
243
- this.sezzlePromise = new Promise((resolve) => { resolveSezzlePromise = resolve; });
244
- const bnpl = this.bnpl;
245
- const amount = +this.paymentAmount; // convert to number
246
- const Checkout = window.Checkout;
247
- const checkout = new Checkout({
248
- mode: 'popup',
249
- publicKey: bnpl.provider_client_id,
250
- apiMode: bnpl.provider_mode,
251
- apiVersion: bnpl.provider_api_version,
252
- });
253
- checkout.sezzleButtonElement = this.sezzleButtonRef;
254
- checkout.init({
255
- onClick: function (event) {
256
- event.preventDefault();
257
- checkout.startCheckout({
258
- checkout_url: bnpl.provider_checkout_url
259
- });
260
- },
261
- onComplete: (event) => resolveSezzlePromise({ bnpl: event.data }),
262
- onCancel: (event) => resolveSezzlePromise({ bnpl: event.data }),
263
- onFailure: (event) => resolveSezzlePromise({ bnpl: event.data }),
264
- });
265
- this.sezzleCheckout = checkout;
266
- this.installmentPlan = this.sezzleCheckout.getInstallmentPlan(amount);
267
- };
268
- this.iframeOrigin = "";
269
- this.bnpl = undefined;
270
- this.clientId = undefined;
271
- this.accountId = undefined;
272
- this.paymentMethodOption = undefined;
273
- this.isSelected = undefined;
274
- this.paymentAmount = undefined;
275
- this.installmentPlan = undefined;
276
- this.sezzleCheckout = undefined;
277
- this.sezzlePromise = undefined;
278
- }
279
- componentDidRender() {
280
- this.scriptRef.onload = () => {
281
- this.sezzleButtonRef = document.createElement('button');
282
- this.initializeSezzleCheckout();
283
- };
284
- }
285
- async resolvePaymentMethod(insuranceValidation) {
286
- if (!insuranceValidation.isValid) {
287
- return { validationError: true };
288
- }
289
- this.sezzleButtonRef.click();
290
- return this.sezzlePromise;
291
- }
292
- render() {
293
- var _a, _b, _c, _d, _e;
294
- return (h("div", { key: '1b4e4a142e1e59465e0db5515ee6b0a0b2aac146', class: "payment-method" }, h("script", { key: 'c835bc94836949e2362974eaeefca1f6a579a1a0', src: "https://checkout-sdk.sezzle.com/checkout.min.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", { key: '051a0392e6353116423f706be48eb266daf12b84', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '6dd0d61f1b8788b45b008f5ac05f8a8b6a6591f2', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: 'caf3429bae616a016f58e141ac5c4493174cf3ef', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, h("div", { key: '0e4ea85fc6fc32a1c35fe0dac86f21ab7f86eb0a' }, "Buy now, pay later with ", sezzleLogo), this.installmentPlan && (h("small", { key: '3740565f14b87aa2e4af44b7e2b12d93d6e454c2' }, h("span", { key: 'ca9b6dff0042c41d378b101067d060092234fa7c' }, (_d = this.installmentPlan) === null || _d === void 0 ? void 0 : _d.installments.length), "\u00A0", h("span", { key: '14ab21fd2d9bd612f41d5cd3e175402593012619' }, this.installmentPlan.schedule, " payments of"), "\u00A0", h("span", { key: '25e08c1e711af0979e14bbb911aedb58f59bc180', class: "fw-bold" }, formatCurrency((_e = this.installmentPlan) === null || _e === void 0 ? void 0 : _e.installments[0].amountInCents))))))));
295
- }
296
- };
297
-
298
- export { NewPaymentMethod as justifi_new_payment_method, PaymentMethodOptions as justifi_payment_method_options, SavedPaymentMethod as justifi_saved_payment_method, SezzlePaymentMethod as justifi_sezzle_payment_method };