@justifi/webcomponents 6.1.1-rc.1 → 6.1.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 (220) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.js +2 -2
  3. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  4. package/dist/cjs/card-form.cjs.entry.js +2 -2
  5. package/dist/cjs/{check-pkg-version-iW3HGQFY.js → check-pkg-version-CEZpYUNV.js} +1 -1
  6. package/dist/cjs/checkouts-list-core.cjs.entry.js +1 -1
  7. package/dist/cjs/form-alert_5.cjs.entry.js +4 -4
  8. package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
  9. package/dist/cjs/form-control-monetary-provisioning.cjs.entry.js +2 -2
  10. package/dist/cjs/form-control-number-masked_2.cjs.entry.js +1 -1
  11. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  12. package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +9 -9
  13. package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +6 -6
  15. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +1 -1
  18. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
  19. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +1 -1
  20. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
  21. package/dist/cjs/justifi-details.cjs.entry.js +1 -1
  22. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  24. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  25. package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
  26. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +3 -3
  27. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  28. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +1 -1
  29. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +3 -3
  30. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
  31. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  32. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  33. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
  34. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  35. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  36. package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +1 -1
  37. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  38. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
  39. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  40. package/dist/cjs/loader.cjs.js +1 -1
  41. package/dist/cjs/{package-CwcyK2nz.js → package-D2S7GRvh.js} +1 -1
  42. package/dist/cjs/pagination-menu.cjs.entry.js +3 -3
  43. package/dist/cjs/webcomponents.cjs.js +1 -1
  44. package/dist/collection/collection-manifest.json +1 -1
  45. package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +6 -7
  46. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +1 -1
  47. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +6 -7
  48. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +6 -7
  49. package/dist/collection/components/business-forms/owner-form/identity-address/identity-address-form.js +1 -1
  50. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +1 -1
  51. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +6 -7
  52. package/dist/collection/components/business-forms/owner-form/owner-form.js +1 -1
  53. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +1 -1
  54. package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-document-inputs.js +1 -1
  55. package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-form-inputs.js +1 -1
  56. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +1 -1
  57. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
  58. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +1 -1
  59. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +1 -1
  60. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +1 -1
  61. package/dist/collection/components/business-forms/payment-provisioning/form-control-monetary-provisioning.js +2 -2
  62. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +1 -1
  63. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-core.js +1 -1
  64. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-buttons.js +1 -1
  65. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +1 -1
  66. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +1 -1
  67. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +1 -1
  68. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +2 -2
  69. package/dist/collection/components/checkout/card-form/card-form.js +2 -2
  70. package/dist/collection/components/checkout/checkout.js +2 -2
  71. package/dist/collection/components/checkout/save-new-payment-method.js +1 -1
  72. package/dist/collection/components/checkout/saved-payment-method.js +1 -1
  73. package/dist/collection/components/checkouts-list/checkouts-list-core.js +1 -1
  74. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +1 -1
  75. package/dist/collection/components/checkouts-list/checkouts-list.js +1 -1
  76. package/dist/collection/components/modular-checkout/modular-checkout.js +3 -2
  77. package/dist/collection/components/modular-checkout/sub-components/bank-account-billing-form-simple.js +1 -1
  78. package/dist/collection/components/modular-checkout/sub-components/card-billing-form-simple.js +1 -1
  79. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +3 -2
  80. package/dist/collection/ui-components/details/details.js +1 -1
  81. package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
  82. package/dist/collection/ui-components/pagination-menu/pagination-menu.js +3 -3
  83. package/dist/collection/ui-components/shadow-dom-components/justifi-radio-list-item.js +1 -1
  84. package/dist/docs.json +97 -22
  85. package/dist/esm/bank-account-document-form-inputs_4.entry.js +2 -2
  86. package/dist/esm/bank-account-form.entry.js +2 -2
  87. package/dist/esm/card-form.entry.js +2 -2
  88. package/dist/esm/{check-pkg-version-XGo_oqEC.js → check-pkg-version-Ba95SWgY.js} +1 -1
  89. package/dist/esm/checkouts-list-core.entry.js +1 -1
  90. package/dist/esm/form-alert_5.entry.js +4 -4
  91. package/dist/esm/form-control-checkbox.entry.js +2 -2
  92. package/dist/esm/form-control-monetary-provisioning.entry.js +2 -2
  93. package/dist/esm/form-control-number-masked_2.entry.js +1 -1
  94. package/dist/esm/hidden-input_2.entry.js +1 -1
  95. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +9 -9
  96. package/dist/esm/justifi-apple-pay_8.entry.js +2 -2
  97. package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +6 -6
  98. package/dist/esm/justifi-business-details.entry.js +2 -2
  99. package/dist/esm/justifi-business-form.entry.js +2 -2
  100. package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
  101. package/dist/esm/justifi-checkout.entry.js +4 -4
  102. package/dist/esm/justifi-checkouts-list-filters.entry.js +1 -1
  103. package/dist/esm/justifi-checkouts-list.entry.js +3 -3
  104. package/dist/esm/justifi-details.entry.js +1 -1
  105. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  106. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  107. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  108. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  109. package/dist/esm/justifi-owner-form_3.entry.js +3 -3
  110. package/dist/esm/justifi-payment-details.entry.js +2 -2
  111. package/dist/esm/justifi-payment-provisioning-core.entry.js +1 -1
  112. package/dist/esm/justifi-payment-provisioning.entry.js +3 -3
  113. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  114. package/dist/esm/justifi-payments-list.entry.js +2 -2
  115. package/dist/esm/justifi-payout-details.entry.js +2 -2
  116. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  117. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  118. package/dist/esm/justifi-refund-payment.entry.js +2 -2
  119. package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
  120. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  121. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  122. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  123. package/dist/esm/loader.js +1 -1
  124. package/dist/esm/{package-YyotqiSL.js → package-Csfiax9X.js} +1 -1
  125. package/dist/esm/pagination-menu.entry.js +3 -3
  126. package/dist/esm/webcomponents.js +1 -1
  127. package/dist/module/additional-questions.js +2 -2
  128. package/dist/module/bank-account-billing-form-simple.js +1 -1
  129. package/dist/module/bank-account-document-inputs.js +1 -1
  130. package/dist/module/bank-account-form-inputs2.js +1 -1
  131. package/dist/module/bank-account-form.js +2 -2
  132. package/dist/module/business-additional-questions-form-step.js +1 -1
  133. package/dist/module/business-bank-account-form-step.js +1 -1
  134. package/dist/module/business-core-info-form-step.js +1 -1
  135. package/dist/module/business-core-info.js +1 -1
  136. package/dist/module/business-owners-form-step.js +1 -1
  137. package/dist/module/business-representative-form-inputs.js +1 -1
  138. package/dist/module/business-representative-form-step.js +1 -1
  139. package/dist/module/business-representative.js +2 -2
  140. package/dist/module/business-terms-conditions-form-step.js +1 -1
  141. package/dist/module/card-billing-form-simple.js +1 -1
  142. package/dist/module/card-form.js +2 -2
  143. package/dist/module/checkouts-list-core2.js +1 -1
  144. package/dist/module/details.js +1 -1
  145. package/dist/module/form-control-checkbox2.js +2 -2
  146. package/dist/module/form-control-monetary-provisioning2.js +2 -2
  147. package/dist/module/identity-address-form.js +1 -1
  148. package/dist/module/justifi-checkout.js +2 -2
  149. package/dist/module/justifi-checkouts-list-filters.js +1 -1
  150. package/dist/module/justifi-checkouts-list.js +1 -1
  151. package/dist/module/justifi-payment-provisioning.js +1 -1
  152. package/dist/module/justifi-radio-list-item2.js +1 -1
  153. package/dist/module/justifi-saved-payment-method.js +1 -1
  154. package/dist/module/legal-address-form-step.js +1 -1
  155. package/dist/module/legal-address-form.js +2 -2
  156. package/dist/module/owner-form-core2.js +1 -1
  157. package/dist/module/owner-form-inputs2.js +2 -2
  158. package/dist/module/owner-form.js +1 -1
  159. package/dist/module/package.js +1 -1
  160. package/dist/module/pagination-menu2.js +3 -3
  161. package/dist/module/payment-provisioning-core.js +1 -1
  162. package/dist/module/payment-provisioning-form-buttons.js +1 -1
  163. package/dist/module/payment-provisioning-form-steps.js +1 -1
  164. package/dist/module/save-new-payment-method.js +1 -1
  165. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +1 -1
  166. package/dist/types/components.d.ts +10 -8
  167. package/dist/webcomponents/{p-e9f6a621.entry.js → p-000d6b5d.entry.js} +1 -1
  168. package/dist/webcomponents/{p-de95bf57.entry.js → p-0256af65.entry.js} +1 -1
  169. package/dist/webcomponents/{p-c2569b4c.entry.js → p-0f16c00f.entry.js} +1 -1
  170. package/dist/webcomponents/{p-aeb22aa2.entry.js → p-0f47f052.entry.js} +1 -1
  171. package/dist/webcomponents/{p-7686ef15.entry.js → p-1872ee94.entry.js} +1 -1
  172. package/dist/webcomponents/{p-3dd950bf.entry.js → p-281ea1f6.entry.js} +1 -1
  173. package/dist/webcomponents/{p-c12d0453.entry.js → p-2b568e8e.entry.js} +1 -1
  174. package/dist/webcomponents/{p-13df20c1.entry.js → p-2d9b817b.entry.js} +1 -1
  175. package/dist/webcomponents/{p-f378af59.entry.js → p-40c3d17c.entry.js} +1 -1
  176. package/dist/webcomponents/p-44ec2d88.entry.js +1 -0
  177. package/dist/webcomponents/{p-cb782215.entry.js → p-44f9739e.entry.js} +1 -1
  178. package/dist/webcomponents/p-5235230f.entry.js +1 -0
  179. package/dist/webcomponents/{p-773d6dd3.entry.js → p-5c0c35ac.entry.js} +1 -1
  180. package/dist/webcomponents/p-7c8deca8.entry.js +1 -0
  181. package/dist/webcomponents/p-7dc9ef8a.entry.js +1 -0
  182. package/dist/webcomponents/{p-d88d7418.entry.js → p-7eb4b9b4.entry.js} +1 -1
  183. package/dist/webcomponents/p-84551ee4.entry.js +1 -0
  184. package/dist/webcomponents/p-854b3db0.entry.js +1 -0
  185. package/dist/webcomponents/p-8663e8bd.entry.js +1 -0
  186. package/dist/webcomponents/p-8b3245c4.entry.js +1 -0
  187. package/dist/webcomponents/{p-63ad8ebd.entry.js → p-8f8dfd4b.entry.js} +1 -1
  188. package/dist/webcomponents/{p-e365b251.entry.js → p-9365c7c2.entry.js} +1 -1
  189. package/dist/webcomponents/p-Csfiax9X.js +1 -0
  190. package/dist/webcomponents/{p-7680c57b.entry.js → p-a10ae013.entry.js} +1 -1
  191. package/dist/webcomponents/{p-6e9cd0dd.entry.js → p-a8ad5f5c.entry.js} +1 -1
  192. package/dist/webcomponents/p-a8e8d944.entry.js +1 -0
  193. package/dist/webcomponents/{p-fbc5fc6d.entry.js → p-aa14cc74.entry.js} +1 -1
  194. package/dist/webcomponents/{p-e6fe9b7d.entry.js → p-b3094b8f.entry.js} +1 -1
  195. package/dist/webcomponents/{p-447b55c0.entry.js → p-baf0d3e7.entry.js} +1 -1
  196. package/dist/webcomponents/{p-adc1d0be.entry.js → p-bdf293f6.entry.js} +1 -1
  197. package/dist/webcomponents/{p-28625e07.entry.js → p-c089fb5f.entry.js} +1 -1
  198. package/dist/webcomponents/{p-63fb5e82.entry.js → p-c6dc30e2.entry.js} +1 -1
  199. package/dist/webcomponents/p-d37d752e.entry.js +1 -0
  200. package/dist/webcomponents/{p-7b55e1c1.entry.js → p-da1fb2a3.entry.js} +1 -1
  201. package/dist/webcomponents/{p-d5452069.entry.js → p-ddc0b742.entry.js} +1 -1
  202. package/dist/webcomponents/{p-7b5ad3a7.entry.js → p-e6011271.entry.js} +1 -1
  203. package/dist/webcomponents/{p-4bf52215.entry.js → p-eaefb320.entry.js} +1 -1
  204. package/dist/webcomponents/{p-9ed7b13f.entry.js → p-f11a74c3.entry.js} +1 -1
  205. package/dist/webcomponents/p-fedfe376.entry.js +1 -0
  206. package/dist/webcomponents/{p-CdEseavG.js → p-l8F_7Ihw.js} +1 -1
  207. package/dist/webcomponents/webcomponents.esm.js +1 -1
  208. package/package.json +13 -13
  209. package/dist/webcomponents/p-02fdd7f5.entry.js +0 -1
  210. package/dist/webcomponents/p-6472b6db.entry.js +0 -1
  211. package/dist/webcomponents/p-6f27030e.entry.js +0 -1
  212. package/dist/webcomponents/p-705dba52.entry.js +0 -1
  213. package/dist/webcomponents/p-80b2cdec.entry.js +0 -1
  214. package/dist/webcomponents/p-YyotqiSL.js +0 -1
  215. package/dist/webcomponents/p-a09695c4.entry.js +0 -1
  216. package/dist/webcomponents/p-b149a2fc.entry.js +0 -1
  217. package/dist/webcomponents/p-b4aa9298.entry.js +0 -1
  218. package/dist/webcomponents/p-bc099dd0.entry.js +0 -1
  219. package/dist/webcomponents/p-c644a9f1.entry.js +0 -1
  220. package/dist/webcomponents/p-edfeb034.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,h as a,H as t}from"./p-DOjVAAtq.js";import{av as d,G as l}from"./p-xDbRW9xn.js";import{a as i,r as s,s as c,b as o}from"./p-yH3TC3ZQ.js";import{C as r,T as n,P as f,S as b}from"./p-B-iV5cYd.js";import{C as u}from"./p-BlJnA265.js";import{d as h}from"./p-Dt-vy9Le.js";import{S as m}from"./p-BX8GieXu.js";import{n as v}from"./p-BnjCmwMr.js";const y=class{constructor(a){e(this,a)}render(){return this.text?this.hideAlert?null:a("div",{class:"alert alert-danger d-flex align-items-center",role:"alert",part:d},a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"bi bi-exclamation-triangle-fill flex-shrink-0 me-2",viewBox:"0 0 16 16",role:"img","aria-label":"Warning:"},a("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})),a("div",null,this.text)):null}},p=class{constructor(a){e(this,a),this.errors={},this.additional_questions={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.additional_questions=Object.assign({},e.additional_questions)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{additional_questions:Object.assign(Object.assign({},this.formController.values.getValue().additional_questions),{[e]:a})}))}render(){var e,d,o,n,f,b,u,h,m,v,y,p,k,x;const j=this.formController.getInitialValues().additional_questions;return a(t,{key:"8f51222ff2a06a8636c2252a1df25803c464cd5a"},a("fieldset",{key:"c705274cb9e5cc651f8cedb5ac23714a75dca09a"},a("legend",{key:"0e865f2763c872ccd65c7d255e0a49533bf8afbe",part:l},"Additional Questions"),a("div",{key:"b5a9d2c8086820d837a6261c0fbbd1c4785e8cbe",class:"row gy-3"},a("div",{key:"b0174e926ef2726d9c1ce809d00cf8fef623207c",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"5553ed9ca690b4b7a54dfe864225fb4e10987c96",name:"business_revenue",label:"What is the business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(d=null===(e=this.errors)||void 0===e?void 0:e.additional_questions)||void 0===d?void 0:d.business_revenue,defaultValue:null==j?void 0:j.business_revenue,maskOptions:r.WHOLE})),a("div",{key:"a01e709a65772041979e7b8c057b271e26524174",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"2e56403c3eb357dac7f6791e0c5fa4fca58e6cfb",name:"business_payment_volume",label:"What is the business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(n=null===(o=this.errors)||void 0===o?void 0:o.additional_questions)||void 0===n?void 0:n.business_payment_volume,defaultValue:null==j?void 0:j.business_payment_volume,maskOptions:r.WHOLE})),a("div",{key:"74318a7f6fdcc265d96827e5fb02d797631b3fd5",class:"col-12"},a("form-control-select",{key:"d166c9a1951afc9e1876d078ddc026671e8e0dcc",name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(b=null===(f=this.errors)||void 0===f?void 0:f.additional_questions)||void 0===b?void 0:b.business_when_service_received,options:i,defaultValue:null==j?void 0:j.business_when_service_received})),a("div",{key:"e47aefb3a2274244d3e2561da7cfecb203445f1e",class:"col-12"},a("form-control-select",{key:"33978d0af775cace90de84104f74b2d6c22ae1c0",name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.additional_questions)||void 0===h?void 0:h.business_recurring_payments,options:s,defaultValue:null==j?void 0:j.business_recurring_payments})),a("div",{key:"93f996064e4055c9a81c0077a20fd878ad1a6c97",class:"col-12"},a("form-control-text",{key:"68ac25357311838b8fa9a897fbb324f45f589f5f",name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(v=null===(m=this.errors)||void 0===m?void 0:m.additional_questions)||void 0===v?void 0:v.business_recurring_payments_percentage,defaultValue:null==j?void 0:j.business_recurring_payments_percentage})),a("div",{key:"f2dfe10a8ed19faa36a38a8192268813b03d454f",class:"col-12"},a("form-control-select",{key:"1d6cf56564944d8dbef4f22c403232c9b7841018",name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(p=null===(y=this.errors)||void 0===y?void 0:y.additional_questions)||void 0===p?void 0:p.business_seasonal,options:c,defaultValue:null==j?void 0:j.business_seasonal})),a("div",{key:"fe75a54400d4614fe1d3ed9099ff5a5d3822c007",class:"col-12"},a("form-control-text",{key:"aa7609f7687a5c0666bf35119cd4af7ad4e68f89",name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business?",inputHandler:this.inputHandler,errorText:null===(x=null===(k=this.errors)||void 0===k?void 0:k.additional_questions)||void 0===x?void 0:x.business_other_payment_details,defaultValue:null==j?void 0:j.business_other_payment_details})))))}},k=class{constructor(a){e(this,a),this.errors={},this.coreInfo={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.values.subscribe((e=>this.coreInfo=Object.assign({},new u(e)))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:a}))}render(){const e=this.formController.getInitialValues();return a(t,{key:"0f01827de5a6ff9f6da4aabac4c219da9bb7f7bc"},a("fieldset",{key:"fb47f0c5e7d566fe3af06eb1f38af813ca1a5a98"},a("legend",{key:"04b3a526d159f010da3960220c6738c23ab59ae9",part:l},"General Info"),a("div",{key:"cfa7ae60828f3b7525d6582effe31e11f4940ae1",class:"row gy-3"},a("div",{key:"09f915e522f42ea60bde326b93c0acbf79914047",class:"col-12"},a("form-control-text",{key:"fcfb0a32d62173c0fd60e21410cbf8be1843855f",name:"legal_name",label:"Legal Name",defaultValue:e.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler})),a("div",{key:"be83c79addceacb5621fb480cdc606a5393778ca",class:"col-12"},a("form-control-text",{key:"e78ff2fa54cd819b9117d03976d40e5aa49e33b5",name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:e.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler})),a("div",{key:"1a17daeaac46daa23ea4a2a028d08db238cc11d9",class:"col-12 col-md-8"},a("form-control-select",{key:"c8d76e0cdb665a43162d5605bda5361969933964",name:"classification",label:"Business Classification",options:o,defaultValue:e.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),a("div",{key:"1cfd904e9c039e834e086847b296ee4a6ee3f676",class:"col-12 col-md-4"},a("form-control-date",{key:"bdd8b4b01c9bd22b4c0188d7b37ebd6228a8af45",name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:e.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),a("div",{key:"bb1aceaf0a2ea01d4116fa66e7fc086824940619",class:"col-12 col-md-6"},a("form-control-text",{key:"4fdcb1caae3cba88e8f6f9c14cb8b85c98e8a0f2",name:"industry",label:"Industry",defaultValue:e.industry,errorText:this.errors.industry,inputHandler:this.inputHandler})),a("div",{key:"238c8aae3f95286292b302efd2a490a0b7e9ce56",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"5a8e4040603858ff704da4c3c901d3903d0ed619",name:"tax_id",label:"Tax ID",defaultValue:e.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:n.US})),a("div",{key:"e3a9a7987837dbb026b3edb6c0659b8c45ddf3bc",class:"col-12"},a("form-control-text",{key:"fd826dbe012a25bfcaf456f3f2d3e300de3b81d8",name:"website_url",label:"Website URL",defaultValue:e.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler})),a("div",{key:"26cd8ff17604388d92f594193cde8a5005a727d1",class:"col-12 col-md-6"},a("form-control-text",{key:"cf5c1601d7d956656168d3819767cc912a35ea7c",name:"email",label:"Email Address",defaultValue:e.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"f94b1fa7cc39f3800404ce2ea2d46af70bf43b08",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"ea73e0093f103c7bc5913ca1dc7625fde1ff09f6",name:"phone",label:"Phone Number",defaultValue:e.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:f.US})))))}},x=class{constructor(a){e(this,a),this.errors={},this.representative={},this.inputHandler=(e,a)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{[e]:a})}))},this.onAddressFormUpdate=e=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{address:Object.assign(Object.assign({},this.formController.values.getValue().representative.address),e)})}))},this.onDateOfBirthUpdate=e=>{const a=h(e.detail);this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{dob_day:a.dob_day,dob_month:a.dob_month,dob_year:a.dob_year})}))}}get identificationNumberLabel(){return this.representative.ssn_last4?"Update SSN (optional)":"SSN"}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e.representative))),this.formController.values.subscribe((e=>this.representative=Object.assign({},e.representative)))}render(){const e=this.formController.getInitialValues().representative;return a(t,{key:"94097bf5ab94fc900918d44510ea8810f2a1984d"},a("fieldset",{key:"95619d9fa81838e5a08e191845a7343f8b3609ce"},a("legend",{key:"9ec4d2470dc31e3128c0d3351e3983dc07bca92e",part:l},"Representative"),a("div",{key:"a2b1d8ab98e3683c6ad57d6a6dfb259b27a8cd0f",class:"row gy-3"},a("div",{key:"ce36f02cde3b989b427418b7c09b92bcbc9638f1",class:"col-12 col-md-8"},a("form-control-text",{key:"7912bcd5f4f4d5870a08529d09a21994911a7262",name:"name",label:"Full Name",defaultValue:null==e?void 0:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),a("div",{key:"57f138c87e53aa0b555dc5d7ebe699c6207e5825",class:"col-12 col-md-4"},a("form-control-text",{key:"d98d5cfcb5f4a7e1dd9eb0e55844bb8a210bd305",name:"title",label:"Title",defaultValue:null==e?void 0:e.title,errorText:this.errors.title,inputHandler:this.inputHandler})),a("div",{key:"08093caed32f9124c48fc73e05b2e5ec698fac5d",class:"col-12 col-md-6"},a("form-control-text",{key:"ef868e698b2369934bfeee522d8f4a7ff4924074",name:"email",label:"Email Address",defaultValue:null==e?void 0:e.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"ffb1c8a6ccd2df1a198f679ad02d3921821939b9",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"ce4cd6e4edacdc536f74b85341fe35dc4aae435e",name:"phone",label:"Phone Number",defaultValue:null==e?void 0:e.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:f.US})),a("div",{key:"27d97a8149ba81e7576e850c8c273298c8394f51",class:"col-12 col-md-4"},a("form-control-date",{key:"5cd76163b49822f9dcbd3339c89a0afffcc4247f",name:"dob_full",label:"Birth Date",defaultValue:null==e?void 0:e.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:this.onDateOfBirthUpdate})),a("div",{key:"62bd3c48ccc31d7f36a00bc27eafefc3369226e3",class:"col-12 col-md-8"},a("form-control-number-masked",{key:"7d43730b2615e7b515ca6c66d90ceeb573e61d6a",name:"identification_number",label:this.identificationNumberLabel,defaultValue:null==e?void 0:e.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:b})),a("div",{key:"ec6cb5f493f5335f6b0490894577eb401f1c150a",class:"col-12"},a("justifi-identity-address-form",{key:"6ecffcd10914504148573e99a708cae6d6976cd2",errors:this.errors.address,defaultValues:null==e?void 0:e.address,handleFormUpdate:this.onAddressFormUpdate})))))}},j=class{constructor(a){e(this,a),this.errors={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.legal_address=Object.assign({},e.legal_address)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{legal_address:Object.assign(Object.assign({},this.formController.values.getValue().legal_address),{[e]:a})}))}render(){var e,d,i,s,c,o,r,n,f,b,u,h;const y=this.formController.getInitialValues().legal_address;return a(t,{key:"3b391bb2404c911e1663835acf0d13e7aab73735"},a("fieldset",{key:"f5db5dd65ba422e05728b38e562d1140777f4208"},a("legend",{key:"a1e464501561d649b6b514de45967d84d5f69f2a",part:l},"Business Legal Address"),a("div",{key:"f64e06197c22f9d0cddb7b78d181aec203070612",class:"row gy-3"},a("div",{key:"0c5ed4640de17b420021beedf69fbf6fedc16b5e",class:"col-12"},a("form-control-text",{key:"449f633ae6ff84855258898a90f9adfc028b9685",name:"line1",label:"Legal Address",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.line1,errorText:null===(d=null===(e=this.errors)||void 0===e?void 0:e.legal_address)||void 0===d?void 0:d.line1})),a("div",{key:"6cdc7bd96fbcdccf3d2da67ce2c0c110be6f215f",class:"col-12"},a("form-control-text",{key:"5d179741b7462cd569f43aaa16ea78a89dd2f7dd",name:"line2",label:"Address Line 2",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.line2,errorText:null===(s=null===(i=this.errors)||void 0===i?void 0:i.legal_address)||void 0===s?void 0:s.line2})),a("div",{key:"55df7defd5dff8f7b56d639319c4067b53ce8fb8",class:"col-12"},a("form-control-text",{key:"dfb822432d69a8e53424faa4e5ffb00d25601836",name:"city",label:"City",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.city,errorText:null===(o=null===(c=this.errors)||void 0===c?void 0:c.legal_address)||void 0===o?void 0:o.city})),a("div",{key:"533670b7a9b60d45bf05684b48c2034f99d4b484",class:"col-12"},a("form-control-select",{key:"f10ed112c00c798c1b482f8893ef04737deb1dc5",name:"state",label:"State",options:m,inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.state,errorText:null===(n=null===(r=this.errors)||void 0===r?void 0:r.legal_address)||void 0===n?void 0:n.state})),a("div",{key:"7d67e97ebbb48402ede6aed07fe72154cf3424fa",class:"col-12"},a("form-control-text",{key:"5bccb6167aac8b9f64254dc93376f51b6489c0c9",name:"postal_code",label:"Postal Code",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.postal_code,errorText:null===(b=null===(f=this.errors)||void 0===f?void 0:f.legal_address)||void 0===b?void 0:b.postal_code,maxLength:5,keyDownHandler:v})),a("div",{key:"8a03c711d712e013590d5489d3bffa5145ac0a7a",class:"col-12"},a("form-control-select",{key:"e58697ad7a448ab860a8f72a053dbaf030faabbd",name:"country",label:"Country",options:[{label:"United States",value:"USA"}],inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.country,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.legal_address)||void 0===h?void 0:h.country,disabled:!0})))))}};export{y as form_alert,p as justifi_additional_questions,k as justifi_business_core_info,x as justifi_business_representative,j as justifi_legal_address_form}
