@justifi/webcomponents 4.12.2 → 4.13.0-rc.1

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 (244) hide show
  1. package/dist/cjs/{Api-a06b996e.js → Api-ab34a402.js} +4 -1
  2. package/dist/cjs/{Business-21cef37d.js → Business-32a53780.js} +8 -3
  3. package/dist/cjs/{utils-f8079741.js → ComponentError-8ba0c0e7.js} +0 -25
  4. package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -2
  5. package/dist/cjs/{business-additional-questions-schema-f5f303fb.js → business-additional-questions-schema-0a35f597.js} +17 -9
  6. package/dist/cjs/{business-form-types-a3cc374d.js → business-form-options-43366c9a.js} +50 -33
  7. package/dist/cjs/business-form-types-29b2bad9.js +26 -0
  8. package/dist/cjs/form-control-date_3.cjs.entry.js +1 -1
  9. package/dist/cjs/form-control-datepart_2.cjs.entry.js +1 -1
  10. package/dist/cjs/form-control-file.cjs.entry.js +44 -0
  11. package/dist/cjs/form-control-monetary.cjs.entry.js +7 -12
  12. package/dist/cjs/form-input-masks-0879c139.js +27 -0
  13. package/dist/cjs/{index-fc5339a5.js → index-d8e99b54.js} +352 -198
  14. package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +10 -9
  15. package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +6 -6
  16. package/dist/cjs/justifi-billing-form_4.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-business-details.cjs.entry.js +8 -7
  18. package/dist/cjs/justifi-business-form.cjs.entry.js +6 -5
  19. package/dist/cjs/justifi-business-list.cjs.entry.js +2 -2
  20. package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
  21. package/dist/cjs/justifi-checkout-core.cjs.entry.js +30 -11
  22. package/dist/cjs/justifi-checkout.cjs.entry.js +36 -9
  23. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +7 -6
  24. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +12 -12
  25. package/dist/cjs/justifi-owner-form.cjs.entry.js +6 -5
  26. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +1 -1
  27. package/dist/cjs/justifi-payment-details.cjs.entry.js +8 -7
  28. package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
  29. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +1 -3
  30. package/dist/cjs/justifi-payments-list.cjs.entry.js +8 -7
  31. package/dist/cjs/justifi-payout-details.cjs.entry.js +8 -7
  32. package/dist/cjs/justifi-payouts-list.cjs.entry.js +7 -6
  33. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +1 -1
  34. package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
  35. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +1 -1
  36. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +1 -1
  37. package/dist/cjs/loader.cjs.js +1 -1
  38. package/dist/cjs/{payload-parsers-74693a97.js → payload-parsers-6c4b5323.js} +61 -6
  39. package/dist/cjs/{payment.service-9db24ab9.js → payment.service-336189d3.js} +1 -1
  40. package/dist/cjs/{payout.service-a0efb71a.js → payout.service-6012d576.js} +1 -1
  41. package/dist/cjs/utils-491248ca.js +28 -0
  42. package/dist/cjs/webcomponents.cjs.js +1 -1
  43. package/dist/collection/api/Api.js +4 -1
  44. package/dist/collection/api/Business.js +8 -3
  45. package/dist/collection/collection-manifest.json +1 -0
  46. package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +2 -2
  47. package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +4 -2
  48. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
  49. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +4 -2
  50. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +3 -2
  51. package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +16 -9
  52. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +3 -1
  53. package/dist/collection/components/business-forms/schemas/schema-helpers.js +3 -0
  54. package/dist/collection/components/business-forms/schemas/schema-validations.js +51 -7
  55. package/dist/collection/components/business-forms/utils/business-form-options.js +119 -0
  56. package/dist/collection/components/business-forms/utils/business-form-types.js +0 -81
  57. package/dist/collection/components/checkout/checkout-actions.js +29 -7
  58. package/dist/collection/components/checkout/checkout-core.js +51 -14
  59. package/dist/collection/components/checkout/checkout.js +30 -2
  60. package/dist/collection/components/checkout/new-payment-method.js +11 -11
  61. package/dist/collection/components/checkout/payment-method-options.js +2 -18
  62. package/dist/collection/components/checkout/test/checkout-actions.spec.js +124 -0
  63. package/dist/collection/components/checkout/test/checkout-core.spec.js +127 -0
  64. package/dist/collection/components/checkout/test/checkout.spec.js +0 -153
  65. package/dist/collection/components/form/form-control-file.css +1806 -0
  66. package/dist/collection/components/form/form-control-file.js +169 -0
  67. package/dist/collection/components/form/form-control-monetary.css +1812 -0
  68. package/dist/collection/components/form/form-control-monetary.js +24 -11
  69. package/dist/collection/components/form/test/form-control-file.spec.js +84 -0
  70. package/dist/collection/components/form/test/form-control-monetary.spec.js +5 -3
  71. package/dist/collection/components/refund-form/refund-form.js +2 -1
  72. package/dist/collection/utils/form-input-masks.js +15 -0
  73. package/dist/docs.json +275 -33
  74. package/dist/esm/{Api-0e88671c.js → Api-e9d568c7.js} +4 -1
  75. package/dist/esm/{Business-0e8a9a3a.js → Business-d83fbdb4.js} +8 -3
  76. package/dist/esm/{utils-4609f32c.js → ComponentError-2a58dbbc.js} +1 -23
  77. package/dist/esm/additional-questions-details_5.entry.js +2 -2
  78. package/dist/esm/{business-additional-questions-schema-a84dd641.js → business-additional-questions-schema-e96b0509.js} +18 -10
  79. package/dist/esm/{business-form-types-7420dc96.js → business-form-options-de11bc46.js} +46 -32
  80. package/dist/esm/business-form-types-0d76133c.js +26 -0
  81. package/dist/esm/form-control-date_3.entry.js +1 -1
  82. package/dist/esm/form-control-datepart_2.entry.js +1 -1
  83. package/dist/esm/form-control-file.entry.js +40 -0
  84. package/dist/esm/form-control-monetary.entry.js +7 -12
  85. package/dist/esm/form-input-masks-0e18300f.js +22 -0
  86. package/dist/esm/{index-5eb05747.js → index-dc1350b1.js} +352 -198
  87. package/dist/esm/justifi-additional-questions-form-step_5.entry.js +10 -9
  88. package/dist/esm/justifi-additional-questions_4.entry.js +6 -6
  89. package/dist/esm/justifi-billing-form_4.entry.js +2 -2
  90. package/dist/esm/justifi-business-details.entry.js +4 -3
  91. package/dist/esm/justifi-business-form.entry.js +6 -5
  92. package/dist/esm/justifi-business-list.entry.js +2 -2
  93. package/dist/esm/justifi-business-owners.entry.js +1 -1
  94. package/dist/esm/justifi-checkout-core.entry.js +30 -11
  95. package/dist/esm/justifi-checkout.entry.js +37 -10
  96. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -2
  97. package/dist/esm/justifi-new-payment-method_4.entry.js +12 -12
  98. package/dist/esm/justifi-owner-form.entry.js +6 -5
  99. package/dist/esm/justifi-payment-balance-transactions.entry.js +1 -1
  100. package/dist/esm/justifi-payment-details.entry.js +4 -3
  101. package/dist/esm/justifi-payment-form.entry.js +2 -1
  102. package/dist/esm/justifi-payment-provisioning.entry.js +1 -3
  103. package/dist/esm/justifi-payments-list.entry.js +4 -3
  104. package/dist/esm/justifi-payout-details.entry.js +4 -3
  105. package/dist/esm/justifi-payouts-list.entry.js +4 -3
  106. package/dist/esm/justifi-proceeds-list.entry.js +1 -1
  107. package/dist/esm/justifi-refund-form.entry.js +3 -2
  108. package/dist/esm/justifi-subaccount-details.entry.js +1 -1
  109. package/dist/esm/justifi-subaccounts-list.entry.js +1 -1
  110. package/dist/esm/loader.js +1 -1
  111. package/dist/esm/{payload-parsers-0c4fc2b1.js → payload-parsers-32028700.js} +54 -7
  112. package/dist/esm/{payment.service-ec28a959.js → payment.service-2fdc5018.js} +1 -1
  113. package/dist/esm/{payout.service-5fd5986c.js → payout.service-15064bcc.js} +1 -1
  114. package/dist/esm/utils-f580d6b7.js +25 -0
  115. package/dist/esm/webcomponents.js +1 -1
  116. package/dist/module/Api.js +4 -1
  117. package/dist/module/Business.js +8 -3
  118. package/dist/module/ComponentError.js +16 -0
  119. package/dist/module/additional-questions-details2.js +2 -2
  120. package/dist/module/additional-questions.js +18 -4
  121. package/dist/module/business-additional-questions-form-step.js +18 -4
  122. package/dist/module/business-additional-questions-schema.js +16 -9
  123. package/dist/module/business-address-schema.js +1 -1
  124. package/dist/module/business-core-info-form-step.js +10 -3
  125. package/dist/module/business-core-info-schema.js +3 -1
  126. package/dist/module/business-core-info.js +9 -3
  127. package/dist/module/business-form-options.js +122 -0
  128. package/dist/module/business-form-types.js +153 -82
  129. package/dist/module/business-identity-schema.js +1 -1
  130. package/dist/module/business-representative-form-step.js +1 -1
  131. package/dist/module/checkout-core.js +30 -13
  132. package/dist/module/form-control-file.d.ts +11 -0
  133. package/dist/module/form-control-file.js +67 -0
  134. package/dist/module/form-control-monetary2.js +8 -12
  135. package/dist/module/form-input-masks.js +16 -1
  136. package/dist/module/index2.js +352 -198
  137. package/dist/module/justifi-business-details.js +2 -1
  138. package/dist/module/justifi-business-form.js +2 -2
  139. package/dist/module/justifi-checkout.js +37 -11
  140. package/dist/module/justifi-gross-payment-chart.js +2 -1
  141. package/dist/module/justifi-payment-details.js +2 -1
  142. package/dist/module/justifi-payment-form.js +2 -1
  143. package/dist/module/justifi-payment-provisioning.js +1 -1
  144. package/dist/module/justifi-payments-list.js +2 -1
  145. package/dist/module/justifi-payout-details.js +2 -1
  146. package/dist/module/justifi-payouts-list.js +2 -1
  147. package/dist/module/justifi-refund-form.js +2 -1
  148. package/dist/module/legal-address-form-step.js +1 -1
  149. package/dist/module/new-payment-method.js +11 -11
  150. package/dist/module/owner-form.js +2 -2
  151. package/dist/module/payload-parsers.js +1 -107
  152. package/dist/module/payment-method-form.js +2 -2
  153. package/dist/module/payment-method-options.js +2 -2
  154. package/dist/module/utils3.js +2 -15
  155. package/dist/types/api/Api.d.ts +1 -0
  156. package/dist/types/api/Business.d.ts +15 -5
  157. package/dist/types/api/services/checkout.service.d.ts +3 -3
  158. package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +10 -4
  159. package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +2 -0
  160. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +12 -4
  161. package/dist/types/components/business-forms/schemas/schema-helpers.d.ts +3 -0
  162. package/dist/types/components/business-forms/schemas/schema-validations.d.ts +8 -0
  163. package/dist/types/components/business-forms/utils/business-form-options.d.ts +21 -0
  164. package/dist/types/components/business-forms/utils/business-form-types.d.ts +0 -9
  165. package/dist/types/components/checkout/checkout-core.d.ts +8 -3
  166. package/dist/types/components/checkout/checkout.d.ts +3 -0
  167. package/dist/types/components/checkout/payment-method-options.d.ts +1 -1
  168. package/dist/types/components/checkout/payment-method-payload.d.ts +5 -0
  169. package/dist/types/components/form/form-control-file.d.ts +17 -0
  170. package/dist/types/components/form/form-control-monetary.d.ts +1 -0
  171. package/dist/types/components/payment-method-form/payment-method-responses.d.ts +1 -0
  172. package/dist/types/components.d.ts +61 -2
  173. package/dist/types/utils/form-input-masks.d.ts +15 -0
  174. package/dist/webcomponents/p-00ca94d1.js +1 -0
  175. package/dist/webcomponents/p-02b18979.entry.js +1 -0
  176. package/dist/webcomponents/p-0d80748f.js +1 -0
  177. package/dist/webcomponents/p-101b2648.entry.js +1 -0
  178. package/dist/webcomponents/p-132ba228.js +1 -0
  179. package/dist/webcomponents/p-13e2f667.js +1 -0
  180. package/dist/webcomponents/{p-18cf5a16.entry.js → p-1885c478.entry.js} +1 -1
  181. package/dist/webcomponents/{p-8abba4c2.entry.js → p-23099f1f.entry.js} +1 -1
  182. package/dist/webcomponents/p-230b96df.entry.js +1 -0
  183. package/dist/webcomponents/{p-2fbe8823.entry.js → p-3367225e.entry.js} +1 -1
  184. package/dist/webcomponents/p-3917edbf.entry.js +1 -0
  185. package/dist/webcomponents/p-3da23f21.js +1 -0
  186. package/dist/webcomponents/p-41bdee27.entry.js +1 -0
  187. package/dist/webcomponents/{p-5ff7826e.entry.js → p-4c84952f.entry.js} +1 -1
  188. package/dist/webcomponents/p-4ff52695.entry.js +1 -0
  189. package/dist/webcomponents/p-525db3e8.js +1 -0
  190. package/dist/webcomponents/p-61fd33c7.js +1 -0
  191. package/dist/webcomponents/p-64710363.entry.js +1 -0
  192. package/dist/webcomponents/{p-9245777b.js → p-731085e3.js} +1 -1
  193. package/dist/webcomponents/p-78b32fb9.entry.js +1 -0
  194. package/dist/webcomponents/p-7e334dce.entry.js +1 -0
  195. package/dist/webcomponents/p-7faacb1e.entry.js +1 -0
  196. package/dist/webcomponents/{p-5f5e730c.entry.js → p-834cba99.entry.js} +1 -1
  197. package/dist/webcomponents/p-87d646c0.js +1 -0
  198. package/dist/webcomponents/p-935d6f55.js +1 -0
  199. package/dist/webcomponents/{p-e3946c2b.js → p-9ada56da.js} +1 -1
  200. package/dist/webcomponents/p-9ba31a6a.entry.js +1 -0
  201. package/dist/webcomponents/p-a9af8f40.entry.js +1 -0
  202. package/dist/webcomponents/p-b81afd51.entry.js +1 -0
  203. package/dist/webcomponents/{p-c556deda.entry.js → p-bb58e656.entry.js} +1 -1
  204. package/dist/webcomponents/p-bc12b8b9.js +1 -0
  205. package/dist/webcomponents/p-bfe7c55c.entry.js +1 -0
  206. package/dist/webcomponents/p-c1be3378.entry.js +1 -0
  207. package/dist/webcomponents/p-cb31488b.entry.js +1 -0
  208. package/dist/webcomponents/p-cf3151a3.entry.js +1 -0
  209. package/dist/webcomponents/p-d0a8c631.entry.js +1 -0
  210. package/dist/webcomponents/p-e6ab1f0d.entry.js +1 -0
  211. package/dist/webcomponents/p-ee68566f.entry.js +1 -0
  212. package/dist/webcomponents/{p-3adc0688.entry.js → p-efbc8ffc.entry.js} +1 -1
  213. package/dist/webcomponents/{p-b9f04fb0.entry.js → p-f152d6b8.entry.js} +1 -1
  214. package/dist/webcomponents/webcomponents.esm.js +1 -1
  215. package/package.json +2 -2
  216. package/dist/cjs/form-input-masks-efd44b8e.js +0 -11
  217. package/dist/esm/form-input-masks-84875967.js +0 -7
  218. package/dist/webcomponents/p-01913426.js +0 -1
  219. package/dist/webcomponents/p-04c7f8f8.js +0 -1
  220. package/dist/webcomponents/p-0c269feb.entry.js +0 -1
  221. package/dist/webcomponents/p-0eb77101.entry.js +0 -1
  222. package/dist/webcomponents/p-19001cc5.entry.js +0 -1
  223. package/dist/webcomponents/p-2319abaf.entry.js +0 -1
  224. package/dist/webcomponents/p-2bee72bd.entry.js +0 -1
  225. package/dist/webcomponents/p-51ee396f.entry.js +0 -1
  226. package/dist/webcomponents/p-52e4cc27.js +0 -1
  227. package/dist/webcomponents/p-602a1588.entry.js +0 -1
  228. package/dist/webcomponents/p-6ec77980.entry.js +0 -1
  229. package/dist/webcomponents/p-6f294d5d.js +0 -1
  230. package/dist/webcomponents/p-81c43ba5.entry.js +0 -1
  231. package/dist/webcomponents/p-927150b4.entry.js +0 -1
  232. package/dist/webcomponents/p-93579716.js +0 -1
  233. package/dist/webcomponents/p-9e35b0f6.entry.js +0 -1
  234. package/dist/webcomponents/p-9e3f9e05.entry.js +0 -1
  235. package/dist/webcomponents/p-9ec89299.entry.js +0 -1
  236. package/dist/webcomponents/p-a8caec98.entry.js +0 -1
  237. package/dist/webcomponents/p-a90f7ca0.js +0 -1
  238. package/dist/webcomponents/p-abc03d5a.entry.js +0 -1
  239. package/dist/webcomponents/p-b38baa84.entry.js +0 -1
  240. package/dist/webcomponents/p-bfc634c6.entry.js +0 -1
  241. package/dist/webcomponents/p-c1b92cec.entry.js +0 -1
  242. package/dist/webcomponents/p-cb86b2fd.js +0 -1
  243. package/dist/webcomponents/p-d2b7beac.js +0 -1
  244. package/dist/webcomponents/p-d69a485a.entry.js +0 -1
