@justifi/webcomponents 6.10.0 → 6.10.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 (100) hide show
  1. package/dist/cjs/{check-pkg-version-DjlvidPw.js → check-pkg-version-PX_ogtrH.js} +18 -1
  2. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  3. package/dist/cjs/internal-tokenize-payment-method_7.cjs.entry.js +2 -2
  4. package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +6 -0
  5. package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +2 -2
  6. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  7. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
  9. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
  10. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  13. package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +20 -0
  16. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
  18. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  19. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  20. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
  21. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  24. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
  25. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  26. package/dist/cjs/loader.cjs.js +1 -1
  27. package/dist/cjs/{package-C5inXJfW.js → package-uJFBawLq.js} +1 -1
  28. package/dist/cjs/webcomponents.cjs.js +1 -1
  29. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +6 -0
  30. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-already-provisioned.js +6 -0
  31. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-core.js +15 -0
  32. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-submission-complete.js +6 -0
  33. package/dist/collection/utils/check-pkg-version.js +17 -0
  34. package/dist/docs.json +6 -73
  35. package/dist/esm/{check-pkg-version-wgHSN5sV.js → check-pkg-version-Dun0W_E2.js} +18 -1
  36. package/dist/esm/hidden-input_2.entry.js +1 -1
  37. package/dist/esm/internal-tokenize-payment-method_7.entry.js +2 -2
  38. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +6 -0
  39. package/dist/esm/justifi-apple-pay_8.entry.js +2 -2
  40. package/dist/esm/justifi-business-details.entry.js +2 -2
  41. package/dist/esm/justifi-business-form.entry.js +2 -2
  42. package/dist/esm/justifi-checkout.entry.js +2 -2
  43. package/dist/esm/justifi-checkouts-list.entry.js +2 -2
  44. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  45. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  46. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  47. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  48. package/dist/esm/justifi-payment-details.entry.js +2 -2
  49. package/dist/esm/justifi-payment-provisioning-core.entry.js +21 -1
  50. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  51. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  52. package/dist/esm/justifi-payments-list.entry.js +2 -2
  53. package/dist/esm/justifi-payout-details.entry.js +2 -2
  54. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  55. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  56. package/dist/esm/justifi-refund-payment.entry.js +2 -2
  57. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  58. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  59. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  60. package/dist/esm/loader.js +1 -1
  61. package/dist/esm/{package-D4eE0MBI.js → package-CfQ5vkQ3.js} +1 -1
  62. package/dist/esm/webcomponents.js +1 -1
  63. package/dist/module/Analytics.js +17 -0
  64. package/dist/module/business-owners-form-step.js +6 -0
  65. package/dist/module/package.js +1 -1
  66. package/dist/module/payment-provisioning-core.js +22 -1
  67. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-already-provisioned.d.ts +1 -0
  68. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-core.d.ts +1 -0
  69. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-submission-complete.d.ts +1 -0
  70. package/dist/webcomponents/{p-38c1e9fa.entry.js → p-092653b6.entry.js} +1 -1
  71. package/dist/webcomponents/{p-ed4f8027.entry.js → p-18658148.entry.js} +1 -1
  72. package/dist/webcomponents/p-32a8b10f.entry.js +1 -0
  73. package/dist/webcomponents/{p-df61f19b.entry.js → p-334beb48.entry.js} +1 -1
  74. package/dist/webcomponents/{p-b4b540fa.entry.js → p-3798d389.entry.js} +1 -1
  75. package/dist/webcomponents/{p-423b63ad.entry.js → p-3bbacc8e.entry.js} +1 -1
  76. package/dist/webcomponents/{p-d766763a.entry.js → p-3c647db5.entry.js} +1 -1
  77. package/dist/webcomponents/{p-2438363d.entry.js → p-3caa3604.entry.js} +1 -1
  78. package/dist/webcomponents/{p-0e21749b.entry.js → p-4116808e.entry.js} +1 -1
  79. package/dist/webcomponents/{p-7769de83.entry.js → p-5f402409.entry.js} +1 -1
  80. package/dist/webcomponents/{p-d62da4f2.entry.js → p-660a04c0.entry.js} +1 -1
  81. package/dist/webcomponents/{p-f18e90b1.entry.js → p-917daf31.entry.js} +1 -1
  82. package/dist/webcomponents/{p-300002dd.entry.js → p-98158303.entry.js} +1 -1
  83. package/dist/webcomponents/{p-5cee4e33.entry.js → p-990d3709.entry.js} +1 -1
  84. package/dist/webcomponents/p-CfQ5vkQ3.js +1 -0
  85. package/dist/webcomponents/{p-eb1251bf.entry.js → p-a141c90b.entry.js} +1 -1
  86. package/dist/webcomponents/{p-c725dc53.entry.js → p-a713a90d.entry.js} +1 -1
  87. package/dist/webcomponents/{p-8728065b.entry.js → p-a87a7fad.entry.js} +1 -1
  88. package/dist/webcomponents/{p-e2bc6c68.entry.js → p-ab365375.entry.js} +1 -1
  89. package/dist/webcomponents/{p-2b679e5a.entry.js → p-ad962b59.entry.js} +1 -1
  90. package/dist/webcomponents/{p-979d22d0.entry.js → p-b6ffa313.entry.js} +1 -1
  91. package/dist/webcomponents/p-cb9abd2c.entry.js +1 -0
  92. package/dist/webcomponents/{p-d0813f21.entry.js → p-d5516a10.entry.js} +1 -1
  93. package/dist/webcomponents/{p-3971d6b7.entry.js → p-e8eeb4f1.entry.js} +1 -1
  94. package/dist/webcomponents/{p-CbTf_N6u.js → p-eEJvKFFX.js} +1 -1
  95. package/dist/webcomponents/{p-5d753fd4.entry.js → p-f5362ed9.entry.js} +1 -1
  96. package/dist/webcomponents/webcomponents.esm.js +1 -1
  97. package/package.json +3 -2
  98. package/dist/webcomponents/p-2bbd810a.entry.js +0 -1
  99. package/dist/webcomponents/p-D4eE0MBI.js +0 -1
  100. package/dist/webcomponents/p-afa2ebd9.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,c as t,h as s}from"./p-CV0Pyo1O.js";import{f as i}from"./p-MeSAYDNh.js";import{H as a,as as r}from"./p-C4FLe2pT.js";import{B as d}from"./p-DFiTyYE9.js";import{S as o}from"./p-BqNNwq6C.js";import{S as c}from"./p-DqVU8ohH.js";import"./p-CZfYo5-1.js";import{C as n,a as h}from"./p-Cjcsf8ku.js";import{g as p,a as f}from"./p-D2muobcE.js";import{D as l}from"./p-CemnnRdZ.js";import{D as u}from"./p-Bg2SZArf.js";import{c as b,J as y}from"./p-CbTf_N6u.js";import"./p-HXpYMWUU.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-BiNakvsa.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-D4eE0MBI.js";const v=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR})}a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},m=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7)}acceptDispute(){v({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}isDueDatePassed(){var e;if(!(null===(e=this.dispute)||void 0===e?void 0:e.due_date))return!1;const t=new Date(this.dispute.due_date.replace(/-/g,"/").replace(/T.+/,"")),s=new Date;return s.setHours(0,0,0,0),t.setHours(0,0,0,0),t<s}render(){var e,t,n,h,p,f,l,u,b;return s(o,{key:"f73a27de0f7e01960cfe78a5b81b021b22eaf2c6"},this.isLoading&&s("div",{key:"ca2c47a78d302e09cd60434eb2a0146787f7ac45",style:{marginBottom:"8px"}},s(c,{key:"e7c3318f1ecaae82727ec3620e5ba65f25692552",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"3313a4d5ba47766076e5c13cde8f1500fdcfa4a0",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"94d2c92beaf52499cea87b3e04a37284898ce4d9",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"fe66f1d00863607cbb457953c4880e4bdc4442ae",part:a},s("h1",{key:"1cf8c42bdb942391c65e67db8a0da0ff4c618249",class:"h4",part:r},"The due date (",null===(t=this.dispute)||void 0===t?void 0:t.due_date,") for this dispute has passed"),s("p",{key:"18643d72965f197edcf40c2053325df9dedf47fb"},"You can no longer submit evidence to counter this dispute.")),(null===(n=this.dispute)||void 0===n?void 0:n.needsResponse)&&!this.isDueDatePassed()&&s("div",{key:"096b7b976ddebd49a6ab5067ef5b4f07e06e145d",part:a},s("h1",{key:"06010bc9881b4cd9bd91399784ff9169e730784f",class:"h4",part:r},"This payment is disputed"),s("p",{key:"aca40b62cfe60ca69ebecd59d9d1c5c3cfd1b227"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"81f1fe8ec625b44d7bf251f4fbf5a4ac1dea2a41",class:"h5"},"Dispute details"),s("div",{key:"b5269224135805abb32164911ef682ed9524a35b",class:"d-table gap-2"},s("div",{key:"b90a2c3028003119fdb23f6e0cd8a3f965f9d58b",class:"d-table-row gap-2"},s("span",{key:"24967d47583c83333966ad788e8d4d388f32bf3a",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"a1bc338abb575e5dc496bec2f7199d36d3015d68",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(h=this.dispute)||void 0===h?void 0:h.amount))),s("div",{key:"c45e0cc9efcf743d9b981d17d9628b243892d27e",class:"d-table-row gap-2"},s("span",{key:"d326adc2bfe3fbd9d67fc4d9d82e1545490d274a",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"eaa16df97b9fd1b4963c2561bc5b7eb7892dafb4",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(p=this.dispute)||void 0===p?void 0:p.reason)),s("div",{key:"58999fa8fd18509f29d7233ca7255e2a033139b3",class:"d-table-row gap-2"},s("span",{key:"b35f041be173d792e81c3da3992104a0ede2bf91",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"eea5132a629528830dd6a3c68ca773848c89cb95",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(f=this.dispute)||void 0===f?void 0:f.due_date))),s("div",{key:"f4975381aad6ed61a674e7a907632790e0ecf399",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"875c8fe451dbf7bb3817be6ab2ab3b919bb6b783",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"a4725c6ee3c18785e91d5ce82c3fbdb35029040a",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"3c2149db7fbe647697c759083fe1884421409078",part:a},s("h1",{key:"14a5b5e1f88a147b5e5b272c05d8c7b61172ccc1",class:"h4",part:r},"This payment is disputed and under review"),s("p",{key:"80492d8cfabb74288b800737ff1b91ef4ca976e4"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(u=this.dispute)||void 0===u?void 0:u.won)&&s("div",{key:"379d85bd2363dc727e0e17e20900912232fc8692",part:a},s("h1",{key:"d26214c5df407be1fdba12836882b6299f84d02b",class:"h4",part:r},"This payment was disputed"),s("p",{key:"f77287d806f5121916661f511830239e34df103f"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(b=this.dispute)||void 0===b?void 0:b.lost)&&s("div",{key:"29d05bf0e4065164bf5b5a079679c189373edbfb",part:a},s("h1",{key:"4f76816e9dbbe9b4a02bf15d019ebf0163908659",class:"h4",part:r},"This payment was disputed"),s("p",{key:"184a792846ced212766c1f6b63b3ccd0297eceb9"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.errorMessage=null,this.apiOrigin="https://wc-proxy.justifi.ai",this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)}}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=v({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(o,{key:"68bf041be58383d3df181d84e0773bb71fd4ed96"},s("justifi-dispute-response-core",{key:"76af71dd1a21bedf10406aa2cd6d93bfad5b5746","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},w=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"8b0f0f810ad0bbc57489862ae5159fae8cbad746",class:"row gy-3"},s("div",{key:"ca6e73df82123a344b4a28efae395e8b9c931258",class:"col-12"},s("h1",{key:"bb78dcfd69d0b747cf1b1865bf463518ae18b442",class:"h4",part:r},"Counter dispute")),s("div",{key:"7179e0a6fdb89024d613f897db2cf313255494fd",class:"col-12"},this.currentStepComponent),s("div",{key:"9219e8b3213c494adef926077f35c298588053c0",class:"col-12"},s("div",{key:"73c2fd1a8440c19f468610ec02a7cfa6eddecb7e",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{m as justifi_dispute_notification,k as justifi_dispute_response,w as justifi_dispute_response_core}
1
+ import{r as e,c as t,h as s}from"./p-CV0Pyo1O.js";import{f as i}from"./p-MeSAYDNh.js";import{H as a,as as r}from"./p-C4FLe2pT.js";import{B as d}from"./p-DFiTyYE9.js";import{S as o}from"./p-BqNNwq6C.js";import{S as c}from"./p-DqVU8ohH.js";import"./p-CZfYo5-1.js";import{C as n,a as h}from"./p-Cjcsf8ku.js";import{g as p,a as f}from"./p-D2muobcE.js";import{D as l}from"./p-CemnnRdZ.js";import{D as u}from"./p-Bg2SZArf.js";import{c as b,J as y}from"./p-eEJvKFFX.js";import"./p-HXpYMWUU.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-BiNakvsa.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-CfQ5vkQ3.js";const v=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR})}a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},m=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7)}acceptDispute(){v({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}isDueDatePassed(){var e;if(!(null===(e=this.dispute)||void 0===e?void 0:e.due_date))return!1;const t=new Date(this.dispute.due_date.replace(/-/g,"/").replace(/T.+/,"")),s=new Date;return s.setHours(0,0,0,0),t.setHours(0,0,0,0),t<s}render(){var e,t,n,h,p,f,l,u,b;return s(o,{key:"f73a27de0f7e01960cfe78a5b81b021b22eaf2c6"},this.isLoading&&s("div",{key:"ca2c47a78d302e09cd60434eb2a0146787f7ac45",style:{marginBottom:"8px"}},s(c,{key:"e7c3318f1ecaae82727ec3620e5ba65f25692552",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(c,{key:"3313a4d5ba47766076e5c13cde8f1500fdcfa4a0",height:"18px",styles:{marginBottom:"8px"}}),s(c,{key:"94d2c92beaf52499cea87b3e04a37284898ce4d9",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&this.isDueDatePassed()&&s("div",{key:"fe66f1d00863607cbb457953c4880e4bdc4442ae",part:a},s("h1",{key:"1cf8c42bdb942391c65e67db8a0da0ff4c618249",class:"h4",part:r},"The due date (",null===(t=this.dispute)||void 0===t?void 0:t.due_date,") for this dispute has passed"),s("p",{key:"18643d72965f197edcf40c2053325df9dedf47fb"},"You can no longer submit evidence to counter this dispute.")),(null===(n=this.dispute)||void 0===n?void 0:n.needsResponse)&&!this.isDueDatePassed()&&s("div",{key:"096b7b976ddebd49a6ab5067ef5b4f07e06e145d",part:a},s("h1",{key:"06010bc9881b4cd9bd91399784ff9169e730784f",class:"h4",part:r},"This payment is disputed"),s("p",{key:"aca40b62cfe60ca69ebecd59d9d1c5c3cfd1b227"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"81f1fe8ec625b44d7bf251f4fbf5a4ac1dea2a41",class:"h5"},"Dispute details"),s("div",{key:"b5269224135805abb32164911ef682ed9524a35b",class:"d-table gap-2"},s("div",{key:"b90a2c3028003119fdb23f6e0cd8a3f965f9d58b",class:"d-table-row gap-2"},s("span",{key:"24967d47583c83333966ad788e8d4d388f32bf3a",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"a1bc338abb575e5dc496bec2f7199d36d3015d68",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(h=this.dispute)||void 0===h?void 0:h.amount))),s("div",{key:"c45e0cc9efcf743d9b981d17d9628b243892d27e",class:"d-table-row gap-2"},s("span",{key:"d326adc2bfe3fbd9d67fc4d9d82e1545490d274a",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"eaa16df97b9fd1b4963c2561bc5b7eb7892dafb4",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(p=this.dispute)||void 0===p?void 0:p.reason)),s("div",{key:"58999fa8fd18509f29d7233ca7255e2a033139b3",class:"d-table-row gap-2"},s("span",{key:"b35f041be173d792e81c3da3992104a0ede2bf91",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Due Date"),s("span",{key:"eea5132a629528830dd6a3c68ca773848c89cb95",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(f=this.dispute)||void 0===f?void 0:f.due_date))),s("div",{key:"f4975381aad6ed61a674e7a907632790e0ecf399",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"875c8fe451dbf7bb3817be6ab2ab3b919bb6b783",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"a4725c6ee3c18785e91d5ce82c3fbdb35029040a",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(l=this.dispute)||void 0===l?void 0:l.underReview)&&s("div",{key:"3c2149db7fbe647697c759083fe1884421409078",part:a},s("h1",{key:"14a5b5e1f88a147b5e5b272c05d8c7b61172ccc1",class:"h4",part:r},"This payment is disputed and under review"),s("p",{key:"80492d8cfabb74288b800737ff1b91ef4ca976e4"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(u=this.dispute)||void 0===u?void 0:u.won)&&s("div",{key:"379d85bd2363dc727e0e17e20900912232fc8692",part:a},s("h1",{key:"d26214c5df407be1fdba12836882b6299f84d02b",class:"h4",part:r},"This payment was disputed"),s("p",{key:"f77287d806f5121916661f511830239e34df103f"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(b=this.dispute)||void 0===b?void 0:b.lost)&&s("div",{key:"29d05bf0e4065164bf5b5a079679c189373edbfb",part:a},s("h1",{key:"4f76816e9dbbe9b4a02bf15d019ebf0163908659",class:"h4",part:r},"This payment was disputed"),s("p",{key:"184a792846ced212766c1f6b63b3ccd0297eceb9"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.errorMessage=null,this.apiOrigin="https://wc-proxy.justifi.ai",this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)}}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var o;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=v({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(o,{key:"68bf041be58383d3df181d84e0773bb71fd4ed96"},s("justifi-dispute-response-core",{key:"76af71dd1a21bedf10406aa2cd6d93bfad5b5746","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},w=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"8b0f0f810ad0bbc57489862ae5159fae8cbad746",class:"row gy-3"},s("div",{key:"ca6e73df82123a344b4a28efae395e8b9c931258",class:"col-12"},s("h1",{key:"bb78dcfd69d0b747cf1b1865bf463518ae18b442",class:"h4",part:r},"Counter dispute")),s("div",{key:"7179e0a6fdb89024d613f897db2cf313255494fd",class:"col-12"},this.currentStepComponent),s("div",{key:"9219e8b3213c494adef926077f35c298588053c0",class:"col-12"},s("div",{key:"73c2fd1a8440c19f468610ec02a7cfa6eddecb7e",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{m as justifi_dispute_notification,k as justifi_dispute_response,w as justifi_dispute_response_core}
@@ -1 +1 @@
1
- import{r as t,c as s,h as o}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as i,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as a,a as c}from"./p-D2muobcE.js";import{c as n,J as p}from"./p-CbTf_N6u.js";import{C as h}from"./p-BHA4oSi3.js";import{m as u,S as m}from"./p-eEJMJXTG.js";import{S as d}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{d as j}from"./p-CGJ_mnry.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-D4eE0MBI.js";import"./p-55QcjheA.js";import"./p-DO4RBao8.js";import"./p-C4FLe2pT.js";const l=class{constructor(o){t(this,o),this.errorEvent=s(this,"error-event",7),this.errorMessage=null,this.columns=j,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){n(),this.analytics=new p(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){const t=this.subAccountId||this.accountId;t&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:o})=>async({params:r,onSuccess:n,onError:p})=>{var h,u;try{const m=await o.fetchCheckouts(t,s,r);if(m.error)return p({error:c(m.error),code:a(null===(u=m.error)||void 0===u?void 0:u.code),severity:i.ERROR});{const t=Object.assign({},m.page_info);n({checkouts:(null===(h=m.data)||void 0===h?void 0:h.map((t=>new e(t))))||[],pagingInfo:t})}}catch(t){const s=a(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:i.ERROR})}})({accountId:t,authToken:this.authToken,service:new h}):(this.errorMessage="Account ID/Sub Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({primaryAccountId:this.accountId,authToken:this.authToken,service:new m}))}render(){return o(d,{key:"08345e8bbe637cea344a232da2302bd0298a5ac9"},o("checkouts-list-core",{key:"7aa34a0537810197cf6962d1a89e12e9ad9d8eea",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],subAccountId:["propChanged"]}}};export{l as justifi_checkouts_list}
1
+ import{r as t,c as s,h as o}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as i,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as a,a as c}from"./p-D2muobcE.js";import{c as n,J as p}from"./p-eEJvKFFX.js";import{C as h}from"./p-BHA4oSi3.js";import{m as u,S as m}from"./p-eEJMJXTG.js";import{S as d}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{d as j}from"./p-CGJ_mnry.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-CfQ5vkQ3.js";import"./p-55QcjheA.js";import"./p-DO4RBao8.js";import"./p-C4FLe2pT.js";const l=class{constructor(o){t(this,o),this.errorEvent=s(this,"error-event",7),this.errorMessage=null,this.columns=j,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){n(),this.analytics=new p(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){const t=this.subAccountId||this.accountId;t&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:o})=>async({params:r,onSuccess:n,onError:p})=>{var h,u;try{const m=await o.fetchCheckouts(t,s,r);if(m.error)return p({error:c(m.error),code:a(null===(u=m.error)||void 0===u?void 0:u.code),severity:i.ERROR});{const t=Object.assign({},m.page_info);n({checkouts:(null===(h=m.data)||void 0===h?void 0:h.map((t=>new e(t))))||[],pagingInfo:t})}}catch(t){const s=a(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:i.ERROR})}})({accountId:t,authToken:this.authToken,service:new h}):(this.errorMessage="Account ID/Sub Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({primaryAccountId:this.accountId,authToken:this.authToken,service:new m}))}render(){return o(d,{key:"08345e8bbe637cea344a232da2302bd0298a5ac9"},o("checkouts-list-core",{key:"7aa34a0537810197cf6962d1a89e12e9ad9d8eea",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],subAccountId:["propChanged"]}}};export{l as justifi_checkouts_list}
@@ -0,0 +1 @@
1
+ import{h as s,r as i,c as t}from"./p-CV0Pyo1O.js";import{c as e,F as r}from"./p-CKiAlBsU.js";import{b as o,a,c as h}from"./p-BovgIz83.js";import{i as n,a as p,b as l,c as m}from"./p-D8EGHc_m.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as c,a as d}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import{C as j,B as u,b as f}from"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as v,J as b}from"./p-eEJvKFFX.js";import{B as w}from"./p-DFiTyYE9.js";import{S as C}from"./p-BqNNwq6C.js";import{H as g}from"./p-BoO2BHR_.js";import"./p-CZfYo5-1.js";import{S as y}from"./p-DqVU8ohH.js";import{B}from"./p-XYgDHrVL.js";import{m as D,b as _}from"./p-R0FDNhyd.js";import{B as k}from"./p-DqtDbB8E.js";import"./p-BFTU3MAI.js";import"./p-HT_4DkD0.js";import"./p-_-2E_vYf.js";import"./p-Bt4GjEWL.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-CfQ5vkQ3.js";import"./p-55QcjheA.js";import"./p-C4FLe2pT.js";import"./p-D2muobcE.js";const E=e(Object.assign(Object.assign({},o().fields),{legal_address:p(),additional_questions:a(),representative:n("representative")}));e(Object.assign(Object.assign({},h().fields),{legal_address:m(),additional_questions:a(),representative:l("representative")}));const O=E,H=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(y,{width:"25%"})),s("div",{class:"col-12"},s(y,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(y,{width:"50%"}),s(y,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(y,{width:"65%"}),s(y,{width:"35%"}))),q=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(y,{width:"40%",height:"40px"})),s(H,null),s(H,null),s(H,null)),x=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event",7),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.isLoading=!1,this.isSaving=!1,this.country=j.USA,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new u(s);this.country=i.country_of_establishment,this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new u(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(){v(),this.analytics=new b(this),this.formController=new r(O),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=D({authToken:this.authToken,businessId:this.businessId,service:new k}),this.patchBusiness=_({authToken:this.authToken,businessId:this.businessId,service:new k}),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:d.MISSING_PROPS,severity:c.ERROR})}handleReponse(s){s.error&&(this.errorMessage=f.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(C,null,this.isLoading?s(q,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(g,{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,country:this.country})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController,country:this.country})),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,country:this.country})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(w,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:B.submit}),isLoading:this.isSaving},"Submit")))))}};export{x as justifi_business_form}
@@ -1 +1 @@
1
- import{r as s,c as t,h as r}from"./p-CV0Pyo1O.js";import{A as o}from"./p-55QcjheA.js";import{C as e,a as i}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as a,a as n}from"./p-D2muobcE.js";import{E as p}from"./p-DAZtHA62.js";import{c as h,J as c}from"./p-CbTf_N6u.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-C4FLe2pT.js";import"./p-D4eE0MBI.js";const m=o();class u{async fetchGrossVolumeChartData(s,t){return m.get({endpoint:`account/${s}/reports/gross_volume`,authToken:t})}}const d=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event",7),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new c(this),this.initializeGetGrossPayment()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:o,onError:i})=>{var p;try{const h=await r.fetchGrossVolumeChartData(s,t);h.error?i({error:n(h.error),code:a(null===(p=h.error)||void 0===p?void 0:p.code),severity:e.ERROR}):o(h.data)}catch(s){const t=a(null==s?void 0:s.code);i({error:n(s),code:t,severity:e.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new u}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:i.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}render(){return this.errorMessage?p(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_gross_payment_chart}
1
+ import{r as s,c as t,h as r}from"./p-CV0Pyo1O.js";import{A as o}from"./p-55QcjheA.js";import{C as e,a as i}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as a,a as n}from"./p-D2muobcE.js";import{E as p}from"./p-DAZtHA62.js";import{c as h,J as c}from"./p-eEJvKFFX.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-C4FLe2pT.js";import"./p-CfQ5vkQ3.js";const m=o();class u{async fetchGrossVolumeChartData(s,t){return m.get({endpoint:`account/${s}/reports/gross_volume`,authToken:t})}}const d=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event",7),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new c(this),this.initializeGetGrossPayment()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:o,onError:i})=>{var p;try{const h=await r.fetchGrossVolumeChartData(s,t);h.error?i({error:n(h.error),code:a(null===(p=h.error)||void 0===p?void 0:p.code),severity:e.ERROR}):o(h.data)}catch(s){const t=a(null==s?void 0:s.code);i({error:n(s),code:t,severity:e.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new u}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:i.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}render(){return this.errorMessage?p(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_gross_payment_chart}
@@ -1 +1 @@
1
- import{r as s,c as i,h as t}from"./p-CV0Pyo1O.js";import{c as e,J as o}from"./p-CbTf_N6u.js";import{C as r,a as n}from"./p-Cjcsf8ku.js";import{m as p,a}from"./p-R0FDNhyd.js";import{B as h}from"./p-DqtDbB8E.js";import{A as m}from"./p-55QcjheA.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{i as u}from"./p-MeSAYDNh.js";import"./p-D4eE0MBI.js";import"./p-D2muobcE.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";const c=m();class d{async postProvisioning(s,i,t){return c.post({endpoint:"entities/provisioning",body:{business_id:i,product_category:t},authToken:s})}}const j=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.allowOptionalFields=!1,this.formTitle="Business Information"}propChanged(){this.initializeApi()}componentWillLoad(){e(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?u(this.authToken)?this.errorEvent.emit({message:"auth-token is expired",errorCode:n.NOT_AUTHENTICATED,severity:r.ERROR}):(this.getBusiness=p({authToken:this.authToken,businessId:this.businessId,service:new h}),this.postProvisioning=a({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new d})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){return t("justifi-payment-provisioning-core",{key:"8df2a722a6c7150950cbc0a2d923bb1a107170ee",businessId:this.businessId,authToken:this.authToken,allowOptionalFields:this.allowOptionalFields,formTitle:this.formTitle,getBusiness:this.getBusiness,postProvisioning:this.postProvisioning})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{j as justifi_payment_provisioning}
1
+ import{r as s,c as i,h as t}from"./p-CV0Pyo1O.js";import{c as e,J as o}from"./p-eEJvKFFX.js";import{C as r,a as n}from"./p-Cjcsf8ku.js";import{m as p,a}from"./p-R0FDNhyd.js";import{B as h}from"./p-DqtDbB8E.js";import{A as m}from"./p-55QcjheA.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{i as c}from"./p-MeSAYDNh.js";import"./p-CfQ5vkQ3.js";import"./p-D2muobcE.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";const u=m();class d{async postProvisioning(s,i,t){return u.post({endpoint:"entities/provisioning",body:{business_id:i,product_category:t},authToken:s})}}const j=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.allowOptionalFields=!1,this.formTitle="Business Information"}propChanged(){this.initializeApi()}componentWillLoad(){e(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeApi(){this.authToken&&this.businessId?c(this.authToken)?this.errorEvent.emit({message:"auth-token is expired",errorCode:n.NOT_AUTHENTICATED,severity:r.ERROR}):(this.getBusiness=p({authToken:this.authToken,businessId:this.businessId,service:new h}),this.postProvisioning=a({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new d})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){return t("justifi-payment-provisioning-core",{key:"8df2a722a6c7150950cbc0a2d923bb1a107170ee",businessId:this.businessId,authToken:this.authToken,allowOptionalFields:this.allowOptionalFields,formTitle:this.formTitle,getBusiness:this.getBusiness,postProvisioning:this.postProvisioning})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{j as justifi_payment_provisioning}
@@ -1 +1 @@
1
- import{r as s,c as i,h as t}from"./p-CV0Pyo1O.js";import{E as r}from"./p-DAZtHA62.js";import{B as o}from"./p-DqtDbB8E.js";import{m as e}from"./p-CMqX6btO.js";import{C as p,a as m}from"./p-Cjcsf8ku.js";import{c as h,J as a}from"./p-CbTf_N6u.js";import"./p-C4FLe2pT.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-BiNakvsa.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-D2muobcE.js";import"./p-D4eE0MBI.js";const n=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new a(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:p.ERROR});this.getBusiness=e({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{n as justifi_business_details}
1
+ import{r as s,c as i,h as t}from"./p-CV0Pyo1O.js";import{E as r}from"./p-DAZtHA62.js";import{B as o}from"./p-DqtDbB8E.js";import{m as e}from"./p-CMqX6btO.js";import{C as p,a as m}from"./p-Cjcsf8ku.js";import{c as h,J as a}from"./p-eEJvKFFX.js";import"./p-C4FLe2pT.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-BiNakvsa.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-D2muobcE.js";import"./p-CfQ5vkQ3.js";const n=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new a(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:p.ERROR});this.getBusiness=e({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{n as justifi_business_details}
@@ -1 +1 @@
1
- import{r as t,c as s,h as e}from"./p-CV0Pyo1O.js";import{C as i,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-CbTf_N6u.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-CemnnRdZ.js";import"./p-D4eE0MBI.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const m=class{constructor(e){t(this,e),this.errorEvent=s(this,"error-event",7),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:e})=>async({onSuccess:r,onError:o})=>{var p;try{const c=await e.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:i.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:i.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:i.ERROR}))}render(){return e("justifi-dispute-management-core",{key:"6e884955ea019144de872582a62bcecf05efa7b4",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_dispute_management}
1
+ import{r as t,c as s,h as e}from"./p-CV0Pyo1O.js";import{C as i,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-eEJvKFFX.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-CemnnRdZ.js";import"./p-CfQ5vkQ3.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const m=class{constructor(e){t(this,e),this.errorEvent=s(this,"error-event",7),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:e})=>async({onSuccess:r,onError:o})=>{var p;try{const c=await e.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:i.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:i.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:i.ERROR}))}render(){return e("justifi-dispute-management-core",{key:"6e884955ea019144de872582a62bcecf05efa7b4",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_dispute_management}
@@ -1 +1 @@
1
- import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{c as i}from"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as s,a as o}from"./p-Cjcsf8ku.js";import{i as r}from"./p-BiNakvsa.js";import{p as c}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as n,J as h}from"./p-CbTf_N6u.js";import{g as p,a as d}from"./p-D2muobcE.js";import{P as l}from"./p-8Wa_-5QM.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 k,j as g,k as C}from"./p-5mt2ek0H.js";import{S as D}from"./p-BqNNwq6C.js";import{T as P}from"./p-CZfYo5-1.js";import{a as I}from"./p-MeSAYDNh.js";import{V as S,W as q}from"./p-C4FLe2pT.js";import"./p-D8GTwl9v.js";import"./p-D4eE0MBI.js";import"./p-55QcjheA.js";import"./p-DyETkJs3.js";const E={id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of each transaction"},"ID"),account_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the account associated with each transaction"},"Account ID"),payout_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the payout associated with each transaction"},"Payout ID"),financial_transaction_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),amount:()=>t("th",{part:S,scope:"col",title:"The dollar amount of each transaction"},"Amount"),fee:()=>t("th",{part:S,scope:"col",title:"The fee associated with each transaction"},"Fee"),net:()=>t("th",{part:S,scope:"col",title:"The net amount of each transaction"},"Net"),currency:()=>t("th",{part:S,scope:"col",title:"The currency of each transaction"},"Currency"),description:()=>t("th",{part:S,scope:"col",title:"The description of each transaction"},"Description"),source_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),txn_type:()=>t("th",{part:S,scope:"col",title:"The type of each transaction"},"Type"),created_at:()=>t("th",{part:S,scope:"col",title:"The date and time each transaction was made"},"Processed On"),available_on:()=>t("th",{part:S,scope:"col",title:"The date and time each transaction will be available"},"Available On"),updated_at:()=>t("th",{part:S,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"},N={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"},I(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},I(e.created_at,{showTime:!0}))),available_on:e=>t("td",{part:q(e.available_on)},t("div",{class:"fw-bold"},I(e.available_on,{showDisplayDate:!0})),t("div",{class:"fw-bold"},I(e.available_on,{showTime:!0}))),updated_at:e=>t("td",{part:q(e.updated_at)},t("div",{class:"fw-bold"},I(e.updated_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},I(e.updated_at,{showTime:!0})))},A=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),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:P.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:P.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:P.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,E,N),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:"751cbfab0ac4ebff575c0d6e6677bea57498f720"},t(u,{key:"c5e9ae5f08e8011efd13b8e8fc920af25ab6cd80"},t(m,{key:"c2dc2e83a70c9a888d7b24eedca47444fdd7df23"},t(b,{key:"f6031a02be719e94d5b5f6e9b780bf11fa94024a"},t(y,{key:"efcbc758449f7949f206cf3406ea63913687ef16"},this.transactionsTable.columnData.map((t=>t)))),t(_,{key:"3e02a4b3d30c0e448ac8487ff1b10f0801c56972"},t(w,{key:"b2039804780914b796451e229a6d59e76987c8aa",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(T,{key:"020af52a09946e6711556e850a5bd973d0b8433d",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(j,{key:"299646c62cd4dc45d3c2ba02eb71be4506b2d11a",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(k,{key:"488b386f6f1bf9fd27a862a0061dabe9c567266a"},t(g,{key:"3d83e2c8b5b966ef54fbd9835cef7950c090d2af"},t(C,{key:"cf4751107a9db70b50b010c1e0c31e9015d63fd8",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"44e53f6fff05692d572bea438c06b3ec47a6fa00",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],payoutId:["propChanged"],authToken:["propChanged"]}}};export{A as justifi_payout_transactions_list}
1
+ import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{c as i}from"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as s,a as o}from"./p-Cjcsf8ku.js";import{i as r}from"./p-BiNakvsa.js";import{p as c}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as n,J as h}from"./p-eEJvKFFX.js";import{g as p,a as d}from"./p-D2muobcE.js";import{P as l}from"./p-8Wa_-5QM.js";import{T as f,l as u,a as m,b,c as y,d as _,e as w,f as v,g as T,h as j,i as k,j as g,k as C}from"./p-5mt2ek0H.js";import{S as D}from"./p-BqNNwq6C.js";import{T as P}from"./p-CZfYo5-1.js";import{a as S}from"./p-MeSAYDNh.js";import{V as I,W as q}from"./p-C4FLe2pT.js";import"./p-D8GTwl9v.js";import"./p-CfQ5vkQ3.js";import"./p-55QcjheA.js";import"./p-DyETkJs3.js";const E={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"},F={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"},S(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.created_at,{showTime:!0}))),available_on:e=>t("td",{part:q(e.available_on)},t("div",{class:"fw-bold"},S(e.available_on,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.available_on,{showTime:!0}))),updated_at:e=>t("td",{part:q(e.updated_at)},t("div",{class:"fw-bold"},S(e.updated_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.updated_at,{showTime:!0})))},A=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),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:P.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:P.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:P.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,E,F),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:"751cbfab0ac4ebff575c0d6e6677bea57498f720"},t(u,{key:"c5e9ae5f08e8011efd13b8e8fc920af25ab6cd80"},t(m,{key:"c2dc2e83a70c9a888d7b24eedca47444fdd7df23"},t(b,{key:"f6031a02be719e94d5b5f6e9b780bf11fa94024a"},t(y,{key:"efcbc758449f7949f206cf3406ea63913687ef16"},this.transactionsTable.columnData.map((t=>t)))),t(_,{key:"3e02a4b3d30c0e448ac8487ff1b10f0801c56972"},t(w,{key:"b2039804780914b796451e229a6d59e76987c8aa",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(v,{key:"020af52a09946e6711556e850a5bd973d0b8433d",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(T,{key:"299646c62cd4dc45d3c2ba02eb71be4506b2d11a",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(j,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(k,{key:"488b386f6f1bf9fd27a862a0061dabe9c567266a"},t(g,{key:"3d83e2c8b5b966ef54fbd9835cef7950c090d2af"},t(C,{key:"cf4751107a9db70b50b010c1e0c31e9015d63fd8",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"44e53f6fff05692d572bea438c06b3ec47a6fa00",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],payoutId:["propChanged"],authToken:["propChanged"]}}};export{A as justifi_payout_transactions_list}
@@ -1 +1 @@
1
- import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{A as e}from"./p-55QcjheA.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as a,a as n}from"./p-D2muobcE.js";import{c,J as l}from"./p-CbTf_N6u.js";import{c as h}from"./p-Daew0gTO.js";import{p as d,f as p,r as u,k as v}from"./p-MeSAYDNh.js";import{v as m,i as f,a as y,H as j}from"./p-CI11WF1E.js";import{H as _,a1 as g}from"./p-C4FLe2pT.js";import{S as k}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{S as b}from"./p-DqVU8ohH.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-D4eE0MBI.js";import"./p-DkoufM1t.js";import"./p-HXpYMWUU.js";const w=e();class C{async fetchQuote(s,t){return w.post({endpoint:"insurance/quotes",body:t,authToken:s})}async toggleCoverage(s,t,i){return w.post({endpoint:`insurance/quotes/${t}/toggle`,body:i,authToken:s})}}const T=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(b,{width:"35%",height:"30px"})),s("div",{class:"col-12"},s(b,{width:"70%"})),s("div",{class:"col-12"},s(b,{width:"40%"})),s("div",{class:"col-12"},s(b,{width:"40%"})),s("div",{class:"col-12"},s(b,{width:"100%"})),s("div",{class:"col-12"},s(b,{width:"80%"}))),H=class{constructor(s){t(this,s),this.insuranceUpdated=i(this,"insurance-updated",7),this.errorEvent=i(this,"error-event",7),this.isLoading=!0}async validate(){return m()}processHTMLContent(s){return d(s,[s=>u(s,"style"),s=>v(s,"a","part",_),s=>v(s,"p","part",_)])}componentWillLoad(){c(),this.analytics=new l(this),this.initializeServiceMethods(),this.getQuote&&this.fetchData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeServiceMethods(){const s=this.authToken||h.authToken;if(!s)return void this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:"Missing authToken",severity:o.ERROR});const t={authToken:s,service:new C};this.getQuote=(({authToken:s,service:t})=>async({payload:i,onSuccess:e,onError:r})=>{var c;try{const l=await t.fetchQuote(s,i);if(l.error)return r({error:n(l.error),code:a(null===(c=l.error)||void 0===c?void 0:c.code),severity:o.ERROR});e({quote:l.data})}catch(s){const t=a(null==s?void 0:s.code);return r({error:s.message||s,code:t,severity:o.ERROR})}})(t),this.toggleCoverage=(({authToken:s,service:t})=>async({quoteId:i,payload:e,onSuccess:r,onError:c})=>{var l;try{const h=await t.toggleCoverage(s,i,e);if(h.error)return c({error:n(h.error),code:a(null===(l=h.error)||void 0===l?void 0:l.code),severity:o.ERROR});r({quote:h.data})}catch(s){const t=a(null==s?void 0:s.code);return c({error:s.message||s,code:t,severity:o.ERROR})}})(t)}fetchData(){this.isLoading=!0,this.getQuote({payload:{checkout_id:this.checkoutId||h.checkoutId,policy_type:"season_interruption",primary_identity:{state:this.primaryIdentityState,email:this.primaryIdentityEmailAddress,first_name:this.primaryIdentityFirstName,last_name:this.primaryIdentityLastName,postal_code:this.primaryIdentityPostalCode,country:this.primaryIdentityCountry},policy_attributes:{insurable_amount:this.policyAttributesInsurableAmount,start_date:this.policyAttributesStartDate,end_date:this.policyAttributesEndDate,covered_identity:{first_name:this.coveredIdentityFirstName,last_name:this.coveredIdentityLastName}}},onSuccess:({quote:s})=>{this.quote=s,this.quote.product.description=this.processHTMLContent(this.quote.product.description),this.quote.product.legal_disclaimer=this.processHTMLContent(this.quote.product.legal_disclaimer),f[s.policy_type]=s.accepted,this.isLoading=!1},onError:({error:s,code:t,severity:i})=>{this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}onChangeHandler(s,t){this.accepted=t,y[this.quote.policy_type]=!1,this.toggleCoverage({quoteId:this.quote.id,payload:{accepted:this.accepted},onSuccess:()=>{this.insuranceUpdated.emit(),f[this.quote.policy_type]=this.accepted},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}get error(){var s;return y[null===(s=this.quote)||void 0===s?void 0:s.policy_type]}render(){var t,i,e,o;return h&&!1===h.insuranceEnabled?(console.warn("[justifi-season-interruption-insurance] Insurance is disabled for this checkout (payment_settings.insurance_payments=false)."),null):s(k,null,this.isLoading?s(T,null):s("div",null,s(j,{text:null===(t=this.quote)||void 0===t?void 0:t.product.title,class:"fs-5 fw-bold pb-3"}),s("small",{part:_,innerHTML:null===(i=this.quote)||void 0===i?void 0:i.product.description}),s("form-control-radio",{label:`Accept coverage for ${p(null===(e=this.quote)||void 0===e?void 0:e.total_cents)}`,name:"opt-in",value:"true",checked:"true"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),s("form-control-radio",{label:"Decline coverage",name:"opt-in",value:"false",checked:"false"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),s("div",{class:"invalid-feedback",style:{display:this.error?"block":"none"},part:g},"Please select an option"),s("small",{part:_,innerHTML:null===(o=this.quote)||void 0===o?void 0:o.product.legal_disclaimer})))}};export{H as justifi_season_interruption_insurance}
1
+ import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{A as e}from"./p-55QcjheA.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as a,a as n}from"./p-D2muobcE.js";import{c,J as l}from"./p-eEJvKFFX.js";import{c as h}from"./p-Daew0gTO.js";import{p as d,f as p,r as u,k as v}from"./p-MeSAYDNh.js";import{v as m,i as f,a as y,H as j}from"./p-CI11WF1E.js";import{H as _,a1 as g}from"./p-C4FLe2pT.js";import{S as k}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{S as w}from"./p-DqVU8ohH.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-CfQ5vkQ3.js";import"./p-DkoufM1t.js";import"./p-HXpYMWUU.js";const C=e();class b{async fetchQuote(s,t){return C.post({endpoint:"insurance/quotes",body:t,authToken:s})}async toggleCoverage(s,t,i){return C.post({endpoint:`insurance/quotes/${t}/toggle`,body:i,authToken:s})}}const T=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(w,{width:"35%",height:"30px"})),s("div",{class:"col-12"},s(w,{width:"70%"})),s("div",{class:"col-12"},s(w,{width:"40%"})),s("div",{class:"col-12"},s(w,{width:"40%"})),s("div",{class:"col-12"},s(w,{width:"100%"})),s("div",{class:"col-12"},s(w,{width:"80%"}))),H=class{constructor(s){t(this,s),this.insuranceUpdated=i(this,"insurance-updated",7),this.errorEvent=i(this,"error-event",7),this.isLoading=!0}async validate(){return m()}processHTMLContent(s){return d(s,[s=>u(s,"style"),s=>v(s,"a","part",_),s=>v(s,"p","part",_)])}componentWillLoad(){c(),this.analytics=new l(this),this.initializeServiceMethods(),this.getQuote&&this.fetchData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeServiceMethods(){const s=this.authToken||h.authToken;if(!s)return void this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:"Missing authToken",severity:o.ERROR});const t={authToken:s,service:new b};this.getQuote=(({authToken:s,service:t})=>async({payload:i,onSuccess:e,onError:r})=>{var c;try{const l=await t.fetchQuote(s,i);if(l.error)return r({error:n(l.error),code:a(null===(c=l.error)||void 0===c?void 0:c.code),severity:o.ERROR});e({quote:l.data})}catch(s){const t=a(null==s?void 0:s.code);return r({error:s.message||s,code:t,severity:o.ERROR})}})(t),this.toggleCoverage=(({authToken:s,service:t})=>async({quoteId:i,payload:e,onSuccess:r,onError:c})=>{var l;try{const h=await t.toggleCoverage(s,i,e);if(h.error)return c({error:n(h.error),code:a(null===(l=h.error)||void 0===l?void 0:l.code),severity:o.ERROR});r({quote:h.data})}catch(s){const t=a(null==s?void 0:s.code);return c({error:s.message||s,code:t,severity:o.ERROR})}})(t)}fetchData(){this.isLoading=!0,this.getQuote({payload:{checkout_id:this.checkoutId||h.checkoutId,policy_type:"season_interruption",primary_identity:{state:this.primaryIdentityState,email:this.primaryIdentityEmailAddress,first_name:this.primaryIdentityFirstName,last_name:this.primaryIdentityLastName,postal_code:this.primaryIdentityPostalCode,country:this.primaryIdentityCountry},policy_attributes:{insurable_amount:this.policyAttributesInsurableAmount,start_date:this.policyAttributesStartDate,end_date:this.policyAttributesEndDate,covered_identity:{first_name:this.coveredIdentityFirstName,last_name:this.coveredIdentityLastName}}},onSuccess:({quote:s})=>{this.quote=s,this.quote.product.description=this.processHTMLContent(this.quote.product.description),this.quote.product.legal_disclaimer=this.processHTMLContent(this.quote.product.legal_disclaimer),f[s.policy_type]=s.accepted,this.isLoading=!1},onError:({error:s,code:t,severity:i})=>{this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}onChangeHandler(s,t){this.accepted=t,y[this.quote.policy_type]=!1,this.toggleCoverage({quoteId:this.quote.id,payload:{accepted:this.accepted},onSuccess:()=>{this.insuranceUpdated.emit(),f[this.quote.policy_type]=this.accepted},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}get error(){var s;return y[null===(s=this.quote)||void 0===s?void 0:s.policy_type]}render(){var t,i,e,o;return h&&!1===h.insuranceEnabled?(console.warn("[justifi-season-interruption-insurance] Insurance is disabled for this checkout (payment_settings.insurance_payments=false)."),null):s(k,null,this.isLoading?s(T,null):s("div",null,s(j,{text:null===(t=this.quote)||void 0===t?void 0:t.product.title,class:"fs-5 fw-bold pb-3"}),s("small",{part:_,innerHTML:null===(i=this.quote)||void 0===i?void 0:i.product.description}),s("form-control-radio",{label:`Accept coverage for ${p(null===(e=this.quote)||void 0===e?void 0:e.total_cents)}`,name:"opt-in",value:"true",checked:"true"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),s("form-control-radio",{label:"Decline coverage",name:"opt-in",value:"false",checked:"false"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),s("div",{class:"invalid-feedback",style:{display:this.error?"block":"none"},part:g},"Please select an option"),s("small",{part:_,innerHTML:null===(o=this.quote)||void 0===o?void 0:o.product.legal_disclaimer})))}};export{H as justifi_season_interruption_insurance}
@@ -1 +1 @@
1
- import{r as s,c as t,h as i}from"./p-CV0Pyo1O.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as a}from"./p-CbTf_N6u.js";import{P as p}from"./p-8Wa_-5QM.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{e as n}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m}from"./p-DYGIC0QH.js";import{m as u,S as j}from"./p-eEJMJXTG.js";import{S as d}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{d as f}from"./p-CJZ09QNH.js";import"./p-D4eE0MBI.js";import"./p-55QcjheA.js";import"./p-MeSAYDNh.js";import"./p-D8GTwl9v.js";import"./p-DsT0m0mo.js";import"./p-DO4RBao8.js";import"./p-C4FLe2pT.js";const l=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.errorMessage=null,this.columns=f,this.handleOnError=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){e(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const s={id:this.accountId,authToken:this.authToken,service:new p};this.getPayouts=(({id:s,authToken:t,service:i})=>async({params:r,onSuccess:e,onError:a})=>{var p,m;try{const u=await i.fetchPayouts(s,t,r);if(u.error)return a({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const s=Object.assign({},u.page_info);e({payouts:(null===(p=u.data)||void 0===p?void 0:p.map((s=>new n(s))))||[],pagingInfo:s})}}catch(s){const t=c(null==s?void 0:s.code);return a({error:s.message||s,code:t,severity:o.ERROR})}})(s),this.getPayoutCSV=m(s)}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({primaryAccountId:this.accountId,authToken:this.authToken,service:new j}))}render(){return i(d,{key:"482b4781f039e885ce1782e2817739fbc79994e5"},i("payouts-list-core",{key:"f38ce3000c1b7bc7f93aa5a1a4e87858f39d1456",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{l as justifi_payouts_list}
1
+ import{r as s,c as t,h as i}from"./p-CV0Pyo1O.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as a}from"./p-eEJvKFFX.js";import{P as p}from"./p-8Wa_-5QM.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{e as n}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m}from"./p-DYGIC0QH.js";import{m as u,S as j}from"./p-eEJMJXTG.js";import{S as d}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{d as f}from"./p-CJZ09QNH.js";import"./p-CfQ5vkQ3.js";import"./p-55QcjheA.js";import"./p-MeSAYDNh.js";import"./p-D8GTwl9v.js";import"./p-DsT0m0mo.js";import"./p-DO4RBao8.js";import"./p-C4FLe2pT.js";const l=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.errorMessage=null,this.columns=f,this.handleOnError=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){e(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const s={id:this.accountId,authToken:this.authToken,service:new p};this.getPayouts=(({id:s,authToken:t,service:i})=>async({params:r,onSuccess:e,onError:a})=>{var p,m;try{const u=await i.fetchPayouts(s,t,r);if(u.error)return a({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const s=Object.assign({},u.page_info);e({payouts:(null===(p=u.data)||void 0===p?void 0:p.map((s=>new n(s))))||[],pagingInfo:s})}}catch(s){const t=c(null==s?void 0:s.code);return a({error:s.message||s,code:t,severity:o.ERROR})}})(s),this.getPayoutCSV=m(s)}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({primaryAccountId:this.accountId,authToken:this.authToken,service:new j}))}render(){return i(d,{key:"482b4781f039e885ce1782e2817739fbc79994e5"},i("payouts-list-core",{key:"f38ce3000c1b7bc7f93aa5a1a4e87858f39d1456",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{l as justifi_payouts_list}
@@ -1 +1 @@
1
- import{r as t,c as e,h as i,g as s,H as a}from"./p-CV0Pyo1O.js";import{S as r}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as n,J as d}from"./p-CbTf_N6u.js";import{w as o,c}from"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{a as h,C as l}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as f}from"./p-Daew0gTO.js";import{P as u}from"./p-DkoufM1t.js";import{S as b}from"./p-DqVU8ohH.js";import{b as m}from"./p-MeSAYDNh.js";import{B as p}from"./p-DFiTyYE9.js";import{u as y}from"./p-C4FLe2pT.js";import"./p-D4eE0MBI.js";import"./p-55QcjheA.js";import"./p-D8GTwl9v.js";const v=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click",7),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return i(r,{key:"1ae40f787970160e38b72f917bda96f480d2a890"},i("div",{key:"2130596c8294cc38365e6126806735da0f93ef4a",class:`radio-list-item p-3 ${this.class||""}`,part:y,onClick:this.handleClick,hidden:this.hidden},i("form-control-radio",{key:"7d5524f518430f2bfd1c9863f354318929353cfb",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},k={[u.NEW_BANK_ACCOUNT]:"New bank account",[u.NEW_CARD]:"New credit or debit card"},g="Payment form not ready",w="Validation error",j=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.submitEvent=e(this,"submit-event",7),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){n(),this.analytics=new d(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,f.selectedPaymentMethod={type:t.detail}}async fillBillingForm(t){var e;null===(e=this.billingFormRef)||void 0===e||e.fill(t)}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:w}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(h.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:h.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:g}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||f.authToken,account:this.accountId||f.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||f.authToken||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||f.accountId||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Account ID is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"})}setDefaultSelectedPaymentMethod(){this.selectedPaymentMethod||(this.disableCreditCard?this.disableBankAccount||(this.selectedPaymentMethod=u.NEW_BANK_ACCOUNT,f.selectedPaymentMethod={type:u.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=u.NEW_CARD,f.selectedPaymentMethod={type:u.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const t=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=t}isSlottedWithinModularCheckout(){var t;let e=null===(t=this.host)||void 0===t?void 0:t.parentElement;for(;e;){if("JUSTIFI-MODULAR-CHECKOUT"===e.tagName)return!0;e=e.parentElement}return!1}get availablePaymentMethods(){const t=[];return this.disableCreditCard||t.push(u.NEW_CARD),this.disableBankAccount||t.push(u.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:l.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",g);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||w;return{validationError:!0,error:{code:"validation_error",message:String(t),decline_code:void 0}}}return await this.performTokenization()}catch(t){return{error:t}}}async performTokenization(){var t,e;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(t=s.card)||void 0===t?void 0:t.token)||(null===(e=s.bank_account)||void 0===e?void 0:e.token),data:s}}buildPaymentMethodMetadata(t){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},t)}get paymentMethodGroupID(){return this.paymentMethodGroupId||f.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!f.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===f.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:k[t],hidden:this.shouldHideRadioInput}),e&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return i("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),i("div",{class:"mt-4"},i("justifi-billing-form",{ref:t=>this.billingFormRef=t,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===u.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:t=>this.paymentMethodFormRef=t})}render(){return i(r,{key:"bb6a2e0eec485c96a756c504a278670804be0634"},i("form",{key:"f12f65c8fbe45e86418be9d3c2ff1107e292c86d"},i("fieldset",{key:"becda77faf80fd8b1e6d967cc4ead3d4adc3b6e8"},i("div",{key:"0419c1843747f59e68800ae3e2c78096b32605b0",class:"row gy-3"},i("div",{key:"8724f40a13bc62808f6e99cced2f8d7419b22d53",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"ec9c0e2f6a85976d68e3dc939cd2826bfbd840d8",class:"col-12"},i("justifi-button",{key:"1c4b6a83c8357e15eaba071ea2fb8ba82b4c978c",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return s(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}},C=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-end"},i(b,{height:"18px",width:"120px"}),i(b,{height:"36px"}))),i("div",{class:"row"},i("div",{class:"col-12 align-content-end"},i(b,{height:"18px",width:"110px"}),i(b,{height:"36px"}))))},M=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,this.tabId=m(),n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.accountNumberIframeElement.validate(),e=await this.routingNumberIframeElement.validate();return t&&e}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.accountNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"6c1e183b7ba2c70b41e22386d74a9cf7430aa8d5"},i(C,{key:"2755f4d21f8d62919ef56909f2dc6b9211bf550d",isReady:this.isReady}),i("hidden-input",{key:"c35448285cd2b53973caa4a56c28a135e1ed7d74"}),i("div",{key:"9fae602596267bafc39b9e3e9946a289b38393b6",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"bfaee6ed0eaa2a68175f18146d56195cc1a23e91",class:"row mb-3"},i("iframe-input",{key:"7385c2582ad5b397eb2afcb9c87b789d4918542c",inputId:"accountNumber",ref:t=>this.accountNumberIframeElement=t,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber?tabId=${this.tabId}`})),i("div",{key:"effe6b1f18d5fa531f4537accfe8279b81bc7b49",class:"row"},i("iframe-input",{key:"19cc7e46d8f7cb79c70ba21f2e9c15c7665eca47",inputId:"routingNumber",ref:t=>this.routingNumberIframeElement=t,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber?tabId=${this.tabId}`}))))}},_=class{constructor(e){t(this,e)}get showSimpleCardBillingForm(){return this.paymentMethodType===u.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===u.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.getValues()}async fill(t){var e;null===(e=this.selectedFormRef)||void 0===e||e.fill(t)}async validate(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.validate()}render(){return i(a,null,i(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:t=>this.selectedFormRef=t}))}},x=class{constructor(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(r,{key:"5f92a2a58c0828c78818f0055dc2692857730788"},i(p,{key:"541fe7cc24e137cf55fc470b16f3aa8c47eee0d3",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},I=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(b,{height:"18px",width:"100px"}),i(b,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(b,{height:"18px",width:"80px"}),i(b,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(b,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(b,{height:"18px",width:"30px"}),i(b,{height:"36px"}))))},P=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,this.tabId=m(),n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),i=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return t&&e&&i&&s}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.cardNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"e204cee1fc875392b8056baf58b7234a739fffce"},i(I,{key:"3accfb88d66661ceaef39f765bb3fddfd0f98393",isReady:this.isReady}),i("hidden-input",{key:"0416ddca8b444cf8702f3fff52065bf647bd4b61"}),i("div",{key:"37c1d5014e5a6658bfd28e08e361ffaa6488f6d7",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"e2956855dfbcab38a782c22e93bd49252196baa8",class:"mb-3"},i("iframe-input",{key:"55105f1eebab4b846e1b5c55448259368a412349",inputId:"cardNumber",ref:t=>this.cardNumberIframeElement=t,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"9464b1a500a84dcaa438a9ebdad756637d14cb24",class:"row"},i("div",{key:"adc51687629fb00d26c6627e95c0228f5a4dfd11",class:"col-4 align-content-end"},i("iframe-input",{key:"52a0e5e198b6bfac00515ec220370e289674b613",inputId:"expirationMonth",ref:t=>this.expirationMonthIframeElement=t,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"1b09582711d838643db265b003ed18b18042713e",class:"col-4 align-content-end"},i("iframe-input",{key:"a1731a8dc02723398e1aae58b3812fccf62e6157",inputId:"expirationYear",ref:t=>this.expirationYearIframeElement=t,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"1e2c3205f2e0b28d036480d2c61934da5e7da620",class:"col-4 align-content-end"},i("iframe-input",{key:"b7b87360068434122f9b5a8935468240684b7a1d",inputId:"CVV",ref:t=>this.cvvIframeElement=t,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}},N=class{constructor(i){t(this,i),this.checkboxChanged=e(this,"checkboxChanged",7),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(t,e)=>{this.isChecked=e,f.savePaymentMethod=e,this.checkboxChanged.emit(this.isChecked)}}render(){return i(r,{key:"981f6a84fc14a7b687e1b6567b30fb9f861b0aa2"},i("form-control-checkbox",{key:"566f6261d19f96b87b9382b26a86b71461a29d08",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{j as internal_tokenize_payment_method,M as justifi_bank_account_form,_ as justifi_billing_form,x as justifi_button,P as justifi_card_form,v as justifi_radio_list_item,N as justifi_save_new_payment_method}
1
+ import{r as t,c as e,h as i,g as s,H as a}from"./p-CV0Pyo1O.js";import{S as r}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as n,J as d}from"./p-eEJvKFFX.js";import{w as o,c}from"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{a as h,C as l}from"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as f}from"./p-Daew0gTO.js";import{P as u}from"./p-DkoufM1t.js";import{S as b}from"./p-DqVU8ohH.js";import{b as m}from"./p-MeSAYDNh.js";import{B as p}from"./p-DFiTyYE9.js";import{u as y}from"./p-C4FLe2pT.js";import"./p-CfQ5vkQ3.js";import"./p-55QcjheA.js";import"./p-D8GTwl9v.js";const v=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click",7),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return i(r,{key:"1ae40f787970160e38b72f917bda96f480d2a890"},i("div",{key:"2130596c8294cc38365e6126806735da0f93ef4a",class:`radio-list-item p-3 ${this.class||""}`,part:y,onClick:this.handleClick,hidden:this.hidden},i("form-control-radio",{key:"7d5524f518430f2bfd1c9863f354318929353cfb",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},k={[u.NEW_BANK_ACCOUNT]:"New bank account",[u.NEW_CARD]:"New credit or debit card"},g="Payment form not ready",w="Validation error",j=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.submitEvent=e(this,"submit-event",7),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){n(),this.analytics=new d(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,f.selectedPaymentMethod={type:t.detail}}async fillBillingForm(t){var e;null===(e=this.billingFormRef)||void 0===e||e.fill(t)}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:w}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(h.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:h.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:g}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||f.authToken,account:this.accountId||f.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||f.authToken||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||f.accountId||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Account ID is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"})}setDefaultSelectedPaymentMethod(){this.selectedPaymentMethod||(this.disableCreditCard?this.disableBankAccount||(this.selectedPaymentMethod=u.NEW_BANK_ACCOUNT,f.selectedPaymentMethod={type:u.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=u.NEW_CARD,f.selectedPaymentMethod={type:u.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const t=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=t}isSlottedWithinModularCheckout(){var t;let e=null===(t=this.host)||void 0===t?void 0:t.parentElement;for(;e;){if("JUSTIFI-MODULAR-CHECKOUT"===e.tagName)return!0;e=e.parentElement}return!1}get availablePaymentMethods(){const t=[];return this.disableCreditCard||t.push(u.NEW_CARD),this.disableBankAccount||t.push(u.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:l.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",g);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||w;return{validationError:!0,error:{code:"validation_error",message:String(t),decline_code:void 0}}}return await this.performTokenization()}catch(t){return{error:t}}}async performTokenization(){var t,e;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(t=s.card)||void 0===t?void 0:t.token)||(null===(e=s.bank_account)||void 0===e?void 0:e.token),data:s}}buildPaymentMethodMetadata(t){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},t)}get paymentMethodGroupID(){return this.paymentMethodGroupId||f.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!f.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===f.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:k[t],hidden:this.shouldHideRadioInput}),e&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return i("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),i("div",{class:"mt-4"},i("justifi-billing-form",{ref:t=>this.billingFormRef=t,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===u.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:t=>this.paymentMethodFormRef=t})}render(){return i(r,{key:"bb6a2e0eec485c96a756c504a278670804be0634"},i("form",{key:"f12f65c8fbe45e86418be9d3c2ff1107e292c86d"},i("fieldset",{key:"becda77faf80fd8b1e6d967cc4ead3d4adc3b6e8"},i("div",{key:"0419c1843747f59e68800ae3e2c78096b32605b0",class:"row gy-3"},i("div",{key:"8724f40a13bc62808f6e99cced2f8d7419b22d53",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"ec9c0e2f6a85976d68e3dc939cd2826bfbd840d8",class:"col-12"},i("justifi-button",{key:"1c4b6a83c8357e15eaba071ea2fb8ba82b4c978c",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return s(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}},C=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-end"},i(b,{height:"18px",width:"120px"}),i(b,{height:"36px"}))),i("div",{class:"row"},i("div",{class:"col-12 align-content-end"},i(b,{height:"18px",width:"110px"}),i(b,{height:"36px"}))))},M=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,this.tabId=m(),n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.accountNumberIframeElement.validate(),e=await this.routingNumberIframeElement.validate();return t&&e}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.accountNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"6c1e183b7ba2c70b41e22386d74a9cf7430aa8d5"},i(C,{key:"2755f4d21f8d62919ef56909f2dc6b9211bf550d",isReady:this.isReady}),i("hidden-input",{key:"c35448285cd2b53973caa4a56c28a135e1ed7d74"}),i("div",{key:"9fae602596267bafc39b9e3e9946a289b38393b6",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"bfaee6ed0eaa2a68175f18146d56195cc1a23e91",class:"row mb-3"},i("iframe-input",{key:"7385c2582ad5b397eb2afcb9c87b789d4918542c",inputId:"accountNumber",ref:t=>this.accountNumberIframeElement=t,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber?tabId=${this.tabId}`})),i("div",{key:"effe6b1f18d5fa531f4537accfe8279b81bc7b49",class:"row"},i("iframe-input",{key:"19cc7e46d8f7cb79c70ba21f2e9c15c7665eca47",inputId:"routingNumber",ref:t=>this.routingNumberIframeElement=t,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber?tabId=${this.tabId}`}))))}},_=class{constructor(e){t(this,e)}get showSimpleCardBillingForm(){return this.paymentMethodType===u.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===u.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.getValues()}async fill(t){var e;null===(e=this.selectedFormRef)||void 0===e||e.fill(t)}async validate(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.validate()}render(){return i(a,null,i(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:t=>this.selectedFormRef=t}))}},x=class{constructor(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(r,{key:"5f92a2a58c0828c78818f0055dc2692857730788"},i(p,{key:"541fe7cc24e137cf55fc470b16f3aa8c47eee0d3",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},I=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(b,{height:"18px",width:"100px"}),i(b,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(b,{height:"18px",width:"80px"}),i(b,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(b,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(b,{height:"18px",width:"30px"}),i(b,{height:"36px"}))))},P=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,this.tabId=m(),n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),i=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return t&&e&&i&&s}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.cardNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"e204cee1fc875392b8056baf58b7234a739fffce"},i(I,{key:"3accfb88d66661ceaef39f765bb3fddfd0f98393",isReady:this.isReady}),i("hidden-input",{key:"0416ddca8b444cf8702f3fff52065bf647bd4b61"}),i("div",{key:"37c1d5014e5a6658bfd28e08e361ffaa6488f6d7",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"e2956855dfbcab38a782c22e93bd49252196baa8",class:"mb-3"},i("iframe-input",{key:"55105f1eebab4b846e1b5c55448259368a412349",inputId:"cardNumber",ref:t=>this.cardNumberIframeElement=t,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"9464b1a500a84dcaa438a9ebdad756637d14cb24",class:"row"},i("div",{key:"adc51687629fb00d26c6627e95c0228f5a4dfd11",class:"col-4 align-content-end"},i("iframe-input",{key:"52a0e5e198b6bfac00515ec220370e289674b613",inputId:"expirationMonth",ref:t=>this.expirationMonthIframeElement=t,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"1b09582711d838643db265b003ed18b18042713e",class:"col-4 align-content-end"},i("iframe-input",{key:"a1731a8dc02723398e1aae58b3812fccf62e6157",inputId:"expirationYear",ref:t=>this.expirationYearIframeElement=t,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"1e2c3205f2e0b28d036480d2c61934da5e7da620",class:"col-4 align-content-end"},i("iframe-input",{key:"b7b87360068434122f9b5a8935468240684b7a1d",inputId:"CVV",ref:t=>this.cvvIframeElement=t,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}},O=class{constructor(i){t(this,i),this.checkboxChanged=e(this,"checkboxChanged",7),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(t,e)=>{this.isChecked=e,f.savePaymentMethod=e,this.checkboxChanged.emit(this.isChecked)}}render(){return i(r,{key:"981f6a84fc14a7b687e1b6567b30fb9f861b0aa2"},i("form-control-checkbox",{key:"566f6261d19f96b87b9382b26a86b71461a29d08",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{j as internal_tokenize_payment_method,M as justifi_bank_account_form,_ as justifi_billing_form,x as justifi_button,P as justifi_card_form,v as justifi_radio_list_item,O as justifi_save_new_payment_method}
@@ -1 +1 @@
1
- import{r,c as s,h as t}from"./p-CV0Pyo1O.js";import{S as i}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as e,J as o}from"./p-CbTf_N6u.js";import{d as a}from"./p-CIh-k9yP.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as n,a as p}from"./p-Cjcsf8ku.js";import{j as c}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as m,a as h}from"./p-D2muobcE.js";import{A as d}from"./p-55QcjheA.js";import"./p-D4eE0MBI.js";import"./p-C4FLe2pT.js";import"./p-MeSAYDNh.js";import"./p-DO4RBao8.js";import"./p-D8GTwl9v.js";const l=d();class u{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const j=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event",7),this.errorMessage=null,this.columns=a,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){e(),this.analytics=new o(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:i,onSuccess:e,onError:o,final:a})=>{var p,d;try{const a=await t.fetchTerminalOrders(r,s,i);if(a.error)return o({error:h(a.error),code:m(null===(d=a.error)||void 0===d?void 0:d.code),severity:n.ERROR});{const r=Object.assign({},a.page_info);e({terminalOrders:(null===(p=a.data)||void 0===p?void 0:p.map((r=>new c(r))))||[],pagingInfo:r})}}catch(r){const s=m(null==r?void 0:r.code);return o({error:r.message||r,code:s,severity:n.ERROR})}finally{return a()}})({id:this.accountId,authToken:this.authToken,service:new u}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return t(i,{key:"19a055907283ae2a126bdb2a509c3a4a991521f2"},t("terminal-orders-list-core",{key:"04df9d1ce1cca14b07e879137abbced011d02486",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{j as justifi_terminal_orders_list}
1
+ import{r,c as s,h as t}from"./p-CV0Pyo1O.js";import{S as i}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as e,J as o}from"./p-eEJvKFFX.js";import{d as a}from"./p-CIh-k9yP.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as n,a as p}from"./p-Cjcsf8ku.js";import{j as c}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as m,a as h}from"./p-D2muobcE.js";import{A as d}from"./p-55QcjheA.js";import"./p-CfQ5vkQ3.js";import"./p-C4FLe2pT.js";import"./p-MeSAYDNh.js";import"./p-DO4RBao8.js";import"./p-D8GTwl9v.js";const l=d();class j{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const u=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event",7),this.errorMessage=null,this.columns=a,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){e(),this.analytics=new o(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:i,onSuccess:e,onError:o,final:a})=>{var p,d;try{const a=await t.fetchTerminalOrders(r,s,i);if(a.error)return o({error:h(a.error),code:m(null===(d=a.error)||void 0===d?void 0:d.code),severity:n.ERROR});{const r=Object.assign({},a.page_info);e({terminalOrders:(null===(p=a.data)||void 0===p?void 0:p.map((r=>new c(r))))||[],pagingInfo:r})}}catch(r){const s=m(null==r?void 0:r.code);return o({error:r.message||r,code:s,severity:n.ERROR})}finally{return a()}})({id:this.accountId,authToken:this.authToken,service:new j}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return t(i,{key:"19a055907283ae2a126bdb2a509c3a4a991521f2"},t("terminal-orders-list-core",{key:"04df9d1ce1cca14b07e879137abbced011d02486",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{u as justifi_terminal_orders_list}
@@ -1 +1 @@
1
- import{r as e,c as t,h as i}from"./p-CV0Pyo1O.js";import{c as a,J as s}from"./p-CbTf_N6u.js";import{c as d}from"./p-Daew0gTO.js";import{c}from"./p-C4FLe2pT.js";import{S as o}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{P as f}from"./p-DkoufM1t.js";import"./p-D4eE0MBI.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const h=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event",7),this.loadedEvent=t(this,"loaded",7),this.submitEvent=t(this,"submit-event",7),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){a(),this.analytics=new s(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){console.error("[justifi-checkout] error-event received",null==e?void 0:e.detail),this.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=this.disableBnpl?e.detail.availablePaymentMethodTypes.filter((e=>e!==f.SEZZLE)):e.detail.availablePaymentMethodTypes}async fillBillingForm(e){var t;d.billingFormFields=e,null===(t=this.tokenizePaymentMethodRef)||void 0===t||t.fillBillingForm(e)}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;this.isSubmitting=!0,null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"6bbc4c4997d14ac9040b8f88075a7e9b53208d4c"},i("justifi-modular-checkout",{key:"9b11e7df277e5e9f70cd8928f865a2e62cfc8293",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId,preCompleteHook:this.preCompleteHook},i("div",{key:"c64981c31fd2d022f886b0613bd47bd0b0fe5f2a",class:"row gy-3 jfi-checkout-core"},i("div",{key:"8f01af25b281a19f7fc83451a44f63836efadc20",class:"col-12",part:c},i("justifi-header",{key:"d729ed0b26c94e74d8ce824fcf97bd3002e3a9d0",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"9cc9863b1dd2531bda52e609bba5c7c8f9883cb1"},i("justifi-checkout-summary",{key:"00f36de593e245982bfe03c8867881fedfb7d43f"}))),i("div",{key:"3fe5390d7b8b2fbcdbfff4b71d4b7c43ddae9ff6",class:"col-12 mt-4"},i("slot",{key:"84fa5a7e7772124d7fa61a9317499618850eb0bb",name:"insurance"})),i("div",{key:"c8d1553c6041c0e000eab9dc953a23aa089a3f90",class:"col-12 mt-4"},i("justifi-header",{key:"a08fc163ba437f767ab88d78ac55ae003b09a567",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"bff5fc2986d37bbe49a5253d43db55663ee7be74",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"f5ca969400444639b09e423b154e47abf89c731f",class:"d-flex flex-column"},i("section",{key:"b70209321ebefd161ae3113293c62fe953913f2e"},i("div",{key:"4df7539a9b8d6b52d47ad32974a59ab2d366b4b2"},this.availablePaymentMethods.includes(f.APPLE_PAY)&&i("div",{key:"023deb9a1d025e36cc2b07c3ea8144e0068ea470",class:"mb-3"},i("justifi-apple-pay",{key:"4e52440f329bae25194e71fa30190218f5c1cecb"})),this.availablePaymentMethods.includes(f.GOOGLE_PAY)&&i("div",{key:"83e12debb25e0ef095ca40d87054411396238754",class:"mb-3"},i("justifi-google-pay",{key:"ed6312e39ff4a98c819cf1853f416c6fbf845323",ref:e=>this.googlePayRef=e})),i("justifi-saved-payment-methods",{key:"e059fda26ec54c4f908754663fa23f26c3df8f0c"}),this.availablePaymentMethods.includes(f.SEZZLE)&&i("justifi-radio-list-item",{key:"3d836539d5850abfd956b39bede6efad5954bdad",name:"paymentMethodType",value:f.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===f.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(f.PLAID)&&!this.disableBnpl&&i("justifi-radio-list-item",{key:"ac0ac64e9f7586764e3f5671c74794c80ffcff54",name:"paymentMethodType",value:f.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===f.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("internal-tokenize-payment-method",{key:"894e7a5bfef2eefa5d045928bb6fab3b1f39bd5e",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"2121952545d38693f11426ef8146b39956d4f427",class:"mt-4"},i("justifi-button",{key:"5e7cf3c699048943df68c0506a34617d0b14bf07",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{h as justifi_checkout}
1
+ import{r as e,c as t,h as i}from"./p-CV0Pyo1O.js";import{c as a,J as s}from"./p-eEJvKFFX.js";import{c as d}from"./p-Daew0gTO.js";import{c}from"./p-C4FLe2pT.js";import{S as o}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{P as f}from"./p-DkoufM1t.js";import"./p-CfQ5vkQ3.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const h=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event",7),this.loadedEvent=t(this,"loaded",7),this.submitEvent=t(this,"submit-event",7),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){a(),this.analytics=new s(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){console.error("[justifi-checkout] error-event received",null==e?void 0:e.detail),this.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=this.disableBnpl?e.detail.availablePaymentMethodTypes.filter((e=>e!==f.SEZZLE)):e.detail.availablePaymentMethodTypes}async fillBillingForm(e){var t;d.billingFormFields=e,null===(t=this.tokenizePaymentMethodRef)||void 0===t||t.fillBillingForm(e)}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;this.isSubmitting=!0,null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"6bbc4c4997d14ac9040b8f88075a7e9b53208d4c"},i("justifi-modular-checkout",{key:"9b11e7df277e5e9f70cd8928f865a2e62cfc8293",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId,preCompleteHook:this.preCompleteHook},i("div",{key:"c64981c31fd2d022f886b0613bd47bd0b0fe5f2a",class:"row gy-3 jfi-checkout-core"},i("div",{key:"8f01af25b281a19f7fc83451a44f63836efadc20",class:"col-12",part:c},i("justifi-header",{key:"d729ed0b26c94e74d8ce824fcf97bd3002e3a9d0",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"9cc9863b1dd2531bda52e609bba5c7c8f9883cb1"},i("justifi-checkout-summary",{key:"00f36de593e245982bfe03c8867881fedfb7d43f"}))),i("div",{key:"3fe5390d7b8b2fbcdbfff4b71d4b7c43ddae9ff6",class:"col-12 mt-4"},i("slot",{key:"84fa5a7e7772124d7fa61a9317499618850eb0bb",name:"insurance"})),i("div",{key:"c8d1553c6041c0e000eab9dc953a23aa089a3f90",class:"col-12 mt-4"},i("justifi-header",{key:"a08fc163ba437f767ab88d78ac55ae003b09a567",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"bff5fc2986d37bbe49a5253d43db55663ee7be74",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"f5ca969400444639b09e423b154e47abf89c731f",class:"d-flex flex-column"},i("section",{key:"b70209321ebefd161ae3113293c62fe953913f2e"},i("div",{key:"4df7539a9b8d6b52d47ad32974a59ab2d366b4b2"},this.availablePaymentMethods.includes(f.APPLE_PAY)&&i("div",{key:"023deb9a1d025e36cc2b07c3ea8144e0068ea470",class:"mb-3"},i("justifi-apple-pay",{key:"4e52440f329bae25194e71fa30190218f5c1cecb"})),this.availablePaymentMethods.includes(f.GOOGLE_PAY)&&i("div",{key:"83e12debb25e0ef095ca40d87054411396238754",class:"mb-3"},i("justifi-google-pay",{key:"ed6312e39ff4a98c819cf1853f416c6fbf845323",ref:e=>this.googlePayRef=e})),i("justifi-saved-payment-methods",{key:"e059fda26ec54c4f908754663fa23f26c3df8f0c"}),this.availablePaymentMethods.includes(f.SEZZLE)&&i("justifi-radio-list-item",{key:"3d836539d5850abfd956b39bede6efad5954bdad",name:"paymentMethodType",value:f.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===f.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(f.PLAID)&&!this.disableBnpl&&i("justifi-radio-list-item",{key:"ac0ac64e9f7586764e3f5671c74794c80ffcff54",name:"paymentMethodType",value:f.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===f.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("internal-tokenize-payment-method",{key:"894e7a5bfef2eefa5d045928bb6fab3b1f39bd5e",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"2121952545d38693f11426ef8146b39956d4f427",class:"mt-4"},i("justifi-button",{key:"5e7cf3c699048943df68c0506a34617d0b14bf07",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{h as justifi_checkout}
@@ -1 +1 @@
1
- import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as s,a as i}from"./p-Cjcsf8ku.js";import{h as r}from"./p-BiNakvsa.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as o,J as c}from"./p-CbTf_N6u.js";import{g as p,a as h}from"./p-D2muobcE.js";import{P as d}from"./p-B_KHnbK8.js";import{T as f,l,a as u,b as m,c as y,d as b,e as _,f as g,g as j,h as T,i as k,j as w,k as v}from"./p-5mt2ek0H.js";import{S as C}from"./p-BqNNwq6C.js";import{T as D}from"./p-CZfYo5-1.js";import{a as F}from"./p-MeSAYDNh.js";import{V as S,W as P}from"./p-C4FLe2pT.js";import"./p-D8GTwl9v.js";import"./p-D4eE0MBI.js";import"./p-55QcjheA.js";import"./p-DyETkJs3.js";const R={created_at:()=>e("th",{part:S,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>e("th",{part:S,scope:"col",title:"The type of each transaction"},"Type"),id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>e("th",{part:S,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>e("th",{part:S,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>e("th",{part:S,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>e("th",{part:S,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>e("th",{part:S,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",platform_fee:"Platform Fee",platform_fee_return:"Platform Fee Return",processing_fee:"Processing Fee",processing_fee_return:"Processing Fee Return",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},E={created_at:(t,a)=>e("td",{part:P(a)},e("div",{class:"fw-bold"},F(t.created_at,{showDisplayDate:!0})),e("div",{class:"fw-bold"},F(t.created_at,{showTime:!0}))),type:(t,a)=>e("td",{part:P(a)},I[t.payment_balance_txn_type]),id:(t,a)=>e("td",{part:P(a)},t.id),amount:(t,a)=>e("td",{part:P(a),class:"text-end"},t.formattedPaymentAmount(t.amount)),balance:(t,a)=>e("td",{part:P(a),class:"text-end"},t.formattedPaymentAmount(t.balance)),currency:(t,a)=>e("td",{part:P(a)},t.currency),financial_transaction_id:(t,a)=>e("td",{part:P(a)},t.financial_transaction_id),payment_id:(t,a)=>e("td",{part:P(a)},t.payment_id),payment_balance_txn_type:(t,a)=>e("td",{part:P(a)},t.payment_balance_txn_type),source_id:(t,a)=>e("td",{part:P(a)},t.source_id),source_type:(t,a)=>e("td",{part:P(a)},t.source_type)},x=class{constructor(e){t(this,e),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=e=>{this.pagingParams={before_cursor:e},this.clickEvent.emit({name:D.previous})},this.handleClickNext=e=>{this.pagingParams={after_cursor:e},this.clickEvent.emit({name:D.next})},this.rowClickHandler=e=>{const t=e.target.closest("tr").dataset.rowEntityId;if(!t)return;const a=this.balanceTransactions.find((e=>e.id===t));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,R,E),o(),this.analytics=new c(this),this.initializeApi()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeApi()}handleError(e,t,a){this.isLoading=!1,this.errorEvent.emit({errorCode:e,message:t,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:e,authToken:t,service:a})=>async({params:i,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(e,t,i);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:s.ERROR}):n({balanceTransactions:c.data.map((e=>new r(e))),pagingInfo:Object.assign({},c.page_info)})}catch(e){const t=p(null==e?void 0:e.code);o({error:h(e),code:t,severity:s.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:e,pagingInfo:t})=>{this.balanceTransactions=e,this.paging=t,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e.message,this.handleError(e,t,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((e=>e.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 e(C,{key:"7aaa611cf9d23ff9244d8df54e57daa3ec08a635"},e(l,{key:"d3f5244cfe909030c6072c7fdc4a5740029a4c17"},e(u,{key:"b0dc2044e5ee11b5d6a8298ed219c33f2bc42a35"},e(m,{key:"6a91d2b6968a6e969be3861c85b829c1ca5f899e"},e(y,{key:"ae84fd9d80b84054bfa1012137affa5c83b2be39"},this.transactionsTable.columnData.map((e=>e)))),e(b,{key:"6a5cdec3190bb80ed3f78f295d07271838260fce"},e(_,{key:"9fef843fa67a8049d77432d75f89446a2abe5ccc",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),e(g,{key:"3be23e217a98d0b2727dabc783134996ef0f9084",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),e(j,{key:"791ff61e65fb2f4e6a83f7d5142565b4a89106b5",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((t,a)=>e(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},t)))),this.paging&&e(k,{key:"898e2236fbed139f8196452463e3f248c01608d4"},e(w,{key:"9b416e1f6122d095b7516816ed686fe116479512"},e(v,{key:"6a12ce5ee3c5f28058ee5796cb174ef9fa4505b5",colSpan:this.transactionsTable.columnData.length},e("pagination-menu",{key:"06984f04a928213ecbb6b3bf5acd3cb3a48e901f",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{x as justifi_payment_transactions_list}
1
+ import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as s,a as i}from"./p-Cjcsf8ku.js";import{h as r}from"./p-BiNakvsa.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as o,J as c}from"./p-eEJvKFFX.js";import{g as p,a as h}from"./p-D2muobcE.js";import{P as d}from"./p-B_KHnbK8.js";import{T as f,l,a as u,b as m,c as y,d as b,e as _,f as g,g as j,h as k,i as T,j as w,k as v}from"./p-5mt2ek0H.js";import{S as C}from"./p-BqNNwq6C.js";import{T as D}from"./p-CZfYo5-1.js";import{a as F}from"./p-MeSAYDNh.js";import{V as S,W as P}from"./p-C4FLe2pT.js";import"./p-D8GTwl9v.js";import"./p-CfQ5vkQ3.js";import"./p-55QcjheA.js";import"./p-DyETkJs3.js";const R={created_at:()=>e("th",{part:S,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>e("th",{part:S,scope:"col",title:"The type of each transaction"},"Type"),id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>e("th",{part:S,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>e("th",{part:S,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>e("th",{part:S,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>e("th",{part:S,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>e("th",{part:S,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>e("th",{part:S,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},E={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",platform_fee:"Platform Fee",platform_fee_return:"Platform Fee Return",processing_fee:"Processing Fee",processing_fee_return:"Processing Fee Return",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},I={created_at:(t,a)=>e("td",{part:P(a)},e("div",{class:"fw-bold"},F(t.created_at,{showDisplayDate:!0})),e("div",{class:"fw-bold"},F(t.created_at,{showTime:!0}))),type:(t,a)=>e("td",{part:P(a)},E[t.payment_balance_txn_type]),id:(t,a)=>e("td",{part:P(a)},t.id),amount:(t,a)=>e("td",{part:P(a),class:"text-end"},t.formattedPaymentAmount(t.amount)),balance:(t,a)=>e("td",{part:P(a),class:"text-end"},t.formattedPaymentAmount(t.balance)),currency:(t,a)=>e("td",{part:P(a)},t.currency),financial_transaction_id:(t,a)=>e("td",{part:P(a)},t.financial_transaction_id),payment_id:(t,a)=>e("td",{part:P(a)},t.payment_id),payment_balance_txn_type:(t,a)=>e("td",{part:P(a)},t.payment_balance_txn_type),source_id:(t,a)=>e("td",{part:P(a)},t.source_id),source_type:(t,a)=>e("td",{part:P(a)},t.source_type)},x=class{constructor(e){t(this,e),this.clickEvent=a(this,"click-event",7),this.errorEvent=a(this,"error-event",7),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=e=>{this.pagingParams={before_cursor:e},this.clickEvent.emit({name:D.previous})},this.handleClickNext=e=>{this.pagingParams={after_cursor:e},this.clickEvent.emit({name:D.next})},this.rowClickHandler=e=>{const t=e.target.closest("tr").dataset.rowEntityId;if(!t)return;const a=this.balanceTransactions.find((e=>e.id===t));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,R,I),o(),this.analytics=new c(this),this.initializeApi()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeApi()}handleError(e,t,a){this.isLoading=!1,this.errorEvent.emit({errorCode:e,message:t,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:e,authToken:t,service:a})=>async({params:i,onSuccess:n,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(e,t,i);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:s.ERROR}):n({balanceTransactions:c.data.map((e=>new r(e))),pagingInfo:Object.assign({},c.page_info)})}catch(e){const t=p(null==e?void 0:e.code);o({error:h(e),code:t,severity:s.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:e,pagingInfo:t})=>{this.balanceTransactions=e,this.paging=t,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e.message,this.handleError(e,t,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((e=>e.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 e(C,{key:"7aaa611cf9d23ff9244d8df54e57daa3ec08a635"},e(l,{key:"d3f5244cfe909030c6072c7fdc4a5740029a4c17"},e(u,{key:"b0dc2044e5ee11b5d6a8298ed219c33f2bc42a35"},e(m,{key:"6a91d2b6968a6e969be3861c85b829c1ca5f899e"},e(y,{key:"ae84fd9d80b84054bfa1012137affa5c83b2be39"},this.transactionsTable.columnData.map((e=>e)))),e(b,{key:"6a5cdec3190bb80ed3f78f295d07271838260fce"},e(_,{key:"9fef843fa67a8049d77432d75f89446a2abe5ccc",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),e(g,{key:"3be23e217a98d0b2727dabc783134996ef0f9084",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),e(j,{key:"791ff61e65fb2f4e6a83f7d5142565b4a89106b5",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((t,a)=>e(k,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},t)))),this.paging&&e(T,{key:"898e2236fbed139f8196452463e3f248c01608d4"},e(w,{key:"9b416e1f6122d095b7516816ed686fe116479512"},e(v,{key:"6a12ce5ee3c5f28058ee5796cb174ef9fa4505b5",colSpan:this.transactionsTable.columnData.length},e("pagination-menu",{key:"06984f04a928213ecbb6b3bf5acd3cb3a48e901f",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{x as justifi_payment_transactions_list}
@@ -0,0 +1 @@
1
+ var e={name:"@justifi/webcomponents",version:"6.10.1"};export{e as p}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-CV0Pyo1O.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as a}from"./p-CbTf_N6u.js";import{T as n}from"./p-6V4e6Fb_.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{f as p}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m,S as d}from"./p-eEJMJXTG.js";import{S as u}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{d as l}from"./p-DyJ1zSHJ.js";import"./p-D4eE0MBI.js";import"./p-55QcjheA.js";import"./p-MeSAYDNh.js";import"./p-D8GTwl9v.js";import"./p-DO4RBao8.js";import"./p-C4FLe2pT.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.errorMessage=null,this.columns=l,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new a(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:r,onSuccess:o,onError:a})=>{var n,m;try{const d=await i.fetchTerminals(t,s,r);if(d.error)return a({error:h(d.error),code:c(null===(m=d.error)||void 0===m?void 0:m.code),severity:e.ERROR});{const t=Object.assign({},d.page_info);o({terminals:(null===(n=d.data)||void 0===n?void 0:n.map((t=>new p(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return a({error:t.message||t,code:s,severity:e.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new n}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new d}))}render(){return i(u,{key:"dde640eb10f9e0f8e817afed66410042642b47e6"},i("terminals-list-core",{key:"7e6a67f075c10cdedcd6e133aeedcd2fa9ba45ad",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-CV0Pyo1O.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as a}from"./p-eEJvKFFX.js";import{T as n}from"./p-6V4e6Fb_.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{f as p}from"./p-BiNakvsa.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m,S as d}from"./p-eEJMJXTG.js";import{S as u}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{d as l}from"./p-DyJ1zSHJ.js";import"./p-CfQ5vkQ3.js";import"./p-55QcjheA.js";import"./p-MeSAYDNh.js";import"./p-D8GTwl9v.js";import"./p-DO4RBao8.js";import"./p-C4FLe2pT.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.errorMessage=null,this.columns=l,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new a(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:r,onSuccess:o,onError:a})=>{var n,m;try{const d=await i.fetchTerminals(t,s,r);if(d.error)return a({error:h(d.error),code:c(null===(m=d.error)||void 0===m?void 0:m.code),severity:e.ERROR});{const t=Object.assign({},d.page_info);o({terminals:(null===(n=d.data)||void 0===n?void 0:n.map((t=>new p(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return a({error:t.message||t,code:s,severity:e.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new n}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new d}))}render(){return i(u,{key:"dde640eb10f9e0f8e817afed66410042642b47e6"},i("terminals-list-core",{key:"7e6a67f075c10cdedcd6e133aeedcd2fa9ba45ad",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}