1
+ import{r as e,h as a,H as t}from"./p-DOjVAAtq.js";import{av as l,G as d}from"./p-xDbRW9xn.js";import{a as i,r as s,s as c,b as o}from"./p-yH3TC3ZQ.js";import{C as r,T as n,P as f,S as b}from"./p-B-iV5cYd.js";import{C as u}from"./p-BlJnA265.js";import{d as h}from"./p-Dt-vy9Le.js";import{S as m}from"./p-BX8GieXu.js";import{n as v}from"./p-BnjCmwMr.js";const y=class{constructor(a){e(this,a)}render(){return this.text?this.hideAlert?null:a("div",{class:"alert alert-danger d-flex align-items-center",role:"alert",part:l},a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"bi bi-exclamation-triangle-fill flex-shrink-0 me-2",viewBox:"0 0 16 16",role:"img","aria-label":"Warning:"},a("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})),a("div",null,this.text)):null}},p=class{constructor(a){e(this,a),this.errors={},this.additional_questions={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.additional_questions=Object.assign({},e.additional_questions)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{additional_questions:Object.assign(Object.assign({},this.formController.values.getValue().additional_questions),{[e]:a})}))}render(){var e,l,o,n,f,b,u,h,m,v,y,p,k,x;const j=this.formController.getInitialValues().additional_questions;return a(t,{key:"e3e354a7cf470f658e0f95d37186b1f45771b673"},a("fieldset",{key:"7fb001177a4f907d513eb5955063d446234ede0c"},a("legend",{key:"ee6b045a438be9f56345daad752e105640f1ca3d",part:d},"Additional Questions"),a("div",{key:"ed114675357f3b70c34a3eb941fdb30e6219cdc9",class:"row gy-3"},a("div",{key:"b85c27c827cf5e5d0d556c343315e5eec736f538",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"4576f67fa74ba7c2ca9730468ddc52b055a3c496",name:"business_revenue",label:"What is the business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(l=null===(e=this.errors)||void 0===e?void 0:e.additional_questions)||void 0===l?void 0:l.business_revenue,defaultValue:null==j?void 0:j.business_revenue,maskOptions:r.WHOLE})),a("div",{key:"0614c60cc7daaf890ccb4888d41b0260a26f9a0e",class:"col-12 col-md-6"},a("form-control-monetary-provisioning",{key:"2c435c1553714d75542e0e3bcf1d723f26b37da8",name:"business_payment_volume",label:"What is the business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(n=null===(o=this.errors)||void 0===o?void 0:o.additional_questions)||void 0===n?void 0:n.business_payment_volume,defaultValue:null==j?void 0:j.business_payment_volume,maskOptions:r.WHOLE})),a("div",{key:"8d4a19eb0b6b5707f4a423543d86ae50f6492efc",class:"col-12"},a("form-control-select",{key:"2e49f907bae85cd4901e4aa4413284596fbed365",name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(b=null===(f=this.errors)||void 0===f?void 0:f.additional_questions)||void 0===b?void 0:b.business_when_service_received,options:i,defaultValue:null==j?void 0:j.business_when_service_received})),a("div",{key:"11bc4e0bbe2122b977cf8bc29ac0601ef941881c",class:"col-12"},a("form-control-select",{key:"c511b728971250dc3272c1ef9ff96131a9ac6a2e",name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.additional_questions)||void 0===h?void 0:h.business_recurring_payments,options:s,defaultValue:null==j?void 0:j.business_recurring_payments})),a("div",{key:"5a40dfe41a9fca815cdf0eb7455b41615d1e6c76",class:"col-12"},a("form-control-text",{key:"d8aaf0f6d7d44b1b15ec76af198a0117493f08c6",name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(v=null===(m=this.errors)||void 0===m?void 0:m.additional_questions)||void 0===v?void 0:v.business_recurring_payments_percentage,defaultValue:null==j?void 0:j.business_recurring_payments_percentage})),a("div",{key:"b211bb865a60baf1ea00c81f76f000ff2a31d7bd",class:"col-12"},a("form-control-select",{key:"4b693e7425e690a59e2c70646cca2b886b8a8796",name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(p=null===(y=this.errors)||void 0===y?void 0:y.additional_questions)||void 0===p?void 0:p.business_seasonal,options:c,defaultValue:null==j?void 0:j.business_seasonal})),a("div",{key:"e85b7fceb9cdc808afaf3559609b7519c9630266",class:"col-12"},a("form-control-text",{key:"ae4a6518c7499826f30376f1c902f694244059c7",name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business?",inputHandler:this.inputHandler,errorText:null===(x=null===(k=this.errors)||void 0===k?void 0:k.additional_questions)||void 0===x?void 0:x.business_other_payment_details,defaultValue:null==j?void 0:j.business_other_payment_details})))))}},k=class{constructor(a){e(this,a),this.errors={},this.coreInfo={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.values.subscribe((e=>this.coreInfo=Object.assign({},new u(e)))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:a}))}render(){const e=this.formController.getInitialValues();return a(t,{key:"75bbee71e68fb0dafa609838f4d3e22bf4388332"},a("fieldset",{key:"1e1cc71bfd46b278ad3f7d3a73d5b126fbf19533"},a("legend",{key:"341b82942f116b4a2b0b29ce505fda3a153f88ec",part:d},"General Info"),a("div",{key:"e97b3c3a38f888795c24c887d42854c79f1f7b34",class:"row gy-3"},a("div",{key:"6d560585e9843143c836a302ad83b19719732467",class:"col-12"},a("form-control-text",{key:"9868049d15e3f2552feba3ff6fa6b1ab43c7ae9c",name:"legal_name",label:"Legal Name",defaultValue:e.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler})),a("div",{key:"f77c1d66117c29b6f5963a99bbb531f76242d052",class:"col-12"},a("form-control-text",{key:"2708d678c35d4fa9838cd3fd834c77105b94feff",name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:e.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler})),a("div",{key:"bb17f23c8f7fc1be73524dce8ed11ce9a9524a21",class:"col-12 col-md-8"},a("form-control-select",{key:"bc4175a9ed29127d89cf9c6135448c80733f6959",name:"classification",label:"Business Classification",options:o,defaultValue:e.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),a("div",{key:"6c5faad25c64ec50023be5128b8b0527584f9a7c",class:"col-12 col-md-4"},a("form-control-date",{key:"54a151222d7eabc40a66ffbd5d0dba2e765cd135",name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:e.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),a("div",{key:"5a562ba1811a319d2f5dd10197be2e1ecb94da8b",class:"col-12 col-md-6"},a("form-control-text",{key:"03780a900fd4c176e5658b0784ef57eb48d2b3f7",name:"industry",label:"Industry",defaultValue:e.industry,errorText:this.errors.industry,inputHandler:this.inputHandler})),a("div",{key:"96e4110eb7b40f87a804b24a2ec94defca0be899",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"3cfda64e576a93bbed143b34c235b5388dade635",name:"tax_id",label:"Tax ID",defaultValue:e.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:n.US})),a("div",{key:"6a6e4d87838f2666c2750662c1f031f3b8d0effe",class:"col-12"},a("form-control-text",{key:"68f28a6b78e2df1cd69631097a001369722d8081",name:"website_url",label:"Website URL",defaultValue:e.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler})),a("div",{key:"8a334f64bc214d1211772e5a5018b82dadd88d1a",class:"col-12 col-md-6"},a("form-control-text",{key:"639888a2d30e785e1d403830c718b7991f28285a",name:"email",label:"Email Address",defaultValue:e.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"b4aac33c17ce96c5c9a9ce5a90f322f69941df5e",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"c384d24cc34fefca964a5eb412b28360361ab780",name:"phone",label:"Phone Number",defaultValue:e.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:f.US})))))}},x=class{constructor(a){e(this,a),this.errors={},this.representative={},this.inputHandler=(e,a)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{[e]:a})}))},this.onAddressFormUpdate=e=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{address:Object.assign(Object.assign({},this.formController.values.getValue().representative.address),e)})}))},this.onDateOfBirthUpdate=e=>{const a=h(e.detail);this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{representative:Object.assign(Object.assign({},this.formController.values.getValue().representative),{dob_day:a.dob_day,dob_month:a.dob_month,dob_year:a.dob_year})}))}}get identificationNumberLabel(){return this.representative.ssn_last4?"Update SSN (optional)":"SSN"}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e.representative))),this.formController.values.subscribe((e=>this.representative=Object.assign({},e.representative)))}render(){const e=this.formController.getInitialValues().representative;return a(t,{key:"88bd35928331776d5cbb7d085fd55a76fde1a084"},a("fieldset",{key:"202c40f332352c2f4d3c8a136888c39c67379e5f"},a("legend",{key:"a0b5043b348b1d8632a6bf0fe2d4309a8132d1f7",part:d},"Representative"),a("div",{key:"ba50c004e2b37f384dd8af63b1e0e397abadb9de",class:"row gy-3"},a("div",{key:"b85bf5fb0da9e8feae19dbebb0a911362e914601",class:"col-12 col-md-8"},a("form-control-text",{key:"95f849c7c0ba0c67bdc0a55727e00755e03897ef",name:"name",label:"Full Name",defaultValue:null==e?void 0:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),a("div",{key:"074067a3ce960b678ea38d53b84adda24e60754c",class:"col-12 col-md-4"},a("form-control-text",{key:"7ef397af32b7c0f79eeae1499bf3d3d147961c96",name:"title",label:"Title",defaultValue:null==e?void 0:e.title,errorText:this.errors.title,inputHandler:this.inputHandler})),a("div",{key:"a26bfd8a0824aaa12c6ffa48ac58c2bccc7236ef",class:"col-12 col-md-6"},a("form-control-text",{key:"39174c4b812462d1aa28824bca550e3f6e1d98b4",name:"email",label:"Email Address",defaultValue:null==e?void 0:e.email,errorText:this.errors.email,inputHandler:this.inputHandler})),a("div",{key:"ed0a2c52e4df0c43b2536dfd1ff3692a4e5716d9",class:"col-12 col-md-6"},a("form-control-number-masked",{key:"07bdcc1dd2e1473b64218eb28c8cdcf1cdce2a91",name:"phone",label:"Phone Number",defaultValue:null==e?void 0:e.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:f.US})),a("div",{key:"96092fd371ec82a8f8ebbf8bc4e3064768d4ad97",class:"col-12 col-md-4"},a("form-control-date",{key:"c24980f126c056aff139e897fdef9795905ea89b",name:"dob_full",label:"Birth Date",defaultValue:null==e?void 0:e.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:this.onDateOfBirthUpdate})),a("div",{key:"9d1695fa6e68bb4ae9a8184dcb5e15d588474ab8",class:"col-12 col-md-8"},a("form-control-number-masked",{key:"8d8a56c08fb06f1a54baf3ee3d6e31a684205290",name:"identification_number",label:this.identificationNumberLabel,defaultValue:null==e?void 0:e.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:b})),a("div",{key:"22fa5e16517e14ab031aa5e7e95ea77bd7b28986",class:"col-12"},a("justifi-identity-address-form",{key:"4a990de739a0ae6fbf1f6a621ff7c0078517e970",errors:this.errors.address,defaultValues:null==e?void 0:e.address,handleFormUpdate:this.onAddressFormUpdate})))))}},j=class{constructor(a){e(this,a),this.errors={},this.inputHandler=this.inputHandler.bind(this)}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e))),this.formController.values.subscribe((e=>this.legal_address=Object.assign({},e.legal_address)))}inputHandler(e,a){this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{legal_address:Object.assign(Object.assign({},this.formController.values.getValue().legal_address),{[e]:a})}))}render(){var e,l,i,s,c,o,r,n,f,b,u,h;const y=this.formController.getInitialValues().legal_address;return a(t,{key:"5b21d99717f9b24c0551c7a96acf68e53e7787bf"},a("fieldset",{key:"d63cbd20b2648405c50a819724e0f8cf556f7d26"},a("legend",{key:"c0acd14073f13f914015f40d39bf22fb58792434",part:d},"Business Legal Address"),a("div",{key:"ee4cee6bd662816f822ee209aeda5e9664f6a64d",class:"row gy-3"},a("div",{key:"86b258fd09e73cbd2475330419274732231f3871",class:"col-12"},a("form-control-text",{key:"8d898a9ae448f07932afe2d8cfc2314b92d9c597",name:"line1",label:"Legal Address",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.line1,errorText:null===(l=null===(e=this.errors)||void 0===e?void 0:e.legal_address)||void 0===l?void 0:l.line1})),a("div",{key:"1a50c4b86a754035f71efacd39721219fcd54d60",class:"col-12"},a("form-control-text",{key:"507b1451685e359a900f0bc7010ff39e3631daf2",name:"line2",label:"Address Line 2",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.line2,errorText:null===(s=null===(i=this.errors)||void 0===i?void 0:i.legal_address)||void 0===s?void 0:s.line2})),a("div",{key:"1446b4db5f86a3b18e3aceb78274ffe458dbd3db",class:"col-12"},a("form-control-text",{key:"e17e4bd95ad4290d18edde79cf05a6b3a105166c",name:"city",label:"City",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.city,errorText:null===(o=null===(c=this.errors)||void 0===c?void 0:c.legal_address)||void 0===o?void 0:o.city})),a("div",{key:"9b880203bad9e104e6d1299ff73c83cba46ab563",class:"col-12"},a("form-control-select",{key:"24e4df10f688c9a1b5f2af5217f03919bf7abec7",name:"state",label:"State",options:m,inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.state,errorText:null===(n=null===(r=this.errors)||void 0===r?void 0:r.legal_address)||void 0===n?void 0:n.state})),a("div",{key:"71f21b19602c268e3b6a839ce41ff9d4f8ffb8c4",class:"col-12"},a("form-control-text",{key:"ca71d3e21c5a0aea5367fa28ec1a2422ba9b1cf3",name:"postal_code",label:"Postal Code",inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.postal_code,errorText:null===(b=null===(f=this.errors)||void 0===f?void 0:f.legal_address)||void 0===b?void 0:b.postal_code,maxLength:5,keyDownHandler:v})),a("div",{key:"aaee0bf6a24ba182e002c1ffb49736fb622cde1f",class:"col-12"},a("form-control-select",{key:"2b6486771818e584dcc195c304e5a6e16850b4a9",name:"country",label:"Country",options:[{label:"United States",value:"USA"}],inputHandler:this.inputHandler,defaultValue:null==y?void 0:y.country,errorText:null===(h=null===(u=this.errors)||void 0===u?void 0:u.legal_address)||void 0===h?void 0:h.country,disabled:!0})))))}};export{y as form_alert,p as justifi_additional_questions,k as justifi_business_core_info,x as justifi_business_representative,j as justifi_legal_address_form}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as a}from"./p-CdEseavG.js";import{P as p}from"./p-8S_ROmnq.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{d as n}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as h,a as c}from"./p-D2muobcE.js";import{m}from"./p-DYGIC0QH.js";import{m as u,S as d}from"./p-DfV3dFDB.js";import{S as j}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{d as l}from"./p-D0Peuz-m.js";import"./p-YyotqiSL.js";import"./p-DdZLLkQ5.js";import"./p-Bgnhf5c9.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-au49QgoI.js";import"./p-hbWSMN3O.js";import"./p-xDbRW9xn.js";const f=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=l,this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new p};this.getPayouts=(({id:t,authToken:s,service:i})=>async({params:r,onSuccess:e,onError:a})=>{var p,m;try{const u=await i.fetchPayouts(t,s,r);if(u.error)return a({error:c(u.error),code:h(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);e({payouts:(null===(p=u.data)||void 0===p?void 0:p.map((t=>new n(t))))||[],pagingInfo:t})}}catch(t){const s=h(null==t?void 0:t.code);return a({error:t.message||t,code:s,severity:o.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({accountId:this.accountId,authToken:this.authToken,service:new d}))}render(){return i(j,{key:"fb8e3e21a4e5a0aa971a91eed4ef0b603dbd1b23"},i("payouts-list-core",{key:"c9fb97bd0d77d1989f346285cd5124121ad4ac83",getPayouts:this.getPayouts,getPayoutCSV:this.getPayoutCSV,getSubAccounts:this.getSubAccounts,"onError-event":this.handleOnError,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_payouts_list}
1
+ import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as a}from"./p-l8F_7Ihw.js";import{P as p}from"./p-8S_ROmnq.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{d as n}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as h,a as c}from"./p-D2muobcE.js";import{m}from"./p-DYGIC0QH.js";import{m as u,S as d}from"./p-DfV3dFDB.js";import{S as j}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{d as l}from"./p-D0Peuz-m.js";import"./p-Csfiax9X.js";import"./p-DdZLLkQ5.js";import"./p-Bgnhf5c9.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-au49QgoI.js";import"./p-hbWSMN3O.js";import"./p-xDbRW9xn.js";const f=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=l,this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new p};this.getPayouts=(({id:t,authToken:s,service:i})=>async({params:r,onSuccess:e,onError:a})=>{var p,m;try{const u=await i.fetchPayouts(t,s,r);if(u.error)return a({error:c(u.error),code:h(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);e({payouts:(null===(p=u.data)||void 0===p?void 0:p.map((t=>new n(t))))||[],pagingInfo:t})}}catch(t){const s=h(null==t?void 0:t.code);return a({error:t.message||t,code:s,severity:o.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({accountId:this.accountId,authToken:this.authToken,service:new d}))}render(){return i(j,{key:"fb8e3e21a4e5a0aa971a91eed4ef0b603dbd1b23"},i("payouts-list-core",{key:"c9fb97bd0d77d1989f346285cd5124121ad4ac83",getPayouts:this.getPayouts,getPayoutCSV:this.getPayoutCSV,getSubAccounts:this.getSubAccounts,"onError-event":this.handleOnError,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_payouts_list}
@@ -0,0 +1 @@
1
+ var e={name:"@justifi/webcomponents",version:"6.1.1"};export{e as p}
@@ -1 +1 @@
1
- import{r as e,c as t,h as a,H as i}from"./p-DOjVAAtq.js";import{c as s,F as c}from"./p-DiJD6Iqx.js";import{k as d,l as r,m as n,n as l,q as o,y as h}from"./p-PSJOKMWp.js";import{r as f,aw as b}from"./p-xDbRW9xn.js";import{S as m}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{S as p}from"./p-T2yENPvU.js";import{c as u,J as y}from"./p-CdEseavG.js";import{w as v,c as k}from"./p-a6tcNl_T.js";import{P as g}from"./p-DCIW8z1f.js";import{H as j}from"./p-BoQ6_4Ks.js";import{n as _}from"./p-BnjCmwMr.js";import{S as w}from"./p-BX8GieXu.js";import{B as x}from"./p-C9EQ459H.js";import{c as V}from"./p-DGsXKF67.js";import"./p-BFTU3MAI.js";import"./p-yH3TC3ZQ.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-YyotqiSL.js";import"./p-DdZLLkQ5.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-DdMxswn1.js";const C=class{constructor(a){e(this,a),this.radioClick=t(this,"radio-click"),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return a(m,{key:"b0501b66bcfdd697d88c01835b8f97fb2c0861ab"},a("div",{key:"ada4dda7868086b1ea4cadd6c8824f87d3cb2301",class:`radio-list-item p-3 ${this.class||""}`,part:f,onClick:this.handleClick,hidden:this.hidden},a("form-control-radio",{key:"72c6d07dd2a664ca6bd2be9b446584d7344bc2b0",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},H=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new c(s({name:h.required("Enter full name"),address_line1:o.nullable(),address_line2:l.nullable(),address_city:n.nullable(),address_state:r.nullable(),address_postal_code:d.nullable()}))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const e=this.formController.getInitialValues();return a(m,{key:"2429d26c0338ec1732337718ca4e7693f30a0f8a"},a("div",{key:"774911ce7d594bc1f44c15060136356acc349cbb",part:b,class:"mt-4"},a("form",{key:"5c93f5a6af372fdf24a20870ef6ae69f554efec4"},a("fieldset",{key:"38ac8adb2592b7799825d63c4a8e9bde61510cd0"},this.legend&&a("legend",{key:"abbce27bb8ae2ef564b8aeef755050fc096cb81f"},this.legend),a("div",{key:"5a0350fe7f635600d746f1f3979757a045cc09f0",class:"row gy-3"},a("div",{key:"71aac995514b7fea7254204df825eb8b381e21c7",class:"col-12"},a("form-control-text",{key:"f33d26eddfc9f3d307e05a48afec9472213b2822",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})))))))}},O=e=>{const{isReady:t}=e;return t?null:a("div",{class:"container-fluid p-0"},a("div",{class:"row mb-3"},a("div",{class:"col-12 align-content-end"},a(p,{height:"18px",width:"120px"}),a(p,{height:"36px"}))),a("div",{class:"row"},a("div",{class:"col-12 align-content-end"},a(p,{height:"18px",width:"110px"}),a(p,{height:"36px"}))))},L=class{constructor(t){e(this,t),this.isReady=!1}async componentWillLoad(){await v(),this.iframeOrigin=k.iframeOrigin,u(),this.analytics=new y(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.accountNumberIframeElement.validate(),t=await this.routingNumberIframeElement.validate();return e&&t}async tokenize({clientId:e,paymentMethodMetadata:t,account:a}){return this.accountNumberIframeElement.tokenize(e,t,a)}render(){return a(m,{key:"a2fd28c8b8202e0d702d02761cbcf3f568298265"},a(O,{key:"6777d110d3ccf3a688a763687c7087a3520643ac",isReady:this.isReady}),a("hidden-input",{key:"513e1cdaaf464a741d4312a6d359c4af665e0ade"}),a("div",{key:"2b4e473c7bb062a78148537d2cad02caf503330d",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},a("div",{key:"e706151f3e04835efab49fc0fb7a48f4657ab2c4",class:"row mb-3"},a("iframe-input",{key:"a70e0deac68d04f9ffa37790c33d801cfce8dc46",inputId:"accountNumber",ref:e=>this.accountNumberIframeElement=e,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),a("div",{key:"3f488f86388b2fc797c49ddc81c7de3a815ca74f",class:"row"},a("iframe-input",{key:"a09d3cec373c5bab5b38ebc090724178e65d2de2",inputId:"routingNumber",ref:e=>this.routingNumberIframeElement=e,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},N=class{constructor(t){e(this,t)}get showSimpleCardBillingForm(){return this.paymentMethodType===g.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===g.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var e;return null===(e=this.selectedFormRef)||void 0===e?void 0:e.getValues()}async fill(e){var t;null===(t=this.selectedFormRef)||void 0===t||t.fill(e)}async validate(){var e;return null===(e=this.selectedFormRef)||void 0===e?void 0:e.validate()}render(){return a(i,null,a(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:e=>this.selectedFormRef=e}))}},D=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new c(s({name:h.required("Enter full name"),address_line1:o.required("Enter street address"),address_line2:l.nullable(),address_city:n.required("Enter city"),address_state:r.required("Select state"),address_postal_code:d.required("Enter postal code")})),this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){if(!this.formController)return null;const e=this.formController.getInitialValues();return a(m,null,a("div",{part:b,class:"mt-4"},a(j,{text:"Billing address",class:"fs-6 fw-bold lh-lg mb-4"}),a("form",null,a("fieldset",null,this.legend&&a("legend",null,this.legend),a("div",{class:"row gy-3"},a("div",{class:"col-12"},a("form-control-text",{name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),a("div",{class:"col-12"},a("form-control-text",{name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),a("div",{class:"col-12"},a("form-control-text",{name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),a("div",{class:"col-12"},a("form-control-text",{name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),a("div",{class:"col-12"},a("form-control-select",{name:"address_state",label:"State",options:w,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),a("div",{class:"col-12"},a("form-control-text",{name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:_})))))))}},B=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return a(m,{key:"7c146b9ccaf8c4c37adde6c8af054dc4796d78bd"},a(x,{key:"879d05664b808abcbc32a38bc98fcd673dba0dea",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},M=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new c(s({name:h.nullable(),address_line1:o.nullable(),address_line2:l.nullable(),address_city:n.nullable(),address_state:r.nullable(),address_postal_code:d.required("Enter postal code")}))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const e=this.formController.getInitialValues();return a(m,{key:"2523873a34180694357ab780bd4b9768f9ea267d"},a("div",{key:"30204a976bba8a843830a905cec86d5aaf486f30",part:b},a("form",{key:"479e65b39fbecc80ba6281648bd390c4cd2a688e"},a("fieldset",{key:"93613aa83561aaba46efff4e6d64e240e1ddbc84"},this.legend&&a("legend",{key:"4d6da7c78c5b1a84bc4b37dfca80d9c7f0be462f"},this.legend),a("div",{key:"11259470415c62c15c0ef9217f91f4d6b5c8651b",class:"row gy-3"},a("div",{key:"2b85b5b820991faee8d8b14c121a69ab4974da98",class:"col-12"},a("form-control-text",{key:"d7632e0d32832491bfdf911ae45e67efe0ec6555",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:_})))))))}},S=e=>{const{isReady:t}=e;return t?null:a("div",{class:"container-fluid p-0"},a("div",{class:"mb-3"},a(p,{height:"18px",width:"100px"}),a(p,{height:"36px"})),a("div",{class:"row"},a("div",{class:"col-4 align-content-end"},a(p,{height:"18px",width:"80px"}),a(p,{height:"36px"})),a("div",{class:"col-4 align-content-end"},a(p,{height:"36px"})),a("div",{class:"col-4 align-content-end"},a(p,{height:"18px",width:"30px"}),a(p,{height:"36px"}))))},I=class{constructor(t){e(this,t),this.isReady=!1}async componentWillLoad(){await v(),this.iframeOrigin=k.iframeOrigin,u(),this.analytics=new y(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.cardNumberIframeElement.validate(),t=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),i=await this.cvvIframeElement.validate();return e&&t&&a&&i}async tokenize({clientId:e,paymentMethodMetadata:t,account:a}){return this.cardNumberIframeElement.tokenize(e,t,a)}render(){return a(m,{key:"64d9bda2ce54aa06788509ae294bcb1eefdb173a"},a(S,{key:"a1f233464393512652fc37a31b769bb9f48f3797",isReady:this.isReady}),a("hidden-input",{key:"4405ec6e9a510f670a137d33c83a5ad38a19a0aa"}),a("div",{key:"e704d33d8b3cbcd55798afb537b2b16d37d0077d",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},a("div",{key:"c519dafa0657af1372836a2a30301849f2e422b3",class:"mb-3"},a("iframe-input",{key:"6c6a0154ed62e0e684784ff0f327e3bc282da10c",inputId:"cardNumber",ref:e=>this.cardNumberIframeElement=e,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),a("div",{key:"7efcb6e9fed504ea8f0470f55b8c48b7d82b537b",class:"row"},a("div",{key:"e216e57f82d04325cedeca9f3945285ab8675c7d",class:"col-4 align-content-end"},a("iframe-input",{key:"c3ffef01705152180c66adaf482e67a1d2f114e9",inputId:"expirationMonth",ref:e=>this.expirationMonthIframeElement=e,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),a("div",{key:"97666cb9d9e4b272c033913527c4b6a60b6067c5",class:"col-4 align-content-end"},a("iframe-input",{key:"4d2f7f56f2a0d5717776c6ef164eef5f7dbc4d8d",inputId:"expirationYear",ref:e=>this.expirationYearIframeElement=e,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),a("div",{key:"ecc6fff75106b265a7cb00febef40a7b14651a0a",class:"col-4 align-content-end"},a("iframe-input",{key:"9a756344f1d47f69c0702b57d15d66a658b57e3d",inputId:"CVV",ref:e=>this.cvvIframeElement=e,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},P=class{constructor(a){e(this,a),this.checkboxChanged=t(this,"checkboxChanged"),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(e,t)=>{this.isChecked=t,V.savePaymentMethod=t,this.checkboxChanged.emit(this.isChecked)}}render(){return a(m,{key:"9aa9ce812c0cb2fdc809c47060ed150903ad7cd5"},a("form-control-checkbox",{key:"596bc9a145e363c751c8610f4b9f23ad31dab299",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{H as justifi_bank_account_billing_form_simple,L as justifi_bank_account_form,N as justifi_billing_form,D as justifi_billing_form_full,B as justifi_button,M as justifi_card_billing_form_simple,I as justifi_card_form,C as justifi_radio_list_item,P as justifi_save_new_payment_method}
1
+ import{r as e,c as t,h as a,H as i}from"./p-DOjVAAtq.js";import{c as s,F as d}from"./p-DiJD6Iqx.js";import{k as r,l as c,m as n,n as l,q as o,y as h}from"./p-PSJOKMWp.js";import{r as f,aw as b}from"./p-xDbRW9xn.js";import{S as m}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{S as p}from"./p-T2yENPvU.js";import{c as u,J as y}from"./p-l8F_7Ihw.js";import{w as v,c as k}from"./p-a6tcNl_T.js";import{P as g}from"./p-DCIW8z1f.js";import{H as _}from"./p-BoQ6_4Ks.js";import{n as j}from"./p-BnjCmwMr.js";import{S as w}from"./p-BX8GieXu.js";import{B as x}from"./p-C9EQ459H.js";import{c as V}from"./p-DGsXKF67.js";import"./p-BFTU3MAI.js";import"./p-yH3TC3ZQ.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-Csfiax9X.js";import"./p-DdZLLkQ5.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-DdMxswn1.js";const C=class{constructor(a){e(this,a),this.radioClick=t(this,"radio-click"),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return a(m,{key:"1ae40f787970160e38b72f917bda96f480d2a890"},a("div",{key:"2130596c8294cc38365e6126806735da0f93ef4a",class:`radio-list-item p-3 ${this.class||""}`,part:f,onClick:this.handleClick,hidden:this.hidden},a("form-control-radio",{key:"7d5524f518430f2bfd1c9863f354318929353cfb",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},H=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new d(s({name:h.required("Enter full name"),address_line1:o.nullable(),address_line2:l.nullable(),address_city:n.nullable(),address_state:c.nullable(),address_postal_code:r.nullable()}))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const e=this.formController.getInitialValues();return a(m,{key:"fc6e23e6f8b64b5635dbeea93b9d5fe261dc772c"},a("div",{key:"05b37c65fe24ddcb546e204350996976f5a53eea",part:b,class:"mt-4"},a("form",{key:"b02df8adf96ac298b15bfb744177524f0c067254"},a("fieldset",{key:"83d292caaa4322fbf151bf5bdac007ea13ea0b7e"},this.legend&&a("legend",{key:"bf956b7714776d01869e4bf740b5ee75d758a2cc"},this.legend),a("div",{key:"7095362ffbba89a5b6396921e8c5c05d144a9a5b",class:"row gy-3"},a("div",{key:"36dc450d4411e5755cff8b76fceba7e7cff516c8",class:"col-12"},a("form-control-text",{key:"ea52769979280cde0854cbf9fe12fa4abe40b769",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})))))))}},O=e=>{const{isReady:t}=e;return t?null:a("div",{class:"container-fluid p-0"},a("div",{class:"row mb-3"},a("div",{class:"col-12 align-content-end"},a(p,{height:"18px",width:"120px"}),a(p,{height:"36px"}))),a("div",{class:"row"},a("div",{class:"col-12 align-content-end"},a(p,{height:"18px",width:"110px"}),a(p,{height:"36px"}))))},L=class{constructor(t){e(this,t),this.isReady=!1}async componentWillLoad(){await v(),this.iframeOrigin=k.iframeOrigin,u(),this.analytics=new y(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.accountNumberIframeElement.validate(),t=await this.routingNumberIframeElement.validate();return e&&t}async tokenize({clientId:e,paymentMethodMetadata:t,account:a}){return this.accountNumberIframeElement.tokenize(e,t,a)}render(){return a(m,{key:"a2fd28c8b8202e0d702d02761cbcf3f568298265"},a(O,{key:"6777d110d3ccf3a688a763687c7087a3520643ac",isReady:this.isReady}),a("hidden-input",{key:"513e1cdaaf464a741d4312a6d359c4af665e0ade"}),a("div",{key:"2b4e473c7bb062a78148537d2cad02caf503330d",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},a("div",{key:"e706151f3e04835efab49fc0fb7a48f4657ab2c4",class:"row mb-3"},a("iframe-input",{key:"a70e0deac68d04f9ffa37790c33d801cfce8dc46",inputId:"accountNumber",ref:e=>this.accountNumberIframeElement=e,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),a("div",{key:"3f488f86388b2fc797c49ddc81c7de3a815ca74f",class:"row"},a("iframe-input",{key:"a09d3cec373c5bab5b38ebc090724178e65d2de2",inputId:"routingNumber",ref:e=>this.routingNumberIframeElement=e,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},N=class{constructor(t){e(this,t)}get showSimpleCardBillingForm(){return this.paymentMethodType===g.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===g.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var e;return null===(e=this.selectedFormRef)||void 0===e?void 0:e.getValues()}async fill(e){var t;null===(t=this.selectedFormRef)||void 0===t||t.fill(e)}async validate(){var e;return null===(e=this.selectedFormRef)||void 0===e?void 0:e.validate()}render(){return a(i,null,a(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:e=>this.selectedFormRef=e}))}},D=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new d(s({name:h.required("Enter full name"),address_line1:o.required("Enter street address"),address_line2:l.nullable(),address_city:n.required("Enter city"),address_state:c.required("Select state"),address_postal_code:r.required("Enter postal code")})),this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){if(!this.formController)return null;const e=this.formController.getInitialValues();return a(m,null,a("div",{part:b,class:"mt-4"},a(_,{text:"Billing address",class:"fs-6 fw-bold lh-lg mb-4"}),a("form",null,a("fieldset",null,this.legend&&a("legend",null,this.legend),a("div",{class:"row gy-3"},a("div",{class:"col-12"},a("form-control-text",{name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),a("div",{class:"col-12"},a("form-control-text",{name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),a("div",{class:"col-12"},a("form-control-text",{name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),a("div",{class:"col-12"},a("form-control-text",{name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),a("div",{class:"col-12"},a("form-control-select",{name:"address_state",label:"State",options:w,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),a("div",{class:"col-12"},a("form-control-text",{name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:j})))))))}},B=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return a(m,{key:"7c146b9ccaf8c4c37adde6c8af054dc4796d78bd"},a(x,{key:"879d05664b808abcbc32a38bc98fcd673dba0dea",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},I=class{constructor(t){e(this,t),this.errors={},this.inputHandler=(e,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:t}))}}componentWillLoad(){this.formController=new d(s({name:h.nullable(),address_line1:o.nullable(),address_line2:l.nullable(),address_city:n.nullable(),address_state:c.nullable(),address_postal_code:r.required("Enter postal code")}))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate(),errors:this.formController.errors.getValue()}}render(){const e=this.formController.getInitialValues();return a(m,{key:"26fd30b96e63f0adac380f70fae5cb4b80d9b36f"},a("div",{key:"79558919d544889647d034bdc415f9b404d4a058",part:b},a("form",{key:"21b722098010050f4a22b1e3cc995090c50a9f74"},a("fieldset",{key:"f371a839f16363d8242a38469c78eba1759e46a7"},this.legend&&a("legend",{key:"45b9d4d5b0dd502f5ebca9c357cdf6b75a16f9e1"},this.legend),a("div",{key:"ae1c10a2bae0061dd2aa0645e7d1f8c8ed899444",class:"row gy-3"},a("div",{key:"cd99d74f2803336bd0b25c7a962ef95fa66079ba",class:"col-12"},a("form-control-text",{key:"6ac34b703ae83a9e6c4c86b3c239795c5a7d0d57",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:j})))))))}},M=e=>{const{isReady:t}=e;return t?null:a("div",{class:"container-fluid p-0"},a("div",{class:"mb-3"},a(p,{height:"18px",width:"100px"}),a(p,{height:"36px"})),a("div",{class:"row"},a("div",{class:"col-4 align-content-end"},a(p,{height:"18px",width:"80px"}),a(p,{height:"36px"})),a("div",{class:"col-4 align-content-end"},a(p,{height:"36px"})),a("div",{class:"col-4 align-content-end"},a(p,{height:"18px",width:"30px"}),a(p,{height:"36px"}))))},S=class{constructor(t){e(this,t),this.isReady=!1}async componentWillLoad(){await v(),this.iframeOrigin=k.iframeOrigin,u(),this.analytics=new y(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((e=>new Promise((t=>{e.addEventListener("iframeLoaded",(()=>{t()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.cardNumberIframeElement.validate(),t=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),i=await this.cvvIframeElement.validate();return e&&t&&a&&i}async tokenize({clientId:e,paymentMethodMetadata:t,account:a}){return this.cardNumberIframeElement.tokenize(e,t,a)}render(){return a(m,{key:"64d9bda2ce54aa06788509ae294bcb1eefdb173a"},a(M,{key:"a1f233464393512652fc37a31b769bb9f48f3797",isReady:this.isReady}),a("hidden-input",{key:"4405ec6e9a510f670a137d33c83a5ad38a19a0aa"}),a("div",{key:"e704d33d8b3cbcd55798afb537b2b16d37d0077d",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},a("div",{key:"c519dafa0657af1372836a2a30301849f2e422b3",class:"mb-3"},a("iframe-input",{key:"6c6a0154ed62e0e684784ff0f327e3bc282da10c",inputId:"cardNumber",ref:e=>this.cardNumberIframeElement=e,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),a("div",{key:"7efcb6e9fed504ea8f0470f55b8c48b7d82b537b",class:"row"},a("div",{key:"e216e57f82d04325cedeca9f3945285ab8675c7d",class:"col-4 align-content-end"},a("iframe-input",{key:"c3ffef01705152180c66adaf482e67a1d2f114e9",inputId:"expirationMonth",ref:e=>this.expirationMonthIframeElement=e,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),a("div",{key:"97666cb9d9e4b272c033913527c4b6a60b6067c5",class:"col-4 align-content-end"},a("iframe-input",{key:"4d2f7f56f2a0d5717776c6ef164eef5f7dbc4d8d",inputId:"expirationYear",ref:e=>this.expirationYearIframeElement=e,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),a("div",{key:"ecc6fff75106b265a7cb00febef40a7b14651a0a",class:"col-4 align-content-end"},a("iframe-input",{key:"9a756344f1d47f69c0702b57d15d66a658b57e3d",inputId:"CVV",ref:e=>this.cvvIframeElement=e,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},P=class{constructor(a){e(this,a),this.checkboxChanged=t(this,"checkboxChanged"),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(e,t)=>{this.isChecked=t,V.savePaymentMethod=t,this.checkboxChanged.emit(this.isChecked)}}render(){return a(m,{key:"04ed1491d4f5ca3e03a8a1f7a46dff5a0eb888de"},a("form-control-checkbox",{key:"7901643960e9d5d26c5916fb6e06601a6b59906a",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{H as justifi_bank_account_billing_form_simple,L as justifi_bank_account_form,N as justifi_billing_form,D as justifi_billing_form_full,B as justifi_button,I as justifi_card_billing_form_simple,S as justifi_card_form,C as justifi_radio_list_item,P as justifi_save_new_payment_method}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-CdEseavG.js";import{D as a}from"./p-BH0Xfn-F.js";import{g as n,a as h}from"./p-D2muobcE.js";import{D as c}from"./p-C8k7a6D-.js";import"./p-YyotqiSL.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const d=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new p(this),this.initializeGetDispute()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:s,service:i})=>async({onSuccess:r,onError:o})=>{var p;try{const c=await i.fetchDispute(t,s);if(c.error)return o({error:h(c.error),code:n(null===(p=c.error)||void 0===p?void 0:p.code),severity:e.ERROR});{const t=Object.assign({},c.page_info);r({dispute:new a(c.data),pagingInfo:t})}}catch(t){const s=n(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new c}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return i("justifi-dispute-management-core",{key:"f1bd67d5ad60de2ad584c8440cc71c3ad6453429",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_dispute_management}
1
+ import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-l8F_7Ihw.js";import{D as a}from"./p-BH0Xfn-F.js";import{g as n,a as h}from"./p-D2muobcE.js";import{D as c}from"./p-C8k7a6D-.js";import"./p-Csfiax9X.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const d=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new p(this),this.initializeGetDispute()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:s,service:i})=>async({onSuccess:r,onError:o})=>{var p;try{const c=await i.fetchDispute(t,s);if(c.error)return o({error:h(c.error),code:n(null===(p=c.error)||void 0===p?void 0:p.code),severity:e.ERROR});{const t=Object.assign({},c.page_info);r({dispute:new a(c.data),pagingInfo:t})}}catch(t){const s=n(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new c}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return i("justifi-dispute-management-core",{key:"f1bd67d5ad60de2ad584c8440cc71c3ad6453429",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_dispute_management}
@@ -0,0 +1 @@
1
+ import{h as t,r as e,c as a}from"./p-DOjVAAtq.js";import{c as i}from"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as s,a as o}from"./p-Cjcsf8ku.js";import{h as r}from"./p-C98BC5W5.js";import{p as c}from"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as n,J as h}from"./p-l8F_7Ihw.js";import{g as p,a as d}from"./p-D2muobcE.js";import{P as l}from"./p-8S_ROmnq.js";import{T as f,l as u,a as m,b,c as y,d as _,e as w,f as T,g as j,h as v,i as g,j as k,k as C}from"./p-C0wTyoTh.js";import{S as D}from"./p-BhCH9S0e.js";import{T as S}from"./p-CZfYo5-1.js";import{a as P}from"./p-Bgnhf5c9.js";import{S as I,T as q}from"./p-xDbRW9xn.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-Csfiax9X.js";import"./p-DdZLLkQ5.js";import"./p-h5pyZngT.js";const x={id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of each transaction"},"ID"),account_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the account associated with each transaction"},"Account ID"),payout_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the payout associated with each transaction"},"Payout ID"),financial_transaction_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),amount:()=>t("th",{part:I,scope:"col",title:"The dollar amount of each transaction"},"Amount"),fee:()=>t("th",{part:I,scope:"col",title:"The fee associated with each transaction"},"Fee"),net:()=>t("th",{part:I,scope:"col",title:"The net amount of each transaction"},"Net"),currency:()=>t("th",{part:I,scope:"col",title:"The currency of each transaction"},"Currency"),description:()=>t("th",{part:I,scope:"col",title:"The description of each transaction"},"Description"),source_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),txn_type:()=>t("th",{part:I,scope:"col",title:"The type of each transaction"},"Type"),created_at:()=>t("th",{part:I,scope:"col",title:"The date and time each transaction was made"},"Processed On"),available_on:()=>t("th",{part:I,scope:"col",title:"The date and time each transaction will be available"},"Available On"),updated_at:()=>t("th",{part:I,scope:"col",title:"The date and time each transaction was last updated"},"Updated On")},O={fee:"Fee",payment:"Payment",payout:"Payout",seller_payment_refund:"Seller Payment Refund",dispute_amount_collected:"Dispute Amount Collected",dispute_fee_collected:"Dispute Fee Collected",seller_payment:"Seller Payment",transfer:"Transfer",partner_platform_proceeds_credit:"Partner Platform Proceeds Credit"},A={id:e=>t("td",{part:q(e.id)},e.id),account_id:e=>t("td",{part:q(e.account_id)},e.account_id),payout_id:e=>t("td",{part:q(e.payout_id)},e.payout_id),financial_transaction_id:e=>t("td",{part:q(e.financial_transaction_id)},e.financial_transaction_id),amount:e=>t("td",{part:q(e.amount)},e.formattedPaymentAmount(e.amount)),fee:e=>t("td",{part:q(e.fee)},e.formattedPaymentAmount(e.fee)),net:e=>t("td",{part:q(e.net)},e.formattedPaymentAmount(e.net)),currency:e=>t("td",{part:q(e.currency)},e.currency),description:e=>t("td",{part:q(e.description)},e.description),source_id:e=>t("td",{part:q(e.source_id)},e.source_id),txn_type:e=>t("td",{part:q(e.txn_type)},O[e.txn_type]),created_at:e=>t("td",{part:q(e.created_at)},t("div",{class:"fw-bold"},P(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},P(e.created_at,{showTime:!0}))),available_on:e=>t("td",{part:q(e.available_on)},t("div",{class:"fw-bold"},P(e.available_on,{showDisplayDate:!0})),t("div",{class:"fw-bold"},P(e.available_on,{showTime:!0}))),updated_at:e=>t("td",{part:q(e.updated_at)},t("div",{class:"fw-bold"},P(e.updated_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},P(e.updated_at,{showTime:!0})))},E=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=c,this.pagingParams={},this.columns="created_at,txn_type,description,amount,fee,net",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:S.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:S.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:S.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,x,A),n(),this.analytics=new h(this),this.initializeApi()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeApi()}handleError(t,e,a){this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:e,severity:a})}initializeApi(){this.payoutId&&this.authToken?(({accountId:t,authToken:e,service:a})=>async({params:i,onSuccess:o,onError:c,final:n})=>{var h;try{const n=await a.fetchPayoutTransactions(t,e,i);n.error?c({error:d(n.error),code:p(null===(h=n.error)||void 0===h?void 0:h.code),severity:s.ERROR}):o({balanceTransactions:n.data.map((t=>new r(t))),pagingInfo:Object.assign({},n.page_info)})}catch(t){const e=p(null==t?void 0:t.code);c({error:d(t),code:e,severity:s.ERROR})}finally{n()}})({accountId:i.accountId,authToken:this.authToken,service:new l})({params:this.requestParams,onSuccess:({balanceTransactions:t,pagingInfo:e})=>{this.balanceTransactions=t,this.paging=e,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t.message,this.handleError(t,e,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payout-id and auth-token props are required",this.handleError(o.MISSING_PROPS,this.errorMessage,s.ERROR))}get entityId(){return this.balanceTransactions.map((t=>t.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}get requestParams(){return Object.assign({payout_id:this.payoutId,limit:"15"},this.pagingParams)}render(){return t(D,{key:"a0ff80867bc3c0bf198165229f693d7748ffc7a4"},t(u,{key:"779cc5602f6221e0f704484bf962b72b266d95f8"},t(m,{key:"7b4b56e9712533ba2b50a875d282ef4bd5efdcaf"},t(b,{key:"8ecd93d56bdbdb1417b260dd013315b21958f363"},t(y,{key:"9fa0fea238a9f76c71d5b8fc5443ca2c9e56b13b"},this.transactionsTable.columnData.map((t=>t)))),t(_,{key:"f7d94388eddaf848e4868005e985a1158577c70f"},t(w,{key:"c83742e9e3ecbcdaba29f2aa121ec4c101a55632",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(T,{key:"fa0404328357e11527cff2c3eb15536ee458557b",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(j,{key:"71add0ef95310fd49e403d65c2a23ea8f73c71b6",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(v,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(g,{key:"073af8dce5dabb2db604ae50e6ace6a4ace18e6f"},t(k,{key:"3f3906a106b3c41311a0e1309aea779e865bf0f5"},t(C,{key:"85b46ef2a297aab3a450d49dd086ec6e7e1ab027",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"548131521a5fcf1562b286097635f5f62414a28c",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],payoutId:["propChanged"],authToken:["propChanged"]}}};export{E as justifi_payout_transactions_list}
@@ -1 +1 @@
1
- import{r as e,c as t,h as s}from"./p-DOjVAAtq.js";import{c as i,d as r,e as a}from"./p-5aA7gjr5.js";import{I as o}from"./p-DQZ5VHTZ.js";import{F as d}from"./p-DiJD6Iqx.js";import{O as h}from"./p-BlJnA265.js";import{i as n}from"./p-tYuXMkCd.js";import{B as c}from"./p-C9EQ459H.js";import{W as l}from"./p-xDbRW9xn.js";import"./p-CZfYo5-1.js";import{B as f}from"./p-XYgDHrVL.js";import{S as b,P as m}from"./p-B-iV5cYd.js";import{u,a as p,b as y}from"./p-1ydcg9ti.js";import"./p-Cjcsf8ku.js";import"./p-D2muobcE.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BFTU3MAI.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-PSJOKMWp.js";import"./p-yH3TC3ZQ.js";const k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event")}async validate(){return this.coreComponent.validate()}async submit(){return this.coreComponent.submit()}async validateAndSubmit({onSuccess:e}){this.coreComponent.validateAndSubmit({onSuccess:e})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&(this.getOwner=i({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.patchOwner=r({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.postOwner=a({authToken:this.authToken,service:new o}))}render(){return s("owner-form-core",{key:"a918d86ea220a66e69950919593791f3fec0f283",ownerId:this.ownerId,businessId:this.businessId,getOwner:this.getOwner,patchOwner:this.patchOwner,postOwner:this.postOwner,allowOptionalFields:this.allowOptionalFields,removeOwner:this.removeOwner,newFormOpen:this.newFormOpen,ownersLength:this.ownersLength,ref:e=>this.coreComponent=e})}},j=class{loadingWatcher(){this.formLoading.emit(this.isLoading)}constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.formLoading=t(this,"formLoading"),this.ownerSubmitted=t(this,"ownerSubmitted"),this.isLoading=!1,this.errors={},this.owner={},this.getData=()=>{this.isLoading=!0,this.getOwner({onSuccess:e=>{this.instantiateOwner(e.data)},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({message:e,errorCode:t,severity:s})},final:()=>this.isLoading=!1})},this.sendData=()=>(this.isLoading=!0,new Promise((e=>{this.ownerId?this.patchOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1}):this.postOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1})}))),this.instantiateOwner=async e=>{this.owner=Object.assign({},new h(e)),await this.formController.setInitialValues(this.owner)},this.handleAddOwner=()=>{this.clickEvent.emit({name:this.ownerId?f.updateOwner:f.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:f.removeOwner})},this.validate=this.validate.bind(this),this.submit=this.submit.bind(this),this.validateAndSubmit=this.validateAndSubmit.bind(this)}async returnOwnerData(){return this.ownerId}async validate(){return this.formController.validate()}async submit(){if(await this.validate())return this.sendData()}async validateAndSubmit(e){e.preventDefault(),await this.validate()&&this.submit()}get payload(){let e=new h(this.formController.values.getValue()).payload;return this.ownerId?e:Object.assign(Object.assign({},e),{business_id:this.businessId})}get formTitle(){return this.ownerId?"Edit Business Owner":"Add Business Owner"}get submitButtonText(){return this.ownerId?"Update":"Add"}get showRemoveButton(){return!(this.ownersLength<=1)&&(!(this.ownerId||!this.newFormOpen)||!(!this.ownerId||this.newFormOpen)||void 0)}componentWillLoad(){this.formController=new d(n("owner",this.allowOptionalFields)),this.ownerId?this.getData():this.instantiateOwner({})}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e)))}render(){return s("form",{key:"08673bb0eb61a77b3ed37702606808f28caf507b",onSubmit:this.validateAndSubmit},s("fieldset",{key:"73e9707a99d56c7eca7737fc02b77a9d69931ef6"},s("legend",{key:"3d85ec901c9051e30472623c740194e48cc60790",class:"fw-semibold fs-5",part:l},this.formTitle),s("br",{key:"a7256d1bfa79edd90c70eab491d533d2bcd07a94"}),s("div",{key:"b74744930ecd1ac1ef08d8e356d5eeb7f5417c39",class:"row gy-3"},s("owner-form-inputs",{key:"a9fdfe906615eb494f74001396b41a433fb5366b",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController}),s("div",{key:"32fe5564d5feb8056f2401a6dd219dae0d0d10b0",class:"d-flex gap-2 justify-content-start"},s(c,{key:"9e2c1d664b382260fb82c735454dbbf478e99fdd",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(c,{key:"db94849f699044848b46e87b285bd0ee30d66b92",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"9e62fbf6cb1b1d5fa8fc4b676a72cf4350058937"})))}static get watchers(){return{isLoading:["loadingWatcher"]}}},w=class{constructor(t){e(this,t),this.inputHandler=(e,t)=>{u(this.formController,{[e]:t})},this.onAddressFormUpdate=e=>{p(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))}}render(){return s("div",{key:"2f3679b3d4fb45dd55ada0d3752017c9ba94be9e",class:"row gy-3"},s("div",{key:"4ae3a6fbad22e94321940a46ea79bcc82049ba40",class:"col-12 col-md-8"},s("form-control-text",{key:"bad30c901a7341aabe09a20b9b075212092ed475",name:"name",label:"Full Name",defaultValue:this.ownerDefaultValue.name,errorText:this.errors.name,inputHandler:this.inputHandler})),s("div",{key:"025366d57d5ceb0932b105410f8948cc092d84f3",class:"col-12 col-md-4"},s("form-control-text",{key:"7c746f5b8fe06c71e800123b46ea40e701c675ef",name:"title",label:"Title",defaultValue:this.ownerDefaultValue.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),s("div",{key:"97808fe13be4a772d820f92003320e1b2d6dff5c",class:"col-12 col-md-6"},s("form-control-text",{key:"264e975df8cd9ca53cb05b60824055028839d3ca",name:"email",label:"Email Address",defaultValue:this.ownerDefaultValue.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{key:"3a045af74578f3bec4c66848cec5460a1588800d",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"17627d6bfc876106ec40e63dcb6a3fb1b7b7f009",name:"phone",label:"Phone Number",defaultValue:this.ownerDefaultValue.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:m.US})),s("div",{key:"394b0454272509ff5d99cd63e2f3d1f2f1d0dff1",class:"col-12 col-md-4"},s("form-control-date",{key:"b079e3422551e8be640d34461adbbbeb86f659b4",name:"dob_full",label:"Birth Date",defaultValue:this.ownerDefaultValue.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>y(e,this.formController),helpText:"Must be 18 or older."})),s("div",{key:"fdaf32d03ac0d562ecc6c14f552a891f7ab0e31f",class:"col-12 col-md-8"},s("form-control-number-masked",{key:"18c3a9019fb9d0abc8654d59b504bfba27ca9661",name:"identification_number",label:"SSN",defaultValue:this.ownerDefaultValue.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:b,helpText:"Enter your full Social Security Number. It is required for Federal OFAC check."})),s("div",{key:"5f5f2815471a5b4a7b18db1aba58597e429b425b",class:"col-12"},s("justifi-identity-address-form",{key:"663d4185f2a96a260b118e0e4a9437dbff3d1906",errors:this.errors.address,defaultValues:this.ownerDefaultValue.address,handleFormUpdate:this.onAddressFormUpdate})))}};export{k as justifi_owner_form,j as owner_form_core,w as owner_form_inputs}
1
+ import{r as e,c as t,h as s}from"./p-DOjVAAtq.js";import{c as i,d as r,e as a}from"./p-5aA7gjr5.js";import{I as o}from"./p-DQZ5VHTZ.js";import{F as d}from"./p-DiJD6Iqx.js";import{O as c}from"./p-BlJnA265.js";import{i as h}from"./p-tYuXMkCd.js";import{B as n}from"./p-C9EQ459H.js";import{W as f}from"./p-xDbRW9xn.js";import"./p-CZfYo5-1.js";import{B as l}from"./p-XYgDHrVL.js";import{S as m,P as b}from"./p-B-iV5cYd.js";import{u,a as p,b as y}from"./p-1ydcg9ti.js";import"./p-Cjcsf8ku.js";import"./p-D2muobcE.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BFTU3MAI.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-PSJOKMWp.js";import"./p-yH3TC3ZQ.js";const k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event")}async validate(){return this.coreComponent.validate()}async submit(){return this.coreComponent.submit()}async validateAndSubmit({onSuccess:e}){this.coreComponent.validateAndSubmit({onSuccess:e})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&(this.getOwner=i({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.patchOwner=r({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.postOwner=a({authToken:this.authToken,service:new o}))}render(){return s("owner-form-core",{key:"07ad7cd2bb38442dc591c9e3421223294690ee8c",ownerId:this.ownerId,businessId:this.businessId,getOwner:this.getOwner,patchOwner:this.patchOwner,postOwner:this.postOwner,allowOptionalFields:this.allowOptionalFields,removeOwner:this.removeOwner,newFormOpen:this.newFormOpen,ownersLength:this.ownersLength,ref:e=>this.coreComponent=e})}},j=class{loadingWatcher(){this.formLoading.emit(this.isLoading)}constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.formLoading=t(this,"formLoading"),this.ownerSubmitted=t(this,"ownerSubmitted"),this.isLoading=!1,this.errors={},this.owner={},this.getData=()=>{this.isLoading=!0,this.getOwner({onSuccess:e=>{this.instantiateOwner(e.data)},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({message:e,errorCode:t,severity:s})},final:()=>this.isLoading=!1})},this.sendData=()=>(this.isLoading=!0,new Promise((e=>{this.ownerId?this.patchOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1}):this.postOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1})}))),this.instantiateOwner=async e=>{this.owner=Object.assign({},new c(e)),await this.formController.setInitialValues(this.owner)},this.handleAddOwner=()=>{this.clickEvent.emit({name:this.ownerId?l.updateOwner:l.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:l.removeOwner})},this.validate=this.validate.bind(this),this.submit=this.submit.bind(this),this.validateAndSubmit=this.validateAndSubmit.bind(this)}async returnOwnerData(){return this.ownerId}async validate(){return this.formController.validate()}async submit(){if(await this.validate())return this.sendData()}async validateAndSubmit(e){e.preventDefault(),await this.validate()&&this.submit()}get payload(){let e=new c(this.formController.values.getValue()).payload;return this.ownerId?e:Object.assign(Object.assign({},e),{business_id:this.businessId})}get formTitle(){return this.ownerId?"Edit Business Owner":"Add Business Owner"}get submitButtonText(){return this.ownerId?"Update":"Add"}get showRemoveButton(){return!(this.ownersLength<=1)&&(!(this.ownerId||!this.newFormOpen)||!(!this.ownerId||this.newFormOpen)||void 0)}componentWillLoad(){this.formController=new d(h("owner",this.allowOptionalFields)),this.ownerId?this.getData():this.instantiateOwner({})}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e)))}render(){return s("form",{key:"570c20c1fdf79268e6c8193a393515c8602a3a44",onSubmit:this.validateAndSubmit},s("fieldset",{key:"f4f75a735438baef254d4578b779ca16e5080a41"},s("legend",{key:"dc0c83a7ada9f908afec56d7560f7d9d116baa40",class:"fw-semibold fs-5",part:f},this.formTitle),s("br",{key:"5d97c0b38073618aef80ff9576cd57ab0e70d44e"}),s("div",{key:"b15a207a4c4afc1249ce3b8a381e7b57ceb32e7a",class:"row gy-3"},s("owner-form-inputs",{key:"21bd3e9b00580e7293338ad746c189d19ac3d98e",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController}),s("div",{key:"b4653d9b78094b15bfba61e3a18ea3703dc53162",class:"d-flex gap-2 justify-content-start"},s(n,{key:"0328aa7af6e3c2f7ed8aa16724dedcb576bb9870",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(n,{key:"e42671667156149d5424243eef1d6675a3bd6506",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"ee7bf4cdb63cdc31df8b307ffb1772e5c0f0348c"})))}static get watchers(){return{isLoading:["loadingWatcher"]}}},w=class{constructor(t){e(this,t),this.inputHandler=(e,t)=>{u(this.formController,{[e]:t})},this.onAddressFormUpdate=e=>{p(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))}}render(){return s("div",{key:"86abe1713fdfd297e88c1fc1734fadb2c9eab966",class:"row gy-3"},s("div",{key:"63a03271f2a777d4cede3b0790e11c7f4108797f",class:"col-12 col-md-8"},s("form-control-text",{key:"b86dd9184dbf50e00e047a733ff708526e32d6dc",name:"name",label:"Full Name",defaultValue:this.ownerDefaultValue.name,errorText:this.errors.name,inputHandler:this.inputHandler})),s("div",{key:"c3850b7425ca0d8a118a6b78933f3a2fbe343124",class:"col-12 col-md-4"},s("form-control-text",{key:"f1f6e801eb36bcae5f2e51f8cd4ea9b7ed6a34a8",name:"title",label:"Title",defaultValue:this.ownerDefaultValue.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),s("div",{key:"b07a8a86dbdef296c9438953ef311ccae3aed23c",class:"col-12 col-md-6"},s("form-control-text",{key:"714ca04b0bf0e5ed1b116b8f4963ba12f7fd6b77",name:"email",label:"Email Address",defaultValue:this.ownerDefaultValue.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{key:"46c11c80bb58d0190ff05f1e87ba962443b07c59",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"6da40db9fb8b3e4f3a744cd0426f4e6436350594",name:"phone",label:"Phone Number",defaultValue:this.ownerDefaultValue.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:b.US})),s("div",{key:"0960ea2fb399d0098caeabf45347a89c74066f57",class:"col-12 col-md-4"},s("form-control-date",{key:"fe0891a3f42c093d70db1dd1d1a7e121ba3091c1",name:"dob_full",label:"Birth Date",defaultValue:this.ownerDefaultValue.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>y(e,this.formController),helpText:"Must be 18 or older."})),s("div",{key:"e7cbc519fa6f4fa5b03a0d0b69c7d7f1c42185ff",class:"col-12 col-md-8"},s("form-control-number-masked",{key:"cf2b280c1560bd1a9f80cf81c1543d41bd807233",name:"identification_number",label:"SSN",defaultValue:this.ownerDefaultValue.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:m,helpText:"Enter your full Social Security Number. It is required for Federal OFAC check."})),s("div",{key:"1755c849992bfd9f459b65b4cf7e967039fdbe27",class:"col-12"},s("justifi-identity-address-form",{key:"ac5372d4a9fad8ee3cfe2af20c11868e8753cc35",errors:this.errors.address,defaultValues:this.ownerDefaultValue.address,handleFormUpdate:this.onAddressFormUpdate})))}};export{k as justifi_owner_form,j as owner_form_core,w as owner_form_inputs}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import{c as e,J as n}from"./p-CdEseavG.js";import{T as a}from"./p-CCLgieAN.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{e as p}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m,S as d}from"./p-DfV3dFDB.js";import{S as u}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{d as l}from"./p-ClvhB3WW.js";import"./p-YyotqiSL.js";import"./p-DdZLLkQ5.js";import"./p-Bgnhf5c9.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-hbWSMN3O.js";import"./p-xDbRW9xn.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=l,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:s,service:i})=>async({params:o,onSuccess:e,onError:n})=>{var a,m;try{const d=await i.fetchTerminals(t,s,o);if(d.error)return n({error:h(d.error),code:c(null===(m=d.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},d.page_info);e({terminals:(null===(a=d.data)||void 0===a?void 0:a.map((t=>new p(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:r.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new a}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new d}))}render(){return i(u,{key:"33ad31c8b8748897664c91d3fc6349d76f276e9e"},i("terminals-list-core",{key:"dd16f1dd45b0c0d1d2f14469e4cc6f418b977ab7",getTerminals:this.getTerminals,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_terminals_list}
1
+ import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import{c as e,J as n}from"./p-l8F_7Ihw.js";import{T as a}from"./p-CCLgieAN.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{e as p}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m,S as d}from"./p-DfV3dFDB.js";import{S as l}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{d as u}from"./p-ClvhB3WW.js";import"./p-Csfiax9X.js";import"./p-DdZLLkQ5.js";import"./p-Bgnhf5c9.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-hbWSMN3O.js";import"./p-xDbRW9xn.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=u,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:s,service:i})=>async({params:o,onSuccess:e,onError:n})=>{var a,m;try{const d=await i.fetchTerminals(t,s,o);if(d.error)return n({error:h(d.error),code:c(null===(m=d.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},d.page_info);e({terminals:(null===(a=d.data)||void 0===a?void 0:a.map((t=>new p(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:r.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new a}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new d}))}render(){return i(l,{key:"33ad31c8b8748897664c91d3fc6349d76f276e9e"},i("terminals-list-core",{key:"dd16f1dd45b0c0d1d2f14469e4cc6f418b977ab7",getTerminals:this.getTerminals,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_terminals_list}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as a}from"./p-DOjVAAtq.js";import{I as e}from"./p-Ce_F4E0f.js";import{C as r}from"./p-B-iV5cYd.js";import{a3 as h,l as o,V as n,b as c,U as l,a as f}from"./p-xDbRW9xn.js";import{F as d}from"./p-D6BImiVi.js";import{F as m}from"./p-NAjz1Xfo.js";import"./p-CZfYo5-1.js";const p=class{constructor(i){t(this,i),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.imask=null,this.isFocused=!1,this.maskOptions=r.DECIMAL,this.initializeIMask=()=>{this.textInput&&(this.imask=e(this.textInput,this.maskOptions),this.imask.on("accept",(()=>{const t=this.imask.unmaskedValue;this.inputHandler(this.name,t),this.formControlInput.emit({name:this.name,value:t})})),this.textInput.addEventListener("blur",(()=>this.formControlBlur.emit())))},this.handleFormControlInput=t=>{const s=t.target.getAttribute("name");this.formControlInput.emit({name:s,value:this.imask.unmaskedValue})},this.updateInput=t=>{this.imask&&(this.imask.value=String(t))}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.initializeIMask(),this.updateInput(this.defaultValue)}disconnectedCallback(){var t;null===(t=this.imask)||void 0===t||t.destroy()}get inputPart(){let t=h;return this.errorText&&(t=c),this.disabled&&(t=l),this.isFocused&&(t=f),t}render(){return i(a,{key:"8378b6d06aeeb48d1e3efed4d16b22655e2c23ff"},i("div",{key:"cc432cb0a138c336def8b55ac06aa933407d38ef",class:"form-group d-flex flex-column"},i("label",{key:"08119d56a108275c4f25d28f7b8074ca134c3b72",part:o,class:"form-label",htmlFor:this.name},this.label),i("div",{key:"bcf621d3cae2636304185197cb8d3f40f3f0f173",class:"input-group"},i("span",{key:"3ee602416b555c9bf561abc4055f0a2485762551",class:"input-group-text",part:n},"$"),i("input",{key:"54c1257a97daae319f5c0ce7556638790e3f286b",ref:t=>this.textInput=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.inputPart,class:this.errorText?"form-control monetary is-invalid":"form-control monetary",type:"text",disabled:this.disabled})),i(d,{key:"b7458313a43d454ad8988f1e4548c7034a5d09d8",helpText:this.helpText,name:this.name}),i(m,{key:"8e59747949f4fa6697a3b7c083bcd6584d1f5411",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{p as form_control_monetary_provisioning}
1
+ import{r as t,c as s,h as e,H as i}from"./p-DOjVAAtq.js";import{I as a}from"./p-Ce_F4E0f.js";import{C as r}from"./p-B-iV5cYd.js";import{a3 as h,l as o,V as n,b as l,U as c,a as f}from"./p-xDbRW9xn.js";import{F as d}from"./p-D6BImiVi.js";import{F as m}from"./p-NAjz1Xfo.js";import"./p-CZfYo5-1.js";const p=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.imask=null,this.isFocused=!1,this.maskOptions=r.DECIMAL,this.initializeIMask=()=>{this.textInput&&(this.imask=a(this.textInput,this.maskOptions),this.imask.on("accept",(()=>{const t=this.imask.unmaskedValue;this.inputHandler(this.name,t),this.formControlInput.emit({name:this.name,value:t})})),this.textInput.addEventListener("blur",(()=>this.formControlBlur.emit())))},this.handleFormControlInput=t=>{const s=t.target.getAttribute("name");this.formControlInput.emit({name:s,value:this.imask.unmaskedValue})},this.updateInput=t=>{this.imask&&(this.imask.value=String(t))}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.initializeIMask(),this.updateInput(this.defaultValue)}disconnectedCallback(){var t;null===(t=this.imask)||void 0===t||t.destroy()}get inputPart(){let t=h;return this.errorText&&(t=l),this.disabled&&(t=c),this.isFocused&&(t=f),t}render(){return e(i,{key:"59e5e4d46e7d4ece898464d846505756611f6635"},e("div",{key:"e82201d6777584666ec5ca04ad9e02b83fa956c0",class:"form-group d-flex flex-column"},e("label",{key:"9bbb22bb201d3db07670e4f26521593ff229f583",part:o,class:"form-label",htmlFor:this.name},this.label),e("div",{key:"61909b4796f78e22d9e6508d9257cdf16220e675",class:"input-group"},e("span",{key:"152a4f1a6323e55bf6f48aa25353939569acc419",class:"input-group-text",part:n},"$"),e("input",{key:"cc8055c02a4ccb4f63553f45b5ded4ee3d8cf972",ref:t=>this.textInput=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.inputPart,class:this.errorText?"form-control monetary is-invalid":"form-control monetary",type:"text",disabled:this.disabled})),e(d,{key:"776dfb4a9d74342ba139dda6706af8e60b4700fc",helpText:this.helpText,name:this.name}),e(m,{key:"74e503b7e525aeeb994b1ae94941f07365d2460e",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{p as form_control_monetary_provisioning}
@@ -1 +1 @@
1
- import{h as t,r as s,c as e}from"./p-DOjVAAtq.js";import{c as r,a as i,F as o}from"./p-DiJD6Iqx.js";import{f as n}from"./p-Bgnhf5c9.js";import"./p-a6tcNl_T.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,k as m}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{B as h}from"./p-C9EQ459H.js";import{S as p}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-BjNuRWXK.js";import{m as d}from"./p-DWn9BiNn.js";import{c as f,J as j}from"./p-CdEseavG.js";import{g as v,a as y}from"./p-D2muobcE.js";import{A as b}from"./p-DdZLLkQ5.js";import{S as w}from"./p-T2yENPvU.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-xDbRW9xn.js";import"./p-YyotqiSL.js";const x=t=>{const s=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${n(s)}`,(function(t){return+t<=+s})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},C=t=>{if(t)return r({amount:x(t),description:i().optional(),reason:i().optional().oneOf([l.customerRequest,l.duplicate,l.fraudulent],"Select a reason")})},g=[{label:"Select a reason",value:""},{label:"Customer requested a refund",value:"customer_request"},{label:"Customer was double-charged",value:"duplicate"},{label:"Payment was reported as fraud",value:"fraudulent"}],A=b();class B{async postRefund(t,s,e,r){return A.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":s},body:r,authToken:e})}}const T=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),k=()=>t(p,null,t("div",{class:"row gap-5"},t(T,null),t(T,null),t(T,null))),D=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,s)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:s}))}}componentWillLoad(){f(),this.analytics=new j(this),this.initializeApi(),this.formController=new o(C())}handleError(t,s,e){this.errorEvent.emit({errorCode:t,message:s,severity:e})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(u.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",a.ERROR)}initializeFormController(){const t=this.refundPayload.amount,s=t?t.toString():"0";this.formController=new o(C(s)),this.formController.setInitialValues({amount:s}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?d({id:this.paymentId,authToken:this.authToken,service:new c})({onSuccess:({payment:t})=>{this.refundPayload=new m({amount:t.amount_refundable})},onError:({error:t,code:s,severity:e})=>{this.handleError(s,t,e)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(u.MISSING_PROPS,"Payment ID and Auth Token are required",a.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const s=(({authToken:t,accountId:s,paymentId:e,service:r})=>async({refundBody:i,onSuccess:o,onError:n,final:u})=>{var l;try{const u=await r.postRefund(e,s,t,i);if(u.error)return n({error:y(u.error),code:v(null===(l=u.error)||void 0===l?void 0:l.code),severity:a.ERROR});o(u)}catch(t){const s=v(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:a.ERROR})}finally{return u()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new B}),e=this.formController.values.getValue();return this.refundLoading=!0,new Promise((t=>{let r;s({refundBody:e,onSuccess:t=>{r=t},onError:({error:t,code:s,severity:e})=>{r=t,this.handleError(t,s,e)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,t(r.data)}})}))}render(){if(this.paymentLoading)return t(k,null);const s=this.formController.getInitialValues(),e=this.refundPayload.amount;return t(p,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:s.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:s.reason,inputHandler:this.inputHandler,options:g,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:s.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(h,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${n(+e)}`))))))}};export{D as justifi_refund_payment}
1
+ import{h as t,r as s,c as e}from"./p-DOjVAAtq.js";import{c as r,a as i,F as o}from"./p-DiJD6Iqx.js";import{f as n}from"./p-Bgnhf5c9.js";import"./p-a6tcNl_T.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,k as h}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{B as m}from"./p-C9EQ459H.js";import{S as p}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-BjNuRWXK.js";import{m as d}from"./p-DWn9BiNn.js";import{c as f,J as j}from"./p-l8F_7Ihw.js";import{g as v,a as y}from"./p-D2muobcE.js";import{A as b}from"./p-DdZLLkQ5.js";import{S as w}from"./p-T2yENPvU.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-xDbRW9xn.js";import"./p-Csfiax9X.js";const x=t=>{const s=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${n(s)}`,(function(t){return+t<=+s})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},C=t=>{if(t)return r({amount:x(t),description:i().optional(),reason:i().optional().oneOf([l.customerRequest,l.duplicate,l.fraudulent],"Select a reason")})},g=[{label:"Select a reason",value:""},{label:"Customer requested a refund",value:"customer_request"},{label:"Customer was double-charged",value:"duplicate"},{label:"Payment was reported as fraud",value:"fraudulent"}],A=b();class B{async postRefund(t,s,e,r){return A.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":s},body:r,authToken:e})}}const T=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),k=()=>t(p,null,t("div",{class:"row gap-5"},t(T,null),t(T,null),t(T,null))),D=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,s)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:s}))}}componentWillLoad(){f(),this.analytics=new j(this),this.initializeApi(),this.formController=new o(C())}handleError(t,s,e){this.errorEvent.emit({errorCode:t,message:s,severity:e})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(u.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",a.ERROR)}initializeFormController(){const t=this.refundPayload.amount,s=t?t.toString():"0";this.formController=new o(C(s)),this.formController.setInitialValues({amount:s}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?d({id:this.paymentId,authToken:this.authToken,service:new c})({onSuccess:({payment:t})=>{this.refundPayload=new h({amount:t.amount_refundable})},onError:({error:t,code:s,severity:e})=>{this.handleError(s,t,e)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(u.MISSING_PROPS,"Payment ID and Auth Token are required",a.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const s=(({authToken:t,accountId:s,paymentId:e,service:r})=>async({refundBody:i,onSuccess:o,onError:n,final:u})=>{var l;try{const u=await r.postRefund(e,s,t,i);if(u.error)return n({error:y(u.error),code:v(null===(l=u.error)||void 0===l?void 0:l.code),severity:a.ERROR});o(u)}catch(t){const s=v(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:a.ERROR})}finally{return u()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new B}),e=this.formController.values.getValue();return this.refundLoading=!0,new Promise((t=>{let r;s({refundBody:e,onSuccess:t=>{r=t},onError:({error:t,code:s,severity:e})=>{r=t,this.handleError(t,s,e)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,t(r.data)}})}))}render(){if(this.paymentLoading)return t(k,null);const s=this.formController.getInitialValues(),e=this.refundPayload.amount;return t(p,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:s.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:s.reason,inputHandler:this.inputHandler,options:g,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:s.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(m,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${n(+e)}`))))))}};export{D as justifi_refund_payment}
@@ -1 +1 @@
1
- import{h as i,r as e,H as a}from"./p-DOjVAAtq.js";import{S as t}from"./p-T2yENPvU.js";import{w as s,c as d}from"./p-a6tcNl_T.js";import{b as c}from"./p-Bgnhf5c9.js";import"./p-xDbRW9xn.js";import"./p-DdMxswn1.js";import"./p-HXpYMWUU.js";const f=e=>{const{isReady:a}=e;return a?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(t,{height:"18px",width:"100px"}),i(t,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(t,{height:"18px",width:"80px"}),i(t,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(t,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(t,{height:"18px",width:"30px"}),i(t,{height:"36px"}))))},r=class{constructor(i){e(this,i),this.isReady=!1}async componentWillLoad(){await s(),this.iframeOrigin=d.iframeOrigin,this.tabId=c()}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((i=>new Promise((e=>{i.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}async validate(){const i=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),t=await this.cvvIframeElement.validate();return i&&e&&a&&t}async tokenize(i,e,a){return this.cardNumberIframeElement.tokenize(i,e,a)}render(){return i(a,{key:"4867571cdff85823d48b139c1b6e591ff73ca426"},i(f,{key:"37b584aa3865acc9266500f734c7a10e49fa139d",isReady:this.isReady}),i("div",{key:"09b5e58ed9df060922e2579880b68f022cff2940",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"bd2f777339e421523cd92c402c4fc066cbde7053",class:"mb-3"},i("iframe-input",{key:"45b822e5878806ae47f88cf5aa54fe9ae5592eda",inputId:"cardNumber",ref:i=>this.cardNumberIframeElement=i,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"c9e4d2afd2eef4377356114bc33f1cc29fea46b3",class:"d-flex align-items-start"},i("div",{key:"e846e807f6524b9fd6a29a0a0bd2fff74c68f11f",class:"flex-fill me-3"},i("iframe-input",{key:"d48a6f05d3ca1341d8060987b53318bf29db4881",inputId:"expirationMonth",ref:i=>this.expirationMonthIframeElement=i,label:"Exp. Month",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"9127d9dc4ff3386db9060126a8b0ce2e2125a5c9",class:"flex-fill me-3"},i("iframe-input",{key:"ced08ea4750b594b87e19fd6e9ae49b2cb6caa72",inputId:"expirationYear",ref:i=>this.expirationYearIframeElement=i,label:"Exp. Year",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"92e07ff8ee6004f64a1e062371fd749771cdb77d",class:"flex-fill"},i("iframe-input",{key:"487187ddfb9cea24cebc377950f33feb9222b299",inputId:"CVV",ref:i=>this.cvvIframeElement=i,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}};export{r as card_form}
1
+ import{h as i,r as e,H as a}from"./p-DOjVAAtq.js";import{S as t}from"./p-T2yENPvU.js";import{w as s,c as d}from"./p-a6tcNl_T.js";import{b as c}from"./p-Bgnhf5c9.js";import"./p-xDbRW9xn.js";import"./p-DdMxswn1.js";import"./p-HXpYMWUU.js";const r=e=>{const{isReady:a}=e;return a?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(t,{height:"18px",width:"100px"}),i(t,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(t,{height:"18px",width:"80px"}),i(t,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(t,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(t,{height:"18px",width:"30px"}),i(t,{height:"36px"}))))},n=class{constructor(i){e(this,i),this.isReady=!1}async componentWillLoad(){await s(),this.iframeOrigin=d.iframeOrigin,this.tabId=c()}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((i=>new Promise((e=>{i.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}async validate(){const i=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),t=await this.cvvIframeElement.validate();return i&&e&&a&&t}async tokenize(i,e,a){return this.cardNumberIframeElement.tokenize(i,e,a)}render(){return i(a,{key:"038d2c8e2f9fcd1015d7177c79afa8c4e5810486"},i(r,{key:"b231bb34f43670bb1d92597d2ab37a5ef2c742e1",isReady:this.isReady}),i("div",{key:"ede0af7f1964c2241982bfed4ca71f229d9096a1",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"7c895da0378cc512b152a6629160009b12fa47aa",class:"mb-3"},i("iframe-input",{key:"7717e0cf984a83402c61bceece2077cda780510f",inputId:"cardNumber",ref:i=>this.cardNumberIframeElement=i,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"b28428997690059244e4da2cd5080af2fb44ca00",class:"d-flex align-items-start"},i("div",{key:"e2f11a9293e00ab5b950de51a41b3af266b8084a",class:"flex-fill me-3"},i("iframe-input",{key:"16d798effe3e29a06d5714b742749a1ce9b40760",inputId:"expirationMonth",ref:i=>this.expirationMonthIframeElement=i,label:"Exp. Month",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"e75c69175bd23bc96192d17a4561a0118f640ebe",class:"flex-fill me-3"},i("iframe-input",{key:"04d1c4fb7693e42a18984d9c102a5d799e7c1c3f",inputId:"expirationYear",ref:i=>this.expirationYearIframeElement=i,label:"Exp. Year",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"a2130dcbe8e72f156bc0434d47a26a8e287b1fce",class:"flex-fill"},i("iframe-input",{key:"4709dcb93de9543be9a5143df0bdeaf66935bde3",inputId:"CVV",ref:i=>this.cvvIframeElement=i,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}};export{n as card_form}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{P as e}from"./p-BjNuRWXK.js";import{m as r}from"./p-DWn9BiNn.js";import{E as o}from"./p-CH8Y3GSr.js";import{C as p,a as n}from"./p-Cjcsf8ku.js";import{c as a,J as h}from"./p-CdEseavG.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-xDbRW9xn.js";import"./p-YyotqiSL.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.recordClickEvent=s(this,"record-click-event"),this.errorMessage=null,this.paymentService=new e,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.handleRecordClickEvent=t=>{this.recordClickEvent.emit({id:t.detail.id,type:t.detail.type})}}componentWillLoad(){a(),this.analytics=new h(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=r({id:this.paymentId,authToken:this.authToken,service:new e}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:n.MISSING_PROPS,severity:p.ERROR}))}render(){return this.errorMessage?o(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent,"onRecord-click-event":this.handleRecordClickEvent,"enable-record-click":"true"})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
1
+ import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{P as r}from"./p-BjNuRWXK.js";import{m as e}from"./p-DWn9BiNn.js";import{E as p}from"./p-CH8Y3GSr.js";import{C as o,a as n}from"./p-Cjcsf8ku.js";import{c as a,J as h}from"./p-l8F_7Ihw.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-xDbRW9xn.js";import"./p-Csfiax9X.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.recordClickEvent=s(this,"record-click-event"),this.errorMessage=null,this.paymentService=new r,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.handleRecordClickEvent=t=>{this.recordClickEvent.emit({id:t.detail.id,type:t.detail.type})}}componentWillLoad(){a(),this.analytics=new h(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=e({id:this.paymentId,authToken:this.authToken,service:new r}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:n.MISSING_PROPS,severity:o.ERROR}))}render(){return this.errorMessage?p(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent,"onRecord-click-event":this.handleRecordClickEvent,"enable-record-click":"true"})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
@@ -0,0 +1 @@
1
+ import{h as e,r as i,H as a}from"./p-DOjVAAtq.js";import{S as t}from"./p-T2yENPvU.js";import{w as s,c}from"./p-a6tcNl_T.js";import{b as r}from"./p-Bgnhf5c9.js";import"./p-xDbRW9xn.js";import"./p-DdMxswn1.js";import"./p-HXpYMWUU.js";const n=i=>{const{isReady:a}=i;return a?null:e("div",{class:"container-fluid p-0"},e("div",{class:"row mb-3"},e("div",{class:"col-12 align-content-end"},e(t,{height:"18px",width:"120px"}),e(t,{height:"36px"}))),e("div",{class:"row"},e("div",{class:"col-12 align-content-end"},e(t,{height:"18px",width:"110px"}),e(t,{height:"36px"}))))},d=class{constructor(e){i(this,e),this.isReady=!1}async componentWillLoad(){await s(),this.iframeOrigin=c.iframeOrigin,this.tabId=r()}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((e=>new Promise((i=>{e.addEventListener("iframeLoaded",(()=>{i()}))}))))).then((()=>{this.isReady=!0}))}async validate(){const e=await this.accountNumberIframeElement.validate(),i=await this.routingNumberIframeElement.validate();return e&&i}async tokenize(e,i,a){return this.accountNumberIframeElement.tokenize(e,i,a)}render(){return e(a,{key:"f570c76e32ab7b017f220b8bcc0cecfafeffe47a"},e(n,{key:"390e43942d12ca974aa2d591e4df537c0300f235",isReady:this.isReady}),e("div",{key:"97a667e02df2bdc7b804708c122627e315d96c73",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},e("div",{key:"7b4230ade22fa763a07259d0041a07d6a551e2a7",class:"row mb-3"},e("iframe-input",{key:"2c1ee3b97a75aae1985fd04d59268c35e61b06e8",inputId:"accountNumber",ref:e=>this.accountNumberIframeElement=e,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber?tabId=${this.tabId}`})),e("div",{key:"4aec3fd9f5e9d2ac57d12ecfda773ca75570ae54",class:"row"},e("iframe-input",{key:"d2c538e1772bafdcf4bb63bd58951ba8bc617be5",inputId:"routingNumber",ref:e=>this.routingNumberIframeElement=e,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber?tabId=${this.tabId}`}))))}};export{d as bank_account_form}
@@ -1 +1 @@
1
- import{h as s,r as i,c as t}from"./p-DOjVAAtq.js";import{c as r,F as e}from"./p-DiJD6Iqx.js";import{b as o,a}from"./p-C9iide2W.js";import{i as p,a as h}from"./p-tYuXMkCd.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as n,a as l}from"./p-Cjcsf8ku.js";import"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import{B as m,b as d}from"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c,J as j}from"./p-CdEseavG.js";import{B as u}from"./p-C9EQ459H.js";import{S as f}from"./p-BhCH9S0e.js";import{H as v}from"./p-RQzxYnz_.js";import"./p-CZfYo5-1.js";import{S as b}from"./p-T2yENPvU.js";import{B as C}from"./p-XYgDHrVL.js";import{m as w,b as g}from"./p-5aA7gjr5.js";import{B as y}from"./p-DQZ5VHTZ.js";import"./p-BFTU3MAI.js";import"./p-PSJOKMWp.js";import"./p-BX8GieXu.js";import"./p-yH3TC3ZQ.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-Dt-vy9Le.js";import"./p-YyotqiSL.js";import"./p-DdZLLkQ5.js";import"./p-xDbRW9xn.js";import"./p-D2muobcE.js";const x=r(Object.assign(Object.assign({},o().fields),{legal_address:h(),additional_questions:a(),representative:p("representative")})),B=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(b,{width:"25%"})),s("div",{class:"col-12"},s(b,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"50%"}),s(b,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"65%"}),s(b,{width:"35%"}))),D=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(b,{width:"40%",height:"40px"})),s(B,null),s(B,null),s(B,null)),S=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event"),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.isLoading=!1,this.isSaving=!1,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new m(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new m(Object.assign(Object.assign({},i),s)).payload;this.patchBusiness({payload:t,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){c(),this.analytics=new j(this),this.formController=new e(x),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=w({authToken:this.authToken,businessId:this.businessId,service:new y}),this.patchBusiness=g({authToken:this.authToken,businessId:this.businessId,service:new y}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:l.MISSING_PROPS,severity:n.ERROR})}handleReponse(s){s.error&&(this.errorMessage=d.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(f,null,this.isLoading?s(D,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(v,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(u,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:C.submit}),isLoading:this.isSaving},"Submit")))))}};export{S as justifi_business_form}
1
+ import{h as s,r as i,c as t}from"./p-DOjVAAtq.js";import{c as r,F as e}from"./p-DiJD6Iqx.js";import{b as o,a}from"./p-C9iide2W.js";import{i as h,a as p}from"./p-tYuXMkCd.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as n,a as l}from"./p-Cjcsf8ku.js";import"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import{B as m,b as d}from"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c,J as j}from"./p-l8F_7Ihw.js";import{B as u}from"./p-C9EQ459H.js";import{S as f}from"./p-BhCH9S0e.js";import{H as v}from"./p-RQzxYnz_.js";import"./p-CZfYo5-1.js";import{S as b}from"./p-T2yENPvU.js";import{B as C}from"./p-XYgDHrVL.js";import{m as w,b as g}from"./p-5aA7gjr5.js";import{B as x}from"./p-DQZ5VHTZ.js";import"./p-BFTU3MAI.js";import"./p-PSJOKMWp.js";import"./p-BX8GieXu.js";import"./p-yH3TC3ZQ.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-Dt-vy9Le.js";import"./p-Csfiax9X.js";import"./p-DdZLLkQ5.js";import"./p-xDbRW9xn.js";import"./p-D2muobcE.js";const y=r(Object.assign(Object.assign({},o().fields),{legal_address:p(),additional_questions:a(),representative:h("representative")})),B=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(b,{width:"25%"})),s("div",{class:"col-12"},s(b,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"50%"}),s(b,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"65%"}),s(b,{width:"35%"}))),D=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(b,{width:"40%",height:"40px"})),s(B,null),s(B,null),s(B,null)),k=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event"),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.isLoading=!1,this.isSaving=!1,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new m(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new m(Object.assign(Object.assign({},i),s)).payload;this.patchBusiness({payload:t,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){c(),this.analytics=new j(this),this.formController=new e(y),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=w({authToken:this.authToken,businessId:this.businessId,service:new x}),this.patchBusiness=g({authToken:this.authToken,businessId:this.businessId,service:new x}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:l.MISSING_PROPS,severity:n.ERROR})}handleReponse(s){s.error&&(this.errorMessage=d.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(f,null,this.isLoading?s(D,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(v,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(u,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:C.submit}),isLoading:this.isSaving},"Submit")))))}};export{k as justifi_business_form}
@@ -1 +1 @@
1
- import{h as t,r as e,c as a}from"./p-DOjVAAtq.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as s,a as i}from"./p-Cjcsf8ku.js";import{g as n}from"./p-C98BC5W5.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as o,J as c}from"./p-CdEseavG.js";import{g as p,a as h}from"./p-D2muobcE.js";import{P as d}from"./p-BjNuRWXK.js";import{T as f,l,a as u,b as m,c as b,d as y,e as _,f as j,g as T,h as g,i as k,j as w,k as v}from"./p-C0wTyoTh.js";import{S as C}from"./p-BhCH9S0e.js";import{T as D}from"./p-CZfYo5-1.js";import{a as S}from"./p-Bgnhf5c9.js";import{S as x,T as R}from"./p-xDbRW9xn.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-YyotqiSL.js";import"./p-DdZLLkQ5.js";import"./p-h5pyZngT.js";const F={created_at:()=>t("th",{part:x,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>t("th",{part:x,scope:"col",title:"The type of each transaction"},"Type"),id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>t("th",{part:x,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>t("th",{part:x,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>t("th",{part:x,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>t("th",{part:x,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>t("th",{part:x,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},A={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},B={created_at:(e,a)=>t("td",{part:R(a)},t("div",{class:"fw-bold"},S(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.created_at,{showTime:!0}))),type:(e,a)=>t("td",{part:R(a)},A[e.payment_balance_txn_type]),id:(e,a)=>t("td",{part:R(a)},e.id),amount:(e,a)=>t("td",{part:R(a),class:"text-end"},e.formattedPaymentAmount(e.amount)),balance:(e,a)=>t("td",{part:R(a),class:"text-end"},e.formattedPaymentAmount(e.balance)),currency:(e,a)=>t("td",{part:R(a)},e.currency),financial_transaction_id:(e,a)=>t("td",{part:R(a)},e.financial_transaction_id),payment_id:(e,a)=>t("td",{part:R(a)},e.payment_id),payment_balance_txn_type:(e,a)=>t("td",{part:R(a)},e.payment_balance_txn_type),source_id:(e,a)=>t("td",{part:R(a)},e.source_id),source_type:(e,a)=>t("td",{part:R(a)},e.source_type)},E=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=r,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,F,B),o(),this.analytics=new c(this),this.initializeApi()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeApi()}handleError(t,e,a){this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:e,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:t,authToken:e,service:a})=>async({params:i,onSuccess:r,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(t,e,i);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:s.ERROR}):r({balanceTransactions:c.data.map((t=>new n(t))),pagingInfo:Object.assign({},c.page_info)})}catch(t){const e=p(null==t?void 0:t.code);o({error:h(t),code:e,severity:s.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:t,pagingInfo:e})=>{this.balanceTransactions=t,this.paging=e,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t.message,this.handleError(t,e,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(i.MISSING_PROPS,this.errorMessage,s.ERROR))}get entityId(){return this.balanceTransactions.map((t=>t.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return t(C,{key:"a00f8b0ba0e96bba423c6933fc9eebd19f5f61cd"},t(l,{key:"b1ad1863482835106c6ec1b5fe7c3f9bb294a316"},t(u,{key:"f20d05de3f0a4d60734bfb366ebaf11a5b9fa4d0"},t(m,{key:"d4aa85002f25923d79670687d80090422e4f09a3"},t(b,{key:"99dba50d00c0ab2ba4f140424ff534936fd15c9e"},this.transactionsTable.columnData.map((t=>t)))),t(y,{key:"5526e3cffc2d43f6f6cbd755afbcffd3d036ebe9"},t(_,{key:"a5cf0dcf867feba1a1a8c4419e5f6c868510eb82",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(j,{key:"62f38aa3ea3758f6a113b2370c17670fa38fd322",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(T,{key:"a86ba5ae455119f12fa01a56c6826cc3a08d7c3b",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(g,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(k,{key:"302041a89f00caa4e440bad8bd5148f9b51b405e"},t(w,{key:"c1071b23b4dc07c94674d0addabc8cdc7bc7ca3c"},t(v,{key:"2144fdc702e20c8c839b5d8c231bf1d3b16df234",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"71589bd15b0af2d1eb6bad533e294e480ba36ca3",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{E as justifi_payment_transactions_list}
1
+ import{h as t,r as e,c as a}from"./p-DOjVAAtq.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as s,a as i}from"./p-Cjcsf8ku.js";import{g as n}from"./p-C98BC5W5.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as o,J as c}from"./p-l8F_7Ihw.js";import{g as p,a as h}from"./p-D2muobcE.js";import{P as d}from"./p-BjNuRWXK.js";import{T as f,l,a as u,b as m,c as b,d as y,e as _,f as j,g as T,h as g,i as k,j as w,k as C}from"./p-C0wTyoTh.js";import{S as v}from"./p-BhCH9S0e.js";import{T as D}from"./p-CZfYo5-1.js";import{a as S}from"./p-Bgnhf5c9.js";import{S as x,T as R}from"./p-xDbRW9xn.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-Csfiax9X.js";import"./p-DdZLLkQ5.js";import"./p-h5pyZngT.js";const F={created_at:()=>t("th",{part:x,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>t("th",{part:x,scope:"col",title:"The type of each transaction"},"Type"),id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>t("th",{part:x,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>t("th",{part:x,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>t("th",{part:x,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>t("th",{part:x,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>t("th",{part:x,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},I={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},A={created_at:(e,a)=>t("td",{part:R(a)},t("div",{class:"fw-bold"},S(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.created_at,{showTime:!0}))),type:(e,a)=>t("td",{part:R(a)},I[e.payment_balance_txn_type]),id:(e,a)=>t("td",{part:R(a)},e.id),amount:(e,a)=>t("td",{part:R(a),class:"text-end"},e.formattedPaymentAmount(e.amount)),balance:(e,a)=>t("td",{part:R(a),class:"text-end"},e.formattedPaymentAmount(e.balance)),currency:(e,a)=>t("td",{part:R(a)},e.currency),financial_transaction_id:(e,a)=>t("td",{part:R(a)},e.financial_transaction_id),payment_id:(e,a)=>t("td",{part:R(a)},e.payment_id),payment_balance_txn_type:(e,a)=>t("td",{part:R(a)},e.payment_balance_txn_type),source_id:(e,a)=>t("td",{part:R(a)},e.source_id),source_type:(e,a)=>t("td",{part:R(a)},e.source_type)},B=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=r,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,F,A),o(),this.analytics=new c(this),this.initializeApi()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeApi()}handleError(t,e,a){this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:e,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:t,authToken:e,service:a})=>async({params:i,onSuccess:r,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(t,e,i);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:s.ERROR}):r({balanceTransactions:c.data.map((t=>new n(t))),pagingInfo:Object.assign({},c.page_info)})}catch(t){const e=p(null==t?void 0:t.code);o({error:h(t),code:e,severity:s.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:t,pagingInfo:e})=>{this.balanceTransactions=t,this.paging=e,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t.message,this.handleError(t,e,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(i.MISSING_PROPS,this.errorMessage,s.ERROR))}get entityId(){return this.balanceTransactions.map((t=>t.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return t(v,{key:"a00f8b0ba0e96bba423c6933fc9eebd19f5f61cd"},t(l,{key:"b1ad1863482835106c6ec1b5fe7c3f9bb294a316"},t(u,{key:"f20d05de3f0a4d60734bfb366ebaf11a5b9fa4d0"},t(m,{key:"d4aa85002f25923d79670687d80090422e4f09a3"},t(b,{key:"99dba50d00c0ab2ba4f140424ff534936fd15c9e"},this.transactionsTable.columnData.map((t=>t)))),t(y,{key:"5526e3cffc2d43f6f6cbd755afbcffd3d036ebe9"},t(_,{key:"a5cf0dcf867feba1a1a8c4419e5f6c868510eb82",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(j,{key:"62f38aa3ea3758f6a113b2370c17670fa38fd322",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(T,{key:"a86ba5ae455119f12fa01a56c6826cc3a08d7c3b",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(g,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(k,{key:"302041a89f00caa4e440bad8bd5148f9b51b405e"},t(w,{key:"c1071b23b4dc07c94674d0addabc8cdc7bc7ca3c"},t(C,{key:"2144fdc702e20c8c839b5d8c231bf1d3b16df234",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"71589bd15b0af2d1eb6bad533e294e480ba36ca3",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{B as justifi_payment_transactions_list}
@@ -1 +1 @@
1
- import{h as i,r as s,c as t}from"./p-DOjVAAtq.js";import{am as e,aj as r,af as o,D as l}from"./p-xDbRW9xn.js";import{S as d}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{c as n,J as a}from"./p-CdEseavG.js";import{C as h,a as c}from"./p-Cjcsf8ku.js";import{B as v}from"./p-DQZ5VHTZ.js";import{B as u}from"./p-BlJnA265.js";import{m as p}from"./p-DH8F0bsw.js";import{S as m}from"./p-T2yENPvU.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{j as f,i as w,b as j}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BH0Xfn-F.js";import{g as x,a as y}from"./p-D2muobcE.js";import{T as g}from"./p-CCLgieAN.js";import{l as b}from"./p-Bgnhf5c9.js";import"./p-YyotqiSL.js";import"./p-DdZLLkQ5.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-DdMxswn1.js";const C=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(m,{width:"25%"})),i("div",{class:"col-12"},i(m,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"50%"}),i(m,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"65%"}),i(m,{width:"35%"}))),S=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(m,{width:"40%",height:"40px"})),i(C,null)),k=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(m,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),i("div",{class:"flex-grow-1"},i("div",{class:"d-flex row flex-row"},i("div",{class:"col-6 flex-column"},i(m,null),i(m,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(m,{width:"80px",height:"32px"}),i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(m,null),i(m,null)))))),B=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event"),this.submitted=t(this,"submit-event"),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new w({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?j.boardingShipping:j.boardingOnly}),n(),this.analytics=new a(this),this.loadData()}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}handleError(i,s,t){this.error={message:i,code:s,severity:t},this.errorEvent.emit({errorCode:s,message:i,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",c.MISSING_PROPS,h.ERROR)}initializeGetBusiness(){p({id:this.businessId,authToken:this.authToken,service:new v})({onSuccess:({business:i})=>{this.business=new u(i),this.loading.business=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.business=!1}})}initializeGetTerminalModels(){(({id:i,authToken:s,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(i,s);if(a.error)return r({error:y(a.error),code:x(null===(n=a.error)||void 0===n?void 0:n.code),severity:h.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((i=>new f(i))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(i){const s=x(null==i?void 0:i.code);return r({error:i.message||i,code:s,severity:h.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new g})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:y(d.error),code:x(null===(l=d.error)||void 0===l?void 0:l.code),severity:h.ERROR});{const{data:i}=d;r({data:i})}}catch(i){const s=x(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:h.ERROR})}})({authToken:this.authToken,service:new g});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(S,null),this.loading.terminals&&i("div",{class:"mt-5"},i(k,null),i(k,null),i(k,null)))}renderBusinessDetails(){var s,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return i("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},i("div",{class:"row"},i("div",{class:"col-12"},i("h2",{part:r},this.business.legal_name))),i("div",{class:"row"},i("div",{class:"col-6"},i("h5",{part:e},"Representative:"),i("div",null,i("div",null,null===(t=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===t?void 0:t.name),i("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),i("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),i("div",null,b(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),i("div",{class:"col-6"},i("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),i("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",i("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return i("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((s=>i("terminal-quantity-selector",{modelName:s.model_name,description:s.description,imageUrl:s.image_url,helpUrl:s.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return i("div",{class:"mt-3"},i("div",{class:"text-end"},"Order limit: ",this.orderLimit),i("div",{class:"d-flex justify-content-end mt-3"},i("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return i(d,{key:"5e7da5050d127f6470bc12f9cf547fe421ce1897"},i("div",{key:"6a1f46676ef1f31f6cfeb642001a0dd3f8a60072",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{B as justifi_order_terminals}
1
+ import{h as i,r as s,c as t}from"./p-DOjVAAtq.js";import{am as e,aj as r,af as o,D as l}from"./p-xDbRW9xn.js";import{S as d}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{c as n,J as a}from"./p-l8F_7Ihw.js";import{C as h,a as c}from"./p-Cjcsf8ku.js";import{B as u}from"./p-DQZ5VHTZ.js";import{B as v}from"./p-BlJnA265.js";import{m as p}from"./p-DH8F0bsw.js";import{S as m}from"./p-T2yENPvU.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{j as f,i as w,b as x}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BH0Xfn-F.js";import{g as j,a as g}from"./p-D2muobcE.js";import{T as y}from"./p-CCLgieAN.js";import{l as b}from"./p-Bgnhf5c9.js";import"./p-Csfiax9X.js";import"./p-DdZLLkQ5.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-DdMxswn1.js";const C=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(m,{width:"25%"})),i("div",{class:"col-12"},i(m,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"50%"}),i(m,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(m,{width:"65%"}),i(m,{width:"35%"}))),S=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(m,{width:"40%",height:"40px"})),i(C,null)),k=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(m,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),i("div",{class:"flex-grow-1"},i("div",{class:"d-flex row flex-row"},i("div",{class:"col-6 flex-column"},i(m,null),i(m,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(m,{width:"80px",height:"32px"}),i(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(m,null),i(m,null)))))),B=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event"),this.submitted=t(this,"submit-event"),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new w({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?x.boardingShipping:x.boardingOnly}),n(),this.analytics=new a(this),this.loadData()}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}handleError(i,s,t){this.error={message:i,code:s,severity:t},this.errorEvent.emit({errorCode:s,message:i,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",c.MISSING_PROPS,h.ERROR)}initializeGetBusiness(){p({id:this.businessId,authToken:this.authToken,service:new u})({onSuccess:({business:i})=>{this.business=new v(i),this.loading.business=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.business=!1}})}initializeGetTerminalModels(){(({id:i,authToken:s,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(i,s);if(a.error)return r({error:g(a.error),code:j(null===(n=a.error)||void 0===n?void 0:n.code),severity:h.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((i=>new f(i))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(i){const s=j(null==i?void 0:i.code);return r({error:i.message||i,code:s,severity:h.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new y})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:g(d.error),code:j(null===(l=d.error)||void 0===l?void 0:l.code),severity:h.ERROR});{const{data:i}=d;r({data:i})}}catch(i){const s=j(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:h.ERROR})}})({authToken:this.authToken,service:new y});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(S,null),this.loading.terminals&&i("div",{class:"mt-5"},i(k,null),i(k,null),i(k,null)))}renderBusinessDetails(){var s,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return i("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},i("div",{class:"row"},i("div",{class:"col-12"},i("h2",{part:r},this.business.legal_name))),i("div",{class:"row"},i("div",{class:"col-6"},i("h5",{part:e},"Representative:"),i("div",null,i("div",null,null===(t=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===t?void 0:t.name),i("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),i("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),i("div",null,b(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),i("div",{class:"col-6"},i("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),i("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",i("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return i("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((s=>i("terminal-quantity-selector",{modelName:s.model_name,description:s.description,imageUrl:s.image_url,helpUrl:s.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return i("div",{class:"mt-3"},i("div",{class:"text-end"},"Order limit: ",this.orderLimit),i("div",{class:"d-flex justify-content-end mt-3"},i("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return i(d,{key:"5e7da5050d127f6470bc12f9cf547fe421ce1897"},i("div",{key:"6a1f46676ef1f31f6cfeb642001a0dd3f8a60072",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{B as justifi_order_terminals}
@@ -1 +1 @@
1
- import{r as s,c as i,h as t}from"./p-DOjVAAtq.js";import{E as r}from"./p-CH8Y3GSr.js";import{B as o}from"./p-DQZ5VHTZ.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as n,J as h}from"./p-CdEseavG.js";import"./p-xDbRW9xn.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-YyotqiSL.js";const a=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){n(),this.analytics=new h(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new o})}render(){return this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{a as justifi_business_details}
1
+ import{r as s,c as i,h as t}from"./p-DOjVAAtq.js";import{E as r}from"./p-CH8Y3GSr.js";import{B as o}from"./p-DQZ5VHTZ.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as n,J as h}from"./p-l8F_7Ihw.js";import"./p-xDbRW9xn.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-Csfiax9X.js";const a=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){n(),this.analytics=new h(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new o})}render(){return this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{a as justifi_business_details}
@@ -1 +1 @@
1
- import{r as s,c as t,h as e}from"./p-DOjVAAtq.js";import{C as i,a as r}from"./p-Cjcsf8ku.js";import{c as o}from"./p-Dt-vy9Le.js";import{D as h}from"./p-xDbRW9xn.js";import{S as a}from"./p-BhCH9S0e.js";import{H as n}from"./p-RQzxYnz_.js";import"./p-CZfYo5-1.js";import{B as d}from"./p-XYgDHrVL.js";import"./p-BX8GieXu.js";const p=class{constructor(e){s(this,e),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.submitEvent=t(this,"submit-event"),this.loading=!1,this.businessProvisioned=!1,this.currentStep=0,this.allowOptionalFields=!1,this.setBusinessProvisioned=()=>{this.getBusiness({onSuccess:s=>{this.businessProvisioned=o(s.data),this.businessProvisioned&&this.errorEvent.emit({message:"A request to provision payments for this business has already been submitted.",errorCode:r.PROVISIONING_REQUESTED,severity:i.INFO})},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})}})},this.postProvisioningData=()=>{this.postProvisioning({onSuccess:s=>{this.submitEvent.emit({response:s})},onError:({error:s,code:t,severity:e})=>{this.submitEvent.emit({response:{error:s}}),this.errorEvent.emit({message:s,errorCode:t,severity:e})}})},this.refs=[],this.incrementSteps=()=>{if(this.currentStep<this.totalSteps)return this.currentStep++},this.decrementSteps=()=>this.currentStep--,this.previousStepButtonOnClick=()=>{this.clickEvent.emit({name:d.previousStep}),this.decrementSteps()},this.nextStepButtonOnClick=(s,t)=>{s.preventDefault(),this.clickEvent.emit({name:t}),this.refs[this.currentStep].validateAndSubmit({onSuccess:this.incrementSteps})}}handleFormCompleted(){this.postProvisioningData()}componentWillLoad(){this.getBusiness&&this.setBusinessProvisioned(),this.refs=[this.coreInfoRef,this.legalAddressRef,this.additionalQuestionsRef,this.representativeRef,this.ownersRef,this.bankAccountRef,this.termsRef]}get businessEndpoint(){return`entities/business/${this.businessId}`}get formDisabled(){return this.loading||this.businessProvisioned}get totalSteps(){return this.refs.length-1}get stepCounter(){return`${this.currentStep+1} of ${this.totalSteps+1}`}handleFormLoading(s){this.loading=s.detail}render(){return e(a,{key:"24a788f8930d61992cdfe9aaa22271e2b72b5a64"},e("div",{key:"1b6f7fea61b3df2dab251883deb92a5b2ab1746d",class:"row gap-3"},e(n,{key:"39f8f198de6f822c32efd5252cbbd207dc0ae619",text:this.formTitle}),e("justifi-payment-provisioning-form-steps",{key:"d37cb2952eba674fd928fffca80de684b5ae6c45",businessId:this.businessId,authToken:this.authToken,refs:this.refs,currentStep:this.currentStep,allowOptionalFields:this.allowOptionalFields,handleFormLoading:this.handleFormLoading}),e("div",{key:"8d4ab45ab2a4589a04d76602923d4bf68d0aed1b",class:"d-flex justify-content-between align-items-center"},e("div",{key:"b351fd2eaeb4481ca3d173b1dc98774a96a1af5b",class:"d-flex align-items-center",part:h},this.stepCounter),e("justifi-payment-provisioning-form-buttons",{key:"c4a7ac39c8e83b55353c83509f5d8b765af1d9b4",currentStep:this.currentStep,totalSteps:this.totalSteps,formLoading:this.loading,formDisabled:this.formDisabled,previousStepButtonOnClick:this.previousStepButtonOnClick,nextStepButtonOnClick:this.nextStepButtonOnClick}))))}};export{p as justifi_payment_provisioning_core}
1
+ import{r as s,c as t,h as e}from"./p-DOjVAAtq.js";import{C as i,a as r}from"./p-Cjcsf8ku.js";import{c as o}from"./p-Dt-vy9Le.js";import{D as h}from"./p-xDbRW9xn.js";import{S as n}from"./p-BhCH9S0e.js";import{H as a}from"./p-RQzxYnz_.js";import"./p-CZfYo5-1.js";import{B as c}from"./p-XYgDHrVL.js";import"./p-BX8GieXu.js";const d=class{constructor(e){s(this,e),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.submitEvent=t(this,"submit-event"),this.loading=!1,this.businessProvisioned=!1,this.currentStep=0,this.allowOptionalFields=!1,this.setBusinessProvisioned=()=>{this.getBusiness({onSuccess:s=>{this.businessProvisioned=o(s.data),this.businessProvisioned&&this.errorEvent.emit({message:"A request to provision payments for this business has already been submitted.",errorCode:r.PROVISIONING_REQUESTED,severity:i.INFO})},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})}})},this.postProvisioningData=()=>{this.postProvisioning({onSuccess:s=>{this.submitEvent.emit({response:s})},onError:({error:s,code:t,severity:e})=>{this.submitEvent.emit({response:{error:s}}),this.errorEvent.emit({message:s,errorCode:t,severity:e})}})},this.refs=[],this.incrementSteps=()=>{if(this.currentStep<this.totalSteps)return this.currentStep++},this.decrementSteps=()=>this.currentStep--,this.previousStepButtonOnClick=()=>{this.clickEvent.emit({name:c.previousStep}),this.decrementSteps()},this.nextStepButtonOnClick=(s,t)=>{s.preventDefault(),this.clickEvent.emit({name:t}),this.refs[this.currentStep].validateAndSubmit({onSuccess:this.incrementSteps})}}handleFormCompleted(){this.postProvisioningData()}componentWillLoad(){this.getBusiness&&this.setBusinessProvisioned(),this.refs=[this.coreInfoRef,this.legalAddressRef,this.additionalQuestionsRef,this.representativeRef,this.ownersRef,this.bankAccountRef,this.termsRef]}get businessEndpoint(){return`entities/business/${this.businessId}`}get formDisabled(){return this.loading||this.businessProvisioned}get totalSteps(){return this.refs.length-1}get stepCounter(){return`${this.currentStep+1} of ${this.totalSteps+1}`}handleFormLoading(s){this.loading=s.detail}render(){return e(n,{key:"621b616a3b9d5be0fcc1180dcdb0db6a89ec5aa2"},e("div",{key:"b51c6814bb81a6cdc6cd0c5ede4d485582f154ee",class:"row gap-3"},e(a,{key:"7c03561b4c2b0cfc237d6b933aeffe532f35b626",text:this.formTitle}),e("justifi-payment-provisioning-form-steps",{key:"b616b52cc9a0057f27ddbae1356710cee05c60fa",businessId:this.businessId,authToken:this.authToken,refs:this.refs,currentStep:this.currentStep,allowOptionalFields:this.allowOptionalFields,handleFormLoading:this.handleFormLoading}),e("div",{key:"2447bad174b5d32d253e821e76ebb32fb9ec50e3",class:"d-flex justify-content-between align-items-center"},e("div",{key:"d746b5275ae0866a8619f67fe00217916153ea0a",class:"d-flex align-items-center",part:h},this.stepCounter),e("justifi-payment-provisioning-form-buttons",{key:"add808398005b6076d91788cc220ab6620f3ddfc",currentStep:this.currentStep,totalSteps:this.totalSteps,formLoading:this.loading,formDisabled:this.formDisabled,previousStepButtonOnClick:this.previousStepButtonOnClick,nextStepButtonOnClick:this.nextStepButtonOnClick}))))}};export{d as justifi_payment_provisioning_core}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as s,H as a}from"./p-DOjVAAtq.js";import{I as i}from"./p-Ce_F4E0f.js";import{b as d,U as l,a as o,c,l as r}from"./p-xDbRW9xn.js";import{F as n}from"./p-NAjz1Xfo.js";import"./p-CZfYo5-1.js";import{S as f}from"./p-BX8GieXu.js";import{n as h}from"./p-BnjCmwMr.js";const u=class{constructor(s){e(this,s),this.formControlInput=t(this,"formControlInput"),this.formControlBlur=t(this,"formControlBlur"),this.imask=null,this.isFocused=!1,this.initializeIMask=()=>{this.textInput&&(this.imask=i(this.textInput,{mask:this.mask}),this.imask.on("accept",(()=>{var e;const t=null===(e=this.imask)||void 0===e?void 0:e.unmaskedValue;void 0!==t&&this.inputHandler(this.name,t)})),this.textInput.addEventListener("blur",(()=>this.formControlBlur.emit())))},this.handleFormControlInput=e=>{var t;const s=e.target,a=s.getAttribute("name"),i=(null===(t=this.imask)||void 0===t?void 0:t.unmaskedValue)||s.value;this.formControlInput.emit({name:a,value:i})},this.updateInput=e=>{this.imask&&e&&(this.imask.value=String(e))}}handleDefaultValueChange(e){this.initializeIMask(),this.updateInput(e)}disconnectedCallback(){var e;null===(e=this.imask)||void 0===e||e.destroy()}componentDidLoad(){this.textInput&&(this.initializeIMask(),this.updateInput(this.defaultValue))}get part(){return this.errorText?d:this.disabled?l:this.isFocused?o:c}render(){return s(a,{key:"adf23d58dec1c24cf4ba2211503ffe64b522be75"},s("div",{key:"a36c57a06cf264359a28b61fe18b1f6e3a68ac7f",class:"form-group d-flex flex-column"},s("div",{key:"8f661e4521f0b3fe44b2c5b79dd5589949f3e0e2",class:"d-flex align-items-start gap-2"},s("label",{key:"a7348d28089c56cb8a757ac6cc8a39093014a947",part:r,class:"form-label",htmlFor:this.name},this.label),s("form-control-tooltip",{key:"43c99dd657f8026d5e7c44b33161a698ac2703e5",helpText:this.helpText})),s("input",{key:"1573ed829c667326706b707fab13b736e3c08d92",ref:e=>this.textInput=e,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",type:"text",disabled:this.disabled}),s(n,{key:"b5f2c780415db76cf369e2b96f625751d8da11f6",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}},b=class{constructor(t){e(this,t),this.address={},this.inputHandler=(e,t)=>{this.address[e]=t,this.address=Object.assign({},this.address)}}handleAddressChange(e){this.handleFormUpdate(e)}render(){var e,t,i,d,l,o,c,r,n,u,b,m;return s(a,{key:"136f90a2d2e8634c003a5f47af20d422b7cc59be"},s("div",{key:"e7441c2a0410381be43f8d0735fdf4e390f664f2",class:"row gy-3"},s("div",{key:"93f23a3ba51716a88bf90628f395dbb3bc456cdc",class:"col-12 col-md-8"},s("form-control-text",{key:"f4801f6eb05d3a169142daa6b0d123ef84864de8",name:"line1",label:"Street Address",defaultValue:null===(e=this.defaultValues)||void 0===e?void 0:e.line1,errorText:null===(t=this.errors)||void 0===t?void 0:t.line1,inputHandler:this.inputHandler,helpText:"​​Enter your address exactly as stated on your driver's license. No PO Boxes."})),s("div",{key:"e8ce49dcd4d3c6df3327d2c011ec1c0a080fb4f2",class:"col-12 col-md-4"},s("form-control-text",{key:"8cbe92c156c4d410b712b2fc95c7bfe55be4e337",name:"line2",label:"Apartment, Suite, etc. (optional)",defaultValue:null===(i=this.defaultValues)||void 0===i?void 0:i.line2,errorText:null===(d=this.errors)||void 0===d?void 0:d.line2,inputHandler:this.inputHandler})),s("div",{key:"4cfcfc24268fd92ccaac110a8293e95bc9998af8",class:"col-12"},s("form-control-text",{key:"b2739b7fd7838ee73c9127fd8e9b0dd6dcd12210",name:"city",label:"City",defaultValue:null===(l=this.defaultValues)||void 0===l?void 0:l.city,errorText:null===(o=this.errors)||void 0===o?void 0:o.city,inputHandler:this.inputHandler})),s("div",{key:"ce9e4974dcdab596dfcefef362d045ee2fea3648",class:"col-12 col-md-6"},s("form-control-select",{key:"c001d0a3d3b402768ec428c0e5760cf0e88c318d",name:"state",label:"State",defaultValue:null===(c=this.defaultValues)||void 0===c?void 0:c.state,options:f,errorText:null===(r=this.errors)||void 0===r?void 0:r.state,inputHandler:this.inputHandler})),s("div",{key:"7b73598a2b207db9ec2480ed37d163aa45128e6d",class:"col-12 col-md-6"},s("form-control-text",{key:"a070edca32110dc4ec238c486ae96852733ae924",name:"postal_code",label:"Postal Code",defaultValue:null===(n=this.defaultValues)||void 0===n?void 0:n.postal_code,errorText:null===(u=this.errors)||void 0===u?void 0:u.postal_code,maxLength:5,keyDownHandler:h,inputHandler:this.inputHandler})),s("div",{key:"57b01955142ed533a65058b63cfd20598e8387c2",class:"col-12"},s("form-control-select",{key:"8f07809025c039b4c39a452ddf2948f973a82d9a",name:"country",label:"Country",options:[{label:"United States",value:"USA"}],inputHandler:this.inputHandler,defaultValue:null===(b=this.defaultValues)||void 0===b?void 0:b.country,errorText:null===(m=this.errors)||void 0===m?void 0:m.country,disabled:!0}))))}static get watchers(){return{address:["handleAddressChange"]}}};export{u as form_control_number_masked,b as justifi_identity_address_form}
@@ -1 +1 @@
1
- import{p as t}from"./p-YyotqiSL.js";import{A as s}from"./p-DdZLLkQ5.js";import"./p-Cjcsf8ku.js";import"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class o{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("storybook")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:s.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters&&this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const n=async()=>{var s,i;if("undefined"!=typeof process&&("test"===(null===(s=process.env)||void 0===s?void 0:s.NODE_ENV)||(null===(i=process.env)||void 0===i?void 0:i.JEST_WORKER_ID)))return;const e=t.version,o=t.name,n=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(o),r=n.replace(/-rc.*/,""),a=e.split("."),c=n.split(".");a[0]!==c[0]&&console.warn(`The package ${o} is out of date. The latest version is ${r}. Please update.`)};export{o as J,n as c}
1
+ import{p as t}from"./p-Csfiax9X.js";import{A as s}from"./p-DdZLLkQ5.js";import"./p-Cjcsf8ku.js";import"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class o{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("storybook")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:s.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters&&this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const n=async()=>{var s,i;if("undefined"!=typeof process&&("test"===(null===(s=process.env)||void 0===s?void 0:s.NODE_ENV)||(null===(i=process.env)||void 0===i?void 0:i.JEST_WORKER_ID)))return;const e=t.version,o=t.name,n=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(o),r=n.replace(/-rc.*/,""),a=e.split("."),c=n.split(".");a[0]!==c[0]&&console.warn(`The package ${o} is out of date. The latest version is ${r}. Please update.`)};export{o as J,n as c}