@@ -1,7 +1,8 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { a as BusinessTypeOptions, b as BusinessStructureOptions } from './business-form-types.js';
2
+ import { a as businessTypeOptions, c as businessStructureOptions } from './business-form-options.js';
3
3
  import { T as TAX_ID_MASKS, P as PHONE_MASKS } from './form-input-masks.js';
4
4
  import { C as CoreBusinessInfo } from './Business.js';
5
+ import { d as defineCustomElement$4 } from './form-control-date2.js';
5
6
  import { d as defineCustomElement$3 } from './form-control-number-masked2.js';
6
7
  import { d as defineCustomElement$2 } from './form-control-select2.js';
7
8
  import { d as defineCustomElement$1 } from './form-control-text2.js';
@@ -28,7 +29,7 @@ const BusinessCoreInfo = /*@__PURE__*/ proxyCustomElement(class BusinessCoreInfo
28
29
  }
29
30
  render() {
30
31
  const coreInfoDefaultValue = this.formController.getInitialValues();
31
- return (h(Host, { exportparts: "label,input,input-invalid" }, h("fieldset", null, h("legend", null, "General Info"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("form-control-text", { name: "legal_name", label: "Legal Name", defaultValue: coreInfoDefaultValue.legal_name, error: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, error: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_type", label: "Business Type", options: BusinessTypeOptions, defaultValue: coreInfoDefaultValue.business_type, error: this.errors.business_type, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_structure", label: "Business Structure", options: BusinessStructureOptions, defaultValue: coreInfoDefaultValue.business_structure, error: this.errors.business_structure, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, error: this.errors.industry, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "tax_id", label: "Tax ID", defaultValue: coreInfoDefaultValue.tax_id, error: this.errors.tax_id, inputHandler: this.inputHandler, mask: TAX_ID_MASKS.US })), h("div", { class: "col-12" }, h("form-control-text", { name: "website_url", label: "Website URL", defaultValue: coreInfoDefaultValue.website_url, error: this.errors.website_url, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "email", label: "Email Address", defaultValue: coreInfoDefaultValue.email, error: this.errors.email, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "phone", label: "Phone Number", defaultValue: coreInfoDefaultValue.phone, error: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US }))))));
32
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("fieldset", null, h("legend", null, "General Info"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("form-control-text", { name: "legal_name", label: "Legal Name", defaultValue: coreInfoDefaultValue.legal_name, error: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, error: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-date", { name: "date_of_incorporation", label: "Date of Incorporation", defaultValue: coreInfoDefaultValue.date_of_incorporation, error: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_type", label: "Business Type", options: businessTypeOptions, defaultValue: coreInfoDefaultValue.business_type, error: this.errors.business_type, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_structure", label: "Business Structure", options: businessStructureOptions, defaultValue: coreInfoDefaultValue.business_structure, error: this.errors.business_structure, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, error: this.errors.industry, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "tax_id", label: "Tax ID", defaultValue: coreInfoDefaultValue.tax_id, error: this.errors.tax_id, inputHandler: this.inputHandler, mask: TAX_ID_MASKS.US })), h("div", { class: "col-12" }, h("form-control-text", { name: "website_url", label: "Website URL", defaultValue: coreInfoDefaultValue.website_url, error: this.errors.website_url, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "email", label: "Email Address", defaultValue: coreInfoDefaultValue.email, error: this.errors.email, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "phone", label: "Phone Number", defaultValue: coreInfoDefaultValue.phone, error: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US }))))));
32
33
  }
33
34
  static get style() { return businessCoreInfoCss; }
34
35
  }, [0, "justifi-business-core-info", {
@@ -40,13 +41,18 @@ function defineCustomElement() {
40
41
  if (typeof customElements === "undefined") {
41
42
  return;
42
43
  }
43
- const components = ["justifi-business-core-info", "form-control-number-masked", "form-control-select", "form-control-text"];
44
+ const components = ["justifi-business-core-info", "form-control-date", "form-control-number-masked", "form-control-select", "form-control-text"];
44
45
  components.forEach(tagName => { switch (tagName) {
45
46
  case "justifi-business-core-info":
46
47
  if (!customElements.get(tagName)) {
47
48
  customElements.define(tagName, BusinessCoreInfo);
48
49
  }
49
50
  break;
51
+ case "form-control-date":
52
+ if (!customElements.get(tagName)) {
53
+ defineCustomElement$4();
54
+ }
55
+ break;
50
56
  case "form-control-number-masked":
51
57
  if (!customElements.get(tagName)) {
52
58
  defineCustomElement$3();
@@ -0,0 +1,122 @@
1
+ import { B as BusinessType, a as BusinessStructure } from './Business.js';
2
+
3
+ const businessTypeOptions = [
4
+ {
5
+ label: 'Individual',
6
+ value: BusinessType.individual,
7
+ },
8
+ {
9
+ label: 'For Profit',
10
+ value: BusinessType.for_profit,
11
+ },
12
+ {
13
+ label: 'Non Profit',
14
+ value: BusinessType.non_profit,
15
+ },
16
+ {
17
+ label: 'Government Entity',
18
+ value: BusinessType.government_entity,
19
+ },
20
+ ];
21
+ const businessStructureOptions = [
22
+ {
23
+ label: 'Choose business structure',
24
+ value: '',
25
+ },
26
+ {
27
+ label: 'Sole Proprietorship',
28
+ value: BusinessStructure.sole_proprietorship,
29
+ },
30
+ {
31
+ label: 'LLC (Single)',
32
+ value: BusinessStructure.single_llc,
33
+ },
34
+ {
35
+ label: 'LLC (Multiple)',
36
+ value: BusinessStructure.multi_llc,
37
+ },
38
+ {
39
+ label: 'Private Partnership',
40
+ value: BusinessStructure.private_partnership,
41
+ },
42
+ {
43
+ label: 'Private Corporation',
44
+ value: BusinessStructure.private_corporation,
45
+ },
46
+ {
47
+ label: 'Unincorporated Association',
48
+ value: BusinessStructure.unincorporated_association,
49
+ },
50
+ {
51
+ label: 'Public Partnership',
52
+ value: BusinessStructure.public_partnership,
53
+ },
54
+ {
55
+ label: 'Public Corporation',
56
+ value: BusinessStructure.public_corporation,
57
+ },
58
+ {
59
+ label: 'Incorporated',
60
+ value: BusinessStructure.incorporated,
61
+ },
62
+ {
63
+ label: 'Unincorporated',
64
+ value: BusinessStructure.unincorporated,
65
+ },
66
+ {
67
+ label: 'Government Unit',
68
+ value: BusinessStructure.government_unit,
69
+ },
70
+ {
71
+ label: 'Government Instrumentality',
72
+ value: BusinessStructure.government_instrumentality,
73
+ },
74
+ {
75
+ label: 'Tax Exempt Government Instrumentality',
76
+ value: BusinessStructure.tax_exempt_government_instrumentality,
77
+ },
78
+ ];
79
+ const businessServiceReceivedOptions = [
80
+ {
81
+ label: 'Within 7 days',
82
+ value: 'Within 7 days',
83
+ },
84
+ {
85
+ label: 'Within 30 days',
86
+ value: 'Within 30 days',
87
+ },
88
+ {
89
+ label: 'Within 90 days',
90
+ value: 'Within 90 days',
91
+ },
92
+ {
93
+ label: 'Within 120 days',
94
+ value: 'Within 120 days',
95
+ },
96
+ {
97
+ label: 'More than 120 days',
98
+ value: 'More than 120 days',
99
+ }
100
+ ];
101
+ const recurringPaymentsOptions = [
102
+ {
103
+ label: 'Yes',
104
+ value: 'Yes',
105
+ },
106
+ {
107
+ label: 'No',
108
+ value: 'No',
109
+ }
110
+ ];
111
+ const seasonalBusinessOptions = [
112
+ {
113
+ label: 'Yes. The majority of the business revenue is generated in 3-6 months.',
114
+ value: 'Yes',
115
+ },
116
+ {
117
+ label: 'No. The business revenue is generated evenly throughout the year.',
118
+ value: 'No',
119
+ }
120
+ ];
121
+
122
+ export { businessTypeOptions as a, businessServiceReceivedOptions as b, businessStructureOptions as c, recurringPaymentsOptions as r, seasonalBusinessOptions as s };
@@ -1,4 +1,155 @@
1
- import { B as BusinessType, a as BusinessStructure } from './Business.js';
1
+ import { a as create$6 } from './index.esm.js';
2
+ import { S as StateOptions } from './state-options.js';
3
+ import { a as businessTypeOptions, c as businessStructureOptions, b as businessServiceReceivedOptions, r as recurringPaymentsOptions, s as seasonalBusinessOptions } from './business-form-options.js';
4
+
5
+ const transformEmptyString = (value) => {
6
+ return value === '' ? null : value;
7
+ };
8
+ const businessNameRegex = /^(?!^\s+$)[a-zA-Z0-9\s,&.-]*$/;
9
+ const phoneRegex = /^\d{10}$/;
10
+ const urlRegex = /^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
11
+ const taxIdRegex = /^\d{9}$/;
12
+ const stringLettersOnlyRegex = /^(?!^\s+$)[a-zA-Z\s]*$/;
13
+ const numbersOnlyRegex = /^\d+$/;
14
+ const ssnRegex = /^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/;
15
+ const streetAddressRegex = /^(?!^\s+$)[a-zA-Z0-9\s,&.-]*$/;
16
+ const poBoxRegex = /P\.?\s?O\.?\s?Box|Postal\sBox/i;
17
+
18
+ // Common Validations
19
+ const emailValidation = create$6()
20
+ .email('Enter valid email')
21
+ .transform(transformEmptyString);
22
+ const phoneValidation = create$6()
23
+ .matches(phoneRegex, 'Enter valid phone number')
24
+ .transform(transformEmptyString);
25
+ // Core Info Validations
26
+ const businessNameValidation = create$6()
27
+ .min(2, 'Name must be at least 2 characters')
28
+ .max(100, 'Name must be less than 100 characters')
29
+ .matches(businessNameRegex, 'Enter valid business name')
30
+ .transform(transformEmptyString);
31
+ const doingBusinessAsValidation = create$6()
32
+ .min(2, 'Name must be at least 2 characters')
33
+ .max(100, 'Name must be less than 100 characters')
34
+ .matches(businessNameRegex, 'Enter valid doing business as')
35
+ .transform(transformEmptyString);
36
+ const websiteUrlValidation = create$6()
37
+ .matches(urlRegex, 'Enter valid website url')
38
+ .transform(transformEmptyString);
39
+ const businessTypeValidation = create$6()
40
+ .oneOf(businessTypeOptions.map((option) => option.value), 'Select business type')
41
+ .transform(transformEmptyString);
42
+ const businessStructureValidation = create$6()
43
+ .oneOf(businessStructureOptions.map((option) => option.value), 'Select business structure')
44
+ .transform(transformEmptyString);
45
+ const industryValidation = create$6()
46
+ .min(2, 'Industry must be at least 2 characters')
47
+ .max(50, 'Industry must be less than 50 characters')
48
+ .matches(stringLettersOnlyRegex, 'Enter valid industry')
49
+ .transform(transformEmptyString);
50
+ const taxIdValidation = create$6()
51
+ .matches(taxIdRegex, 'Enter valid tax id')
52
+ .test('not-repeat', 'Enter valid tax id', (value) => {
53
+ return !/^(\d)\1+$/.test(value);
54
+ })
55
+ .test('not-seq', 'Enter valid tax id', (value) => {
56
+ return value !== '123456789';
57
+ })
58
+ .transform(transformEmptyString);
59
+ const dateOfIncorporationValidation = create$6()
60
+ .test('not-future', 'Date of incorporation cannot be in the future', (value) => {
61
+ const inputDate = new Date(value);
62
+ const today = new Date();
63
+ return inputDate <= today;
64
+ })
65
+ .transform(transformEmptyString);
66
+ // Identity Validations
67
+ const identityNameValidation = create$6()
68
+ .min(2, 'Name must be at least 2 characters')
69
+ .max(100, 'Name must be less than 100 characters')
70
+ .matches(stringLettersOnlyRegex, 'Enter valid name')
71
+ .transform(transformEmptyString);
72
+ const identityTitleValidation = create$6()
73
+ .min(2, 'Title must be at least 2 characters')
74
+ .max(50, 'Title must be less than 50 characters')
75
+ .matches(stringLettersOnlyRegex, 'Enter valid title')
76
+ .transform(transformEmptyString);
77
+ const dobValidation = (role) => {
78
+ return (create$6()
79
+ .test('min', 'Enter a valid date', (value) => {
80
+ const date = new Date(value);
81
+ const minDate = new Date('1902-01-01');
82
+ return date >= minDate;
83
+ })
84
+ .test('age', `${role} must be at least 18 years old`, (value) => {
85
+ const date = new Date(value);
86
+ const minAgeDate = new Date();
87
+ minAgeDate.setFullYear(minAgeDate.getFullYear() - 18);
88
+ return date <= minAgeDate;
89
+ })
90
+ .transform(transformEmptyString));
91
+ };
92
+ const ssnValidation = create$6()
93
+ .matches(ssnRegex, 'Enter valid SSN')
94
+ .test('not-repeat', 'Enter valid SSN', (value) => {
95
+ return !/^(\d)\1+$/.test(value);
96
+ })
97
+ .test('not-seq', 'Enter valid SSN', (value) => {
98
+ return value !== '123456789';
99
+ })
100
+ .transform(transformEmptyString);
101
+ // Address Validations
102
+ const lineOneValidation = create$6()
103
+ .min(5, 'Address must be at least 5 characters')
104
+ .max(100, 'Address must be less than 100 characters')
105
+ .matches(streetAddressRegex, 'Enter valid address line 1')
106
+ .test('not-po-box', 'A PO Box is not a valid address entry', (value) => {
107
+ return !poBoxRegex.test(value);
108
+ })
109
+ .transform(transformEmptyString);
110
+ const lineTwoValidation = create$6()
111
+ .max(100, 'Address must be less than 100 characters')
112
+ .matches(streetAddressRegex, 'Enter valid address line 2')
113
+ .test('not-po-box', 'A PO Box is not a valid address entry', (value) => {
114
+ return !poBoxRegex.test(value);
115
+ })
116
+ .transform(transformEmptyString);
117
+ const cityValidation = create$6()
118
+ .min(2, 'City must be at least 2 characters')
119
+ .max(50, 'City must be less than 50 characters')
120
+ .matches(stringLettersOnlyRegex, 'Enter valid city')
121
+ .transform(transformEmptyString);
122
+ const stateValidation = create$6()
123
+ .oneOf(StateOptions.map((option) => option.value), 'Select state')
124
+ .transform(transformEmptyString);
125
+ const postalValidation = create$6()
126
+ .matches(/^[0-9]{5}$/, 'Enter valid postal code')
127
+ .transform(transformEmptyString);
128
+ // Additional Questions Validations
129
+ const revenueValidation = create$6()
130
+ .matches(numbersOnlyRegex, 'Enter valid revenue')
131
+ .transform(transformEmptyString);
132
+ const paymentVolumeValidation = create$6()
133
+ .matches(numbersOnlyRegex, 'Enter valid payment volume')
134
+ .transform(transformEmptyString);
135
+ const whenServiceReceivedValidation = create$6()
136
+ .oneOf(businessServiceReceivedOptions.map((option) => option.value), 'Select when service is received')
137
+ .transform(transformEmptyString);
138
+ const recurringPaymentsValidation = create$6()
139
+ .oneOf(recurringPaymentsOptions.map((option) => option.value), 'Select recurring payments')
140
+ .transform(transformEmptyString);
141
+ const recurringPaymentsPercentageValidation = create$6()
142
+ .when('business_recurring_payments', {
143
+ is: (val) => val === 'Yes',
144
+ then: (schema) => schema.required('Enter recurring payments percentage'),
145
+ otherwise: (schema) => schema.nullable(),
146
+ })
147
+ .transform(transformEmptyString);
148
+ const seasonalBusinessValidation = create$6()
149
+ .oneOf(seasonalBusinessOptions.map((option) => option.value), 'Select seasonal business')
150
+ .transform(transformEmptyString);
151
+ const otherPaymentDetailsValidation = create$6()
152
+ .transform(transformEmptyString);
2
153
 
3
154
  var BusinessFormServerErrors;
4
155
  (function (BusinessFormServerErrors) {
@@ -24,85 +175,5 @@ var OwnerFormClickActions;
24
175
  OwnerFormClickActions["addOwnerForm"] = "addOwnerForm";
25
176
  OwnerFormClickActions["updateOwner"] = "updateOwner";
26
177
  })(OwnerFormClickActions || (OwnerFormClickActions = {}));
27
- const BusinessTypeOptions = [
28
- {
29
- label: 'Choose business type',
30
- value: '',
31
- },
32
- {
33
- label: 'Individual',
34
- value: BusinessType.individual,
35
- },
36
- {
37
- label: 'For Profit',
38
- value: BusinessType.for_profit,
39
- },
40
- {
41
- label: 'Non Profit',
42
- value: BusinessType.non_profit,
43
- },
44
- {
45
- label: 'Government Entity',
46
- value: BusinessType.government_entity,
47
- },
48
- ];
49
- const BusinessStructureOptions = [
50
- {
51
- label: 'Choose business structure',
52
- value: '',
53
- },
54
- {
55
- label: 'Sole Proprietorship',
56
- value: BusinessStructure.sole_proprietorship,
57
- },
58
- {
59
- label: 'LLC (Single)',
60
- value: BusinessStructure.single_llc,
61
- },
62
- {
63
- label: 'LLC (Multiple)',
64
- value: BusinessStructure.multi_llc,
65
- },
66
- {
67
- label: 'Private Partnership',
68
- value: BusinessStructure.private_partnership,
69
- },
70
- {
71
- label: 'Private Corporation',
72
- value: BusinessStructure.private_corporation,
73
- },
74
- {
75
- label: 'Unincorporated Association',
76
- value: BusinessStructure.unincorporated_association,
77
- },
78
- {
79
- label: 'Public Partnership',
80
- value: BusinessStructure.public_partnership,
81
- },
82
- {
83
- label: 'Public Corporation',
84
- value: BusinessStructure.public_corporation,
85
- },
86
- {
87
- label: 'Incorporated',
88
- value: BusinessStructure.incorporated,
89
- },
90
- {
91
- label: 'Unincorporated',
92
- value: BusinessStructure.unincorporated,
93
- },
94
- {
95
- label: 'Government Unit',
96
- value: BusinessStructure.government_unit,
97
- },
98
- {
99
- label: 'Government Instrumentality',
100
- value: BusinessStructure.government_instrumentality,
101
- },
102
- {
103
- label: 'Tax Exempt Government Instrumentality',
104
- value: BusinessStructure.tax_exempt_government_instrumentality,
105
- },
106
- ];
107
178
 
108
- export { BusinessFormServerErrors as B, OwnerFormClickActions as O, BusinessTypeOptions as a, BusinessStructureOptions as b, BusinessFormClickActions as c, OwnerFormServerErrors as d };
179
+ export { postalValidation as A, BusinessFormServerErrors as B, OwnerFormServerErrors as C, OwnerFormClickActions as O, recurringPaymentsValidation as a, recurringPaymentsPercentageValidation as b, businessNameValidation as c, websiteUrlValidation as d, emailValidation as e, phoneValidation as f, doingBusinessAsValidation as g, businessTypeValidation as h, businessStructureValidation as i, industryValidation as j, dateOfIncorporationValidation as k, BusinessFormClickActions as l, identityNameValidation as m, identityTitleValidation as n, otherPaymentDetailsValidation as o, paymentVolumeValidation as p, dobValidation as q, revenueValidation as r, seasonalBusinessValidation as s, taxIdValidation as t, ssnValidation as u, lineOneValidation as v, whenServiceReceivedValidation as w, lineTwoValidation as x, cityValidation as y, stateValidation as z };
@@ -1,6 +1,6 @@
1
1
  import { c as create$3 } from './index.esm.js';
2
2
  import { a as addressSchema } from './business-address-schema.js';
3
- import { h as identityNameValidation, j as identityTitleValidation, e as emailValidation, a as phoneValidation, k as dobValidation, s as ssnValidation } from './payload-parsers.js';
3
+ import { m as identityNameValidation, n as identityTitleValidation, e as emailValidation, f as phoneValidation, q as dobValidation, u as ssnValidation } from './business-form-types.js';
4
4
 
5
5
  const identitySchema = (role, allowOptionalFields) => {
6
6
  const schema = create$3({
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
2
2
  import { F as FormController } from './form.js';
3
3
  import { P as PHONE_MASKS, S as SSN_MASK } from './form-input-masks.js';
4
4
  import { A as Api } from './Api.js';
5
- import { r as parseIdentityInfo } from './payload-parsers.js';
5
+ import { b as parseIdentityInfo } from './payload-parsers.js';
6
6
  import { i as identitySchema } from './business-identity-schema.js';
7
7
  import { c as config } from './config.js';
8
8
  import { B as BusinessFormServerErrors } from './business-form-types.js';
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { g as extractComputedFontsToLoad, a as formatCurrency } from './utils2.js';
3
3
  import { c as config } from './config.js';
4
+ import { C as ComponentErrorSeverity } from './ComponentError.js';
4
5
  import { d as defineCustomElement$8 } from './billing-form.js';
5
6
  import { d as defineCustomElement$7 } from './new-payment-method.js';
6
7
  import { d as defineCustomElement$6 } from './payment-method-form.js';
@@ -24,10 +25,19 @@ const CheckoutCore = /*@__PURE__*/ proxyCustomElement(class CheckoutCore extends
24
25
  this.__registerHost();
25
26
  this.__attachShadow();
26
27
  this.submitted = createEvent(this, "submitted", 7);
28
+ this.errorEvent = createEvent(this, "error-event", 7);
27
29
  this.onSubmitted = (data) => {
28
30
  this.submitted.emit(data);
29
31
  this.isLoading = false;
30
32
  };
33
+ this.onError = ({ error, code, severity }) => {
34
+ this.errorEvent.emit({
35
+ errorCode: code,
36
+ message: error,
37
+ severity,
38
+ });
39
+ this.isLoading = false;
40
+ };
31
41
  this.loadingSpinner = (h("div", { class: "spinner-border spinner-border-sm", role: "status" }, h("span", { class: "visually-hidden" }, "Loading...")));
32
42
  this.iframeOrigin = config.iframeOrigin;
33
43
  this.authToken = undefined;
@@ -38,9 +48,7 @@ const CheckoutCore = /*@__PURE__*/ proxyCustomElement(class CheckoutCore extends
38
48
  this.isLoading = false;
39
49
  this.checkout = undefined;
40
50
  this.serverError = false;
41
- this.errorMessage = '';
42
51
  this.creatingNewPaymentMethod = false;
43
- this.selectedPaymentMethodToken = undefined;
44
52
  }
45
53
  componentWillLoad() {
46
54
  if (this.getCheckout) {
@@ -60,10 +68,14 @@ const CheckoutCore = /*@__PURE__*/ proxyCustomElement(class CheckoutCore extends
60
68
  this.checkout = new Checkout(checkout);
61
69
  this.isLoading = false;
62
70
  },
63
- onError: (errorMessage) => {
64
- this.errorMessage = errorMessage;
71
+ onError: ({ error, code, severity }) => {
65
72
  this.isLoading = false;
66
- },
73
+ this.errorEvent.emit({
74
+ errorCode: code,
75
+ message: error,
76
+ severity,
77
+ });
78
+ }
67
79
  });
68
80
  }
69
81
  ;
@@ -84,23 +96,30 @@ const CheckoutCore = /*@__PURE__*/ proxyCustomElement(class CheckoutCore extends
84
96
  event.preventDefault();
85
97
  this.isLoading = true;
86
98
  const payload = await this.paymentMethodOptionsRef.resolvePaymentMethod();
87
- if (payload.token) {
99
+ if (!payload) {
100
+ this.isLoading = false;
101
+ }
102
+ else if (payload.error) {
103
+ this.onError({
104
+ code: payload.error.code,
105
+ error: payload.error.message,
106
+ severity: ComponentErrorSeverity.ERROR,
107
+ });
108
+ }
109
+ else if (payload.token) {
88
110
  this.complete({
89
111
  payment: { payment_mode: 'ecom', payment_token: payload.token },
90
112
  onSuccess: this.onSubmitted,
91
- onError: this.onSubmitted,
113
+ onError: this.onError,
92
114
  });
93
115
  }
94
116
  else if (((_a = payload.bnpl) === null || _a === void 0 ? void 0 : _a.status) === 'success') {
95
117
  this.complete({
96
118
  payment: { payment_mode: 'bnpl' },
97
119
  onSuccess: this.onSubmitted,
98
- onError: this.onSubmitted,
120
+ onError: this.onError,
99
121
  });
100
122
  }
101
- else {
102
- this.isLoading = false;
103
- }
104
123
  }
105
124
  render() {
106
125
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
@@ -117,9 +136,7 @@ const CheckoutCore = /*@__PURE__*/ proxyCustomElement(class CheckoutCore extends
117
136
  "isLoading": [32],
118
137
  "checkout": [32],
119
138
  "serverError": [32],
120
- "errorMessage": [32],
121
139
  "creatingNewPaymentMethod": [32],
122
- "selectedPaymentMethodToken": [32],
123
140
  "loadFontsOnParent": [64]
124
141
  }]);
125
142
  function defineCustomElement() {
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface FormControlFile extends Components.FormControlFile, HTMLElement {}
4
+ export const FormControlFile: {
5
+ prototype: FormControlFile;
6
+ new (): FormControlFile;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;