@justifi/webcomponents 6.0.6-rc.1 → 6.0.6-rc.3

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 (89) hide show
  1. package/dist/cjs/{check-pkg-version-BqQyunnf.js → check-pkg-version-D2O-HBMD.js} +1 -1
  2. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  3. package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +9 -10
  4. package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +2 -2
  5. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  6. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  7. package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
  9. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  10. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
  13. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  18. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
  19. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  20. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  21. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/cjs/{package-CeJ5geYu.js → package-B8AreocB.js} +1 -1
  26. package/dist/cjs/webcomponents.cjs.js +1 -1
  27. package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +43 -1
  28. package/dist/collection/ui-components/apple-pay-button.js +4 -7
  29. package/dist/docs.json +59 -1
  30. package/dist/esm/{check-pkg-version-DW45blqY.js → check-pkg-version-f6satvrI.js} +1 -1
  31. package/dist/esm/hidden-input_2.entry.js +1 -1
  32. package/dist/esm/justifi-apple-pay_8.entry.js +9 -10
  33. package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +2 -2
  34. package/dist/esm/justifi-business-details.entry.js +2 -2
  35. package/dist/esm/justifi-business-form.entry.js +2 -2
  36. package/dist/esm/justifi-checkout.entry.js +2 -2
  37. package/dist/esm/justifi-checkouts-list.entry.js +2 -2
  38. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  39. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  40. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  41. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  42. package/dist/esm/justifi-payment-details.entry.js +2 -2
  43. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  44. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  45. package/dist/esm/justifi-payments-list.entry.js +2 -2
  46. package/dist/esm/justifi-payout-details.entry.js +2 -2
  47. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  48. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  49. package/dist/esm/justifi-refund-payment.entry.js +2 -2
  50. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  51. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  52. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/esm/{package-BXUY63ga.js → package-DOrxxtCs.js} +1 -1
  55. package/dist/esm/webcomponents.js +1 -1
  56. package/dist/module/apple-pay.js +9 -8
  57. package/dist/module/package.js +1 -1
  58. package/dist/types/components/modular-checkout/sub-components/apple-pay.d.ts +2 -0
  59. package/dist/types/components.d.ts +16 -0
  60. package/dist/webcomponents/{p-ea2cbf37.entry.js → p-17abfc00.entry.js} +1 -1
  61. package/dist/webcomponents/{p-d403bdc0.entry.js → p-24817d58.entry.js} +1 -1
  62. package/dist/webcomponents/{p-55903cde.entry.js → p-293c4517.entry.js} +1 -1
  63. package/dist/webcomponents/{p-220d8503.entry.js → p-2dfbbc7a.entry.js} +1 -1
  64. package/dist/webcomponents/{p-5cb22cfb.entry.js → p-38668717.entry.js} +1 -1
  65. package/dist/webcomponents/{p-9d611395.entry.js → p-3ff3bb90.entry.js} +1 -1
  66. package/dist/webcomponents/{p-a8446044.entry.js → p-451c8e1b.entry.js} +1 -1
  67. package/dist/webcomponents/{p-9c8fb92f.entry.js → p-51ac9f40.entry.js} +1 -1
  68. package/dist/webcomponents/p-6df72e0f.entry.js +1 -0
  69. package/dist/webcomponents/{p-e9b2591b.entry.js → p-7f018623.entry.js} +1 -1
  70. package/dist/webcomponents/{p-0d3904cb.entry.js → p-88fcb530.entry.js} +1 -1
  71. package/dist/webcomponents/{p-268a6e14.entry.js → p-8be7fbf6.entry.js} +1 -1
  72. package/dist/webcomponents/{p-569c7dcc.entry.js → p-8f84883e.entry.js} +1 -1
  73. package/dist/webcomponents/{p-9773e1e9.entry.js → p-96694f7d.entry.js} +1 -1
  74. package/dist/webcomponents/{p-CoBppUkq.js → p-Cq_f4KEI.js} +1 -1
  75. package/dist/webcomponents/p-DOrxxtCs.js +1 -0
  76. package/dist/webcomponents/{p-c44fcff6.entry.js → p-a5fc94fe.entry.js} +1 -1
  77. package/dist/webcomponents/p-abbe97eb.entry.js +1 -0
  78. package/dist/webcomponents/{p-58f7c4bd.entry.js → p-be5c5154.entry.js} +1 -1
  79. package/dist/webcomponents/{p-ee90bbd1.entry.js → p-bf5593bb.entry.js} +1 -1
  80. package/dist/webcomponents/{p-4b57765c.entry.js → p-c9cfab30.entry.js} +1 -1
  81. package/dist/webcomponents/{p-dfb2e55b.entry.js → p-cc5c6425.entry.js} +1 -1
  82. package/dist/webcomponents/p-cf26936c.entry.js +1 -0
  83. package/dist/webcomponents/{p-67788df5.entry.js → p-d2b922cc.entry.js} +1 -1
  84. package/dist/webcomponents/webcomponents.esm.js +1 -1
  85. package/package.json +1 -1
  86. package/dist/webcomponents/p-1f82f0cc.entry.js +0 -1
  87. package/dist/webcomponents/p-80a4fba7.entry.js +0 -1
  88. package/dist/webcomponents/p-BXUY63ga.js +0 -1
  89. package/dist/webcomponents/p-e9865d1d.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{h as e,r as t,c as i,H as s,g as n}from"./p-DOjVAAtq.js";import{A as o}from"./p-DdZLLkQ5.js";import{S as a}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{S as r}from"./p-T2yENPvU.js";import{c as l,o as c,g as h,a as d}from"./p-DGsXKF67.js";import{D as p,r as u}from"./p-xDbRW9xn.js";import{f as y}from"./p-Bgnhf5c9.js";import{H as m}from"./p-RQzxYnz_.js";import{H as v,b as M,h as f,i as b}from"./p-wQgEEOq_.js";import{H as g}from"./p-BoQ6_4Ks.js";import{J as k,c as A}from"./p-CoBppUkq.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as w,a as P,b as j}from"./p-Cjcsf8ku.js";import{I as T}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as C,a as N}from"./p-D2muobcE.js";import{C as S}from"./p-CEk3bv0x.js";import{P as E,a as I,b as D}from"./p-DCIW8z1f.js";import{C as O}from"./p-ZpPDShvP.js";import"./p-DdMxswn1.js";import"./p-BXUY63ga.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";var x,L,z,_,R;!function(e){e.STATUS_SUCCESS="STATUS_SUCCESS",e.STATUS_FAILURE="STATUS_FAILURE"}(x||(x={})),function(e){e.PLAIN="plain",e.BUY="buy",e.SET_UP="set-up",e.DONATE="donate",e.CHECK_OUT="check-out",e.BOOK="book",e.SUBSCRIBE="subscribe"}(L||(L={})),function(e){e.BLACK="black",e.WHITE="white",e.WHITE_OUTLINE="white-outline"}(z||(z={})),function(e){e.SUPPORTS_3DS="supports3DS",e.SUPPORTS_EMV="supportsEMV",e.SUPPORTS_CREDIT="supportsCredit",e.SUPPORTS_DEBIT="supportsDebit"}(_||(_={}));class B{constructor(e){this.merchantIdentifier=e.merchantIdentifier,this.displayName=e.displayName,this.initiative=e.initiative,this.initiativeContext=e.initiativeContext,this.buttonType=e.buttonType||L.PLAIN,this.buttonStyle=e.buttonStyle||z.BLACK,this.buttonLocale=e.buttonLocale||"en-US"}get isValid(){return!!(this.merchantIdentifier&&this.displayName&&this.initiative&&this.initiativeContext)}}class U{constructor(e){this.countryCode=e.countryCode,this.currencyCode=e.currencyCode,this.merchantCapabilities=e.merchantCapabilities,this.supportedNetworks=e.supportedNetworks,this.total=e.total,this.lineItems=e.lineItems,this.shippingMethods=e.shippingMethods,this.applicationData=e.applicationData,this.supportedCountries=e.supportedCountries}get isValid(){var e,t,i,s;return!!(this.countryCode&&this.currencyCode&&(null===(e=this.merchantCapabilities)||void 0===e?void 0:e.length)&&(null===(t=this.supportedNetworks)||void 0===t?void 0:t.length)&&(null===(i=this.total)||void 0===i?void 0:i.label)&&(null===(s=this.total)||void 0===s?void 0:s.amount))}}class Y{static isApplePaySupported(){var e;return"undefined"!=typeof window&&"ApplePaySession"in window&&(null===(e=window.ApplePaySession)||void 0===e?void 0:e.supportsVersion(3))}static canMakePayments(){var e;return this.isApplePaySupported()&&(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments())||!1}static async canMakePaymentsWithActiveCard(e){var t;if(!this.isApplePaySupported())return!1;try{return await(null===(t=window.ApplePaySession)||void 0===t?void 0:t.canMakePaymentsWithActiveCard(e))||!1}catch(e){return console.error("Error checking Apple Pay active card:",e),!1}}static formatAmount(e){return(e/100).toFixed(2)}static parseAmount(e){return Math.round(100*parseFloat(e))}static createLineItem(e,t,i="final"){return{label:e,amount:this.formatAmount(t),type:i}}static getDefaultSupportedNetworks(){return["amex","discover","masterCard","visa"]}static getDefaultMerchantCapabilities(){return[_.SUPPORTS_3DS,_.SUPPORTS_EMV,_.SUPPORTS_CREDIT,_.SUPPORTS_DEBIT]}}!function(e){e.UNAVAILABLE="UNAVAILABLE",e.SESSION_ERROR="SESSION_ERROR",e.MERCHANT_VALIDATION_ERROR="MERCHANT_VALIDATION_ERROR",e.PAYMENT_PROCESSING_ERROR="PAYMENT_PROCESSING_ERROR",e.USER_CANCELLED="USER_CANCELLED"}(R||(R={}));class F{constructor(){this.api=o()}initialize(e){if(this.applePayConfig=new B(e),!this.applePayConfig.isValid)throw new Error("Invalid Apple Pay configuration provided")}async validateMerchant(e,t){try{return await this.api.post({endpoint:"apple_pay/merchant_session",authToken:e,headers:{"Sub-Account":t}})}catch(e){throw console.error("Backend validation failed:",e),new Error("Merchant validation failed")}}async processPayment(e,t,i){const s=await this.api.post({endpoint:"apple_pay/process_token",authToken:e,body:i,headers:{"Sub-Account":t}});return{success:s.id&&!!s.data.token,data:s}}isAvailable(){return Y.isApplePaySupported()&&Y.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await Y.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier)}async startPaymentSession(e,t,i){if(console.groupCollapsed("[ApplePayService] startPaymentSession called"),console.log("[ApplePayService] raw paymentRequest:",JSON.stringify(e,null,2)),console.log("[ApplePayService] has authToken:",Boolean(t)),console.log("[ApplePayService] accountId:",i),console.log("[ApplePayService] has config:",Boolean(this.applePayConfig)),!this.applePayConfig)throw console.error("[ApplePayService] Missing applePayConfig. Did you call initialize()?"),console.groupEnd(),new Error("Apple Pay not initialized. Call initialize() first.");const s=new U(e);if(console.log("[ApplePayService] created ApplePayPaymentRequest:",s),!s.isValid){const e=[];throw s.countryCode||e.push("countryCode"),s.currencyCode||e.push("currencyCode"),s.merchantCapabilities&&0!==s.merchantCapabilities.length||e.push("merchantCapabilities"),s.supportedNetworks&&0!==s.supportedNetworks.length||e.push("supportedNetworks"),s.total&&s.total.label&&s.total.amount||e.push("total"),console.error("[ApplePayService] Payment request is invalid. Missing/invalid:",e),console.groupEnd(),new Error("Invalid payment request provided")}return this.currentPaymentRequest=s,new Promise(((e,n)=>{try{if(console.log("[ApplePayService] About to instantiate ApplePaySession"),"undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),console.groupEnd(),n({success:!1,error:{code:R.UNAVAILABLE,message:"ApplePaySession API is not available in this environment"}});this.currentSession=new window.ApplePaySession(3,s),console.log("[ApplePayService] ApplePaySession instantiated:",this.currentSession),this.setupSessionEventHandlers(e,n,t,i),console.log("[ApplePayService] Event handlers set. Beginning session..."),this.currentSession.begin(),console.log("[ApplePayService] Session.begin() called"),console.groupEnd()}catch(e){console.error("[ApplePayService] Exception while starting session:",e),console.groupEnd(),n({success:!1,error:{code:R.SESSION_ERROR,message:e instanceof Error?e.message:"Failed to start Apple Pay session"}})}}))}abortPaymentSession(){this.currentSession&&(this.currentSession.abort(),this.currentSession=void 0,this.currentPaymentRequest=void 0)}setupSessionEventHandlers(e,t,i,s){this.currentSession&&this.applePayConfig&&this.currentPaymentRequest?(this.currentSession.onvalidatemerchant=async()=>{console.groupCollapsed("[ApplePayService] onvalidatemerchant");try{if(console.log("[ApplePayService] accountId:",s),!i)throw console.error("[ApplePayService] Missing authToken for merchant validation"),new Error("Authentication token not provided.");const e=await this.validateMerchant(i,s);console.log("[ApplePayService] merchantSession received");try{this.currentSession.completeMerchantValidation(e),console.log("[ApplePayService] completeMerchantValidation called")}catch(e){throw console.error("Error calling completeMerchantValidation:",e),e}}catch(e){console.error("=== MERCHANT VALIDATION ERROR ==="),console.error("Error during merchant validation:",e),e&&e.stack&&console.error("Error stack:",e.stack),this.currentSession.abort(),t({success:!1,error:{code:R.MERCHANT_VALIDATION_ERROR,message:e instanceof Error?e.message:"Merchant validation failed"}})}console.groupEnd()},this.currentSession.onpaymentauthorized=async n=>{var o;console.groupCollapsed("[ApplePayService] onpaymentauthorized");try{const a=n.payment;console.log("[ApplePayService] payment payload snapshot:",{hasToken:Boolean(null==a?void 0:a.token),tokenType:(null===(o=null==a?void 0:a.token)||void 0===o?void 0:o.paymentData)?"paymentData":"raw"});const r=Object.assign(Object.assign({},a.token),{product_details:{name:this.currentPaymentRequest.total.label,price:Y.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}});console.log("[ApplePayService] paymentPayload prepared");const l=await this.processPayment(i,s,r);console.log("[ApplePayService] processPayment result:",l),l.success?(this.currentSession.completePayment({status:x.STATUS_SUCCESS}),console.log("[ApplePayService] Payment success; resolving"),e({success:!0,token:a.token,paymentMethodId:l.data.id})):(console.error("PSP reported payment failure:",l.data),this.currentSession.completePayment({status:x.STATUS_FAILURE}),t({success:!1,error:{code:R.PAYMENT_PROCESSING_ERROR,message:"Payment processing failed"}}))}catch(e){console.error("=== PAYMENT PROCESSING ERROR ==="),console.error("Error processing payment:",e),e&&e.stack&&console.error("Error stack:",e.stack),this.currentSession.completePayment({status:x.STATUS_FAILURE}),t({success:!1,error:{code:R.PAYMENT_PROCESSING_ERROR,message:e instanceof Error?e.message:"Payment processing failed"}})}finally{console.log("[ApplePayService] Cleaning up session state"),this.currentSession=void 0,this.currentPaymentRequest=void 0}console.groupEnd()},this.currentSession.onpaymentmethodselected=()=>{console.groupCollapsed("[ApplePayService] onpaymentmethodselected");const e={newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]};try{this.currentSession.completePaymentMethodSelection(e),console.log("[ApplePayService] completePaymentMethodSelection called")}catch(e){console.error("Error completing payment method selection:",e),this.currentSession.abort()}console.groupEnd()},this.currentSession.onshippingmethodselected=()=>{console.groupCollapsed("[ApplePayService] onshippingmethodselected"),this.currentSession.completeShippingMethodSelection({status:x.STATUS_SUCCESS,newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]}),console.log("[ApplePayService] completeShippingMethodSelection called"),console.groupEnd()},this.currentSession.oncancel=e=>{if(console.groupCollapsed("[ApplePayService] oncancel"),e.sessionError)switch(console.error(e.sessionError),e.sessionError.code){case"unknown":console.error("Unknown error - likely merchant validation issue"),console.error("This usually means:"),console.error("1. Merchant certificate is invalid or expired"),console.error("2. Merchant identifier mismatch"),console.error("3. Backend validation endpoint issues");break;case"invalidMerchantSession":console.error("Invalid merchant session provided"),console.error("Check that the merchant session from backend is valid");break;case"userCancel":console.error("User cancelled the payment");break;default:console.error("Other error code:",e.sessionError.code)}this.currentSession=void 0,this.currentPaymentRequest=void 0,t({success:!1,error:{code:R.USER_CANCELLED,message:"User cancelled the Apple Pay session"}}),console.groupEnd()},"onerror"in this.currentSession&&(this.currentSession.onerror=e=>{console.groupCollapsed("[ApplePayService] onerror"),console.error("=== APPLE PAY SESSION ERROR ==="),console.error("Session error:",e),this.currentSession=void 0,this.currentPaymentRequest=void 0,t({success:!1,error:{code:R.SESSION_ERROR,message:"Apple Pay session error occurred"}}),console.groupEnd()})):console.error("[ApplePayService] setupSessionEventHandlers called without required state",{hasSession:Boolean(this.currentSession),hasConfig:Boolean(this.applePayConfig),hasPaymentRequest:Boolean(this.currentPaymentRequest)})}static createPaymentRequest(e,t,i="US",s="USD"){return{countryCode:i,currencyCode:s,merchantCapabilities:Y.getDefaultMerchantCapabilities(),supportedNetworks:Y.getDefaultSupportedNetworks(),total:Y.createLineItem(t,e)}}getApplePayConfig(){return this.applePayConfig}}const Q=t=>{const{isLoading:i}=t;return i?e("div",{class:"container-fluid p-0"},e("div",{class:"row mb-3"},e("div",{class:"col-12 align-content-center"},e(r,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},V=t=>e("div",{class:"apple-pay-button-container"},e("button",Object.assign({class:(()=>{let e="apple-pay-button";switch(t.buttonStyle){case z.WHITE:e+=" apple-pay-button-white";break;case z.WHITE_OUTLINE:e+=" apple-pay-button-white-outline";break;default:e+=" apple-pay-button-black"}switch(t.buttonType){case L.BUY:e+=" apple-pay-button-type-buy";break;case L.DONATE:e+=" apple-pay-button-type-donate";break;default:e+=" apple-pay-button-type-plain"}return(t.disabled||t.isProcessing||!t.isAvailable)&&(e+=" disabled"),e})(),style:{width:t.width||"200px",height:t.height||"48px"},onClick:()=>{!t.disabled&&!t.isProcessing&&t.isAvailable&&t.clickHandler&&t.clickHandler()},disabled:t.disabled||t.isProcessing||!t.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},t),t.isProcessing&&e("div",{class:"processing-overlay"},e("div",{class:"spinner"}),e("span",null,"Processing..."))),e("style",null,"\n .apple-pay-button-container {\n display: inline-block;\n position: relative;\n }\n\n /* Apple Pay CSS classes - these are the official Apple Pay button styles */\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: plain; /* default */\n -apple-pay-button-style: black; /* default */\n border-radius: 8px;\n cursor: pointer;\n border: none;\n outline: none;\n transition: opacity 0.2s ease;\n position: relative;\n }\n\n /* Button styles */\n .apple-pay-button.apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n\n .apple-pay-button.apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n\n .apple-pay-button.apple-pay-button-white-outline {\n -apple-pay-button-style: white-outline;\n }\n\n /* Button types */\n .apple-pay-button.apple-pay-button-type-plain {\n -apple-pay-button-type: plain;\n }\n\n .apple-pay-button.apple-pay-button-type-buy {\n -apple-pay-button-type: buy;\n }\n\n .apple-pay-button.apple-pay-button-type-donate {\n -apple-pay-button-type: donate;\n }\n\n /* Hover and disabled states */\n .apple-pay-button:hover:not(.disabled) {\n opacity: 0.9;\n }\n\n .apple-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .apple-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),H=class{constructor(e){t(this,e),this.applePayStarted=i(this,"applePayStarted"),this.applePayCompleted=i(this,"applePayCompleted"),this.applePayCancelled=i(this,"applePayCancelled"),this.applePayError=i(this,"applePayError"),this.countryCode="US",this.merchantIdentifier="merchant.com.staging-justifi.checkout-dev",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="dev-checkout.justifi-staging.com",this.buttonType=L.PLAIN,this.buttonStyle=z.BLACK,this.disabled=!1,this.showSkeleton=!0,this.isLoading=!0,this.isProcessing=!1,this.isAvailable=!1,this.canMakePayments=!1,this.isConfigValid=!0,this.error=null,this.handleApplePayClick=async()=>{var e,t;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit(),console.groupCollapsed("[ApplePay Component] handleApplePayClick"),console.log("[ApplePay Component] click context:",{isProcessing:this.isProcessing,disabled:this.disabled,isAvailable:this.isAvailable,canMakePayments:this.canMakePayments,hasService:Boolean(this.applePayService)});const i={countryCode:this.countryCode,currencyCode:l.paymentCurrency,merchantCapabilities:[_.SUPPORTS_3DS,_.SUPPORTS_CREDIT,_.SUPPORTS_DEBIT],supportedNetworks:Y.getDefaultSupportedNetworks(),total:Y.createLineItem(l.paymentDescription,l.paymentAmount)};console.log("[ApplePay Component] paymentRequest",i),console.log("[ApplePay Component] identifiers snapshot:",{authTokenLength:l.authToken?String(l.authToken).length:0,accountId:l.accountId});const s=await this.applePayService.startPaymentSession(i,l.authToken,l.accountId);console.log("[ApplePay Component] startPaymentSession result",s),s.success?this.applePayCompleted.emit({success:!0,token:s.token,paymentMethodId:s.paymentMethodId}):(this.applePayCompleted.emit({success:!1,error:s.error}),this.applePayError.emit({error:(null===(e=s.error)||void 0===e?void 0:e.message)||"Payment failed",code:(null===(t=s.error)||void 0===t?void 0:t.code)||H.ErrorCode.PAYMENT_FAILED}))}catch(e){const t=e instanceof Error?e.message:"Payment failed";this.error=t,this.applePayError.emit({error:t,code:H.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:t})}finally{this.isProcessing=!1,console.groupEnd()}}}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,console.groupCollapsed("[ApplePay Component] initializeApplePay"),console.log("[ApplePay Component] checkout state snapshot:",{paymentAmount:l.paymentAmount,paymentCurrency:l.paymentCurrency,hasAuthToken:Boolean(l.authToken),accountId:l.accountId}),!(Boolean(l.paymentAmount)&&Boolean(l.paymentCurrency)&&Boolean(l.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,console.error("Apple Pay config error: missing required values",{paymentAmount:l.paymentAmount,paymentCurrency:l.paymentCurrency,hasAuthToken:Boolean(l.authToken),accountId:l.accountId}),this.applePayError.emit({error:this.error,code:H.ErrorCode.CONFIG_ERROR}),this.isLoading=!1,void console.groupEnd();if(this.isAvailable=Y.isApplePaySupported(),this.canMakePayments=Y.canMakePayments(),console.log("[ApplePay Component] support check:",{isAvailable:this.isAvailable,canMakePayments:this.canMakePayments,hasApplePaySessionOnWindow:"undefined"!=typeof window&&"ApplePaySession"in window}),!this.isAvailable)return this.error="Apple Pay is not supported on this device",console.error(this.error),this.applePayError.emit({error:this.error,code:H.ErrorCode.NOT_SUPPORTED}),this.isLoading=!1,void console.groupEnd();if(!this.canMakePayments)return this.error="Apple Pay is not available",console.error(this.error),this.applePayError.emit({error:this.error,code:H.ErrorCode.NOT_AVAILABLE}),this.isLoading=!1,void console.groupEnd();const e={merchantIdentifier:this.merchantIdentifier,displayName:this.merchantDisplayName,initiative:"web",initiativeContext:this.initiativeContext,buttonType:this.buttonType,buttonStyle:this.buttonStyle};console.log("[ApplePay Component] initializing service with config:",e),this.applePayService=new F,this.applePayService.initialize(e),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(e){console.error("Apple Pay initialization error:",e),this.error=e instanceof Error?e.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:H.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1,console.groupEnd()}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?Y.getDefaultSupportedNetworks():[]}async abort(){this.applePayService.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){if(!l.applePayEnabled)return console.log("[ApplePay Component] Apple Pay disabled in checkout settings; not rendering"),null;const t=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return e(a,null,l.checkoutLoaded&&e("script",{async:!0,src:"https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",onLoad:()=>{console.log("[ApplePay Component] Apple Pay SDK script loaded"),this.initializeApplePay()}}),e("div",{class:"apple-pay-container"},e(Q,{isLoading:this.isLoading}),t&&e(V,{buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick})),e("style",null,"\n .apple-pay-container {\n width: 100%;\n }\n "))}};H.ErrorCode={CONFIG_ERROR:"CONFIG_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",NOT_AVAILABLE:"NOT_AVAILABLE",INITIALIZATION_ERROR:"INITIALIZATION_ERROR",PAYMENT_FAILED:"PAYMENT_FAILED"};const q=class{constructor(e){t(this,e)}render(){return e(a,{key:"abd92b499208321582b08a490c78c9167be2ebd4"},e("section",{key:"38e15cef5a19a43249d7ecf3d4eb4ea8e032f248"},e("div",{key:"747f811012ed9707265369e59dbde8cd7ad3bca6"},e("div",{key:"8575f50759664d5c64d235025699c81f055267ca",part:p},null==l?void 0:l.paymentDescription),e("div",{key:"af77776bbe21bce77586447bbf445e4c5d8c1165"},e("span",{key:"5cdaaec454118197b3e37a942d83907e72444342",part:p},"Total")," ",e("span",{key:"ccc35217ac9740d5a00b7abbcec4133848afcc28",part:p},y(+(null==l?void 0:l.totalAmount)))))))}},W=class{constructor(e){t(this,e),this.levels={h1:m,h2:v,h3:g},this.level="h1"}render(){return e(a,{key:"e1d39365c2ff2c291a42b53d6bcbe1d97d602778"},e(this.levels[this.level],{key:"0b8c8c3a42ff2151e3b293cafeeaeda72e94d767",text:this.text,class:this.class}))}},Z=o();class G{async getLinkToken(e,t,i,s){return Z.post({endpoint:`plaid/${t}/link`,body:{checkout_id:i},authToken:e,signal:s})}async tokenizeBankAccount(e,t,i,s,n,o){const a=`plaid/${t}/tokenize`,r={public_token:i};return s&&(r.link_token_id=s),n&&(r.payment_method_group_id=n),Z.post({endpoint:a,body:r,authToken:e,signal:o})}}const X=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),this.checkoutChangedEvent=i(this,"checkout-changed"),this.plaidService=new G,this.handleApplePayCompleted=e=>{const{success:t,token:i,paymentMethodId:s,error:n}=e.detail;t&&i?(l.paymentToken=s,l.selectedPaymentMethod={type:E.APPLE_PAY},this.submitCheckout()):(console.error("Apple Pay completed but failed:",n),this.errorEvent.emit({message:(null==n?void 0:n.message)||"Apple Pay payment failed",errorCode:P.TOKENIZE_ERROR,severity:w.ERROR}))},this.handleApplePayError=e=>{const{error:t,code:i}=e.detail;console.error("Apple Pay error:",t),this.errorEvent.emit({message:t||"Apple Pay error occurred",errorCode:`APPLE_PAY_${i}`,severity:w.ERROR})},this.handleApplePayCancelled=()=>{l.paymentToken=void 0,l.selectedPaymentMethod=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),l.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new S};this.getCheckout=(({authToken:e,checkoutId:t,service:i})=>async({onSuccess:s,onError:n})=>{var o;try{const a=await i.fetchCheckout(e,t);if(a.error)return n({error:N(a.error),code:C(null===(o=a.error)||void 0===o?void 0:o.code),severity:w.ERROR});s({checkout:a.data})}catch(e){const t=C(null==e?void 0:e.code);return n({error:e.message||e,code:t,severity:w.ERROR})}})(e),this.completeCheckout=(({authToken:e,checkoutId:t,service:i})=>async({payment:s,onSuccess:n,onError:o})=>{var a;try{const r=await i.complete(e,t,s);if(r.error)return o({error:N(r.error),code:C(null===(a=r.error)||void 0===a?void 0:a.code),severity:w.ERROR});n({checkout:r.data})}catch(e){const t=C(null==e?void 0:e.code);return o({error:e.message||e,code:t,severity:w.ERROR})}})(e),c((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new k(this),A(),l.authToken=this.authToken,this.fetchCheckout(),M("set",(e=>{const t=b[e];void 0!==t&&f(e,t)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:e})=>{this.updateStore(e),e.status!==T.completed?e.status!==T.expired||this.errorEvent.emit({message:j.CHECKOUT_EXPIRED,errorCode:P.CHECKOUT_EXPIRED,severity:w.ERROR}):this.errorEvent.emit({message:j.CHECKOUT_ALREADY_COMPLETED,errorCode:P.CHECKOUT_ALREADY_COMPLETED,severity:w.ERROR})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:e.code,severity:e.severity})}}):this.errorEvent.emit({message:j.NOT_AUTHENTICATED,errorCode:P.NOT_AUTHENTICATED,severity:w.ERROR})}updateStore(e){var t,i,s,n,o,a;l.accountId=e.account_id,l.checkoutLoaded=!0,l.paymentMethods=e.payment_methods.map((e=>new I(e))),l.paymentMethodGroupId=e.payment_method_group_id,l.paymentDescription=e.payment_description,l.totalAmount=e.total_amount,l.paymentAmount=e.payment_amount,l.bnplEnabled=e.payment_settings.bnpl_payments,l.insuranceEnabled=e.payment_settings.insurance_payments,l.bankAccountVerification=null===(t=e.payment_settings)||void 0===t?void 0:t.bank_account_verification,l.applePayEnabled=Boolean(null===(i=e.payment_settings)||void 0===i?void 0:i.apple_payments),l.bnplProviderClientId=null===(s=null==e?void 0:e.bnpl)||void 0===s?void 0:s.provider_client_id,l.bnplProviderMode=null===(n=null==e?void 0:e.bnpl)||void 0===n?void 0:n.provider_mode,l.bnplProviderApiVersion=null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.provider_api_version,l.bnplProviderCheckoutUrl=null===(a=null==e?void 0:e.bnpl)||void 0===a?void 0:a.provider_checkout_url}emitCheckoutChanged(){const e={availablePaymentMethodTypes:h(),selectedPaymentMethod:l.selectedPaymentMethod,savedPaymentMethods:l.paymentMethods};this.checkoutChangedEvent.emit(e)}queryFormRefs(){this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}async tokenizePaymentMethod(e){var t,i,s;const n=null!==(i=await(null===(t=this.billingFormRef)||void 0===t?void 0:t.getValues()))&&void 0!==i?i:{},o=Object.assign(Object.assign({},e),n),a=Object.assign({accountId:l.accountId,payment_method_group_id:void 0},o);l.savePaymentMethod&&(a.payment_method_group_id=l.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:a,account:l.accountId}));return r.error?r:(l.paymentToken=r.id,r.id)}async setSelectedPaymentMethod(e){l.selectedPaymentMethod=e,l.paymentToken=e.id||void 0}async validate(){var e,t;const i=[];l.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(e=l.selectedPaymentMethod)||void 0===e?void 0:e.type)===E.NEW_CARD,n=(null===(t=l.selectedPaymentMethod)||void 0===t?void 0:t.type)===E.NEW_BANK_ACCOUNT;if((s||n)&&(this.paymentMethodFormRef&&i.push(this.paymentMethodFormRef.validate()),this.billingFormRef&&i.push(this.billingFormRef.validate())),0===i.length)return!0;try{return!!(await Promise.all(i)).every((e=>"boolean"==typeof e?e:!1!==(null==e?void 0:e.isValid)))||(this.errorEvent.emit({message:"Validation error",errorCode:P.VALIDATION_ERROR,severity:w.ERROR}),!1)}catch(e){return!1}}async submitCheckout(e){var t,i,s,n,o;const a=await this.validate();if(!l.selectedPaymentMethod)return void this.errorEvent.emit({message:"No payment method selected.",errorCode:P.VALIDATION_ERROR,severity:w.ERROR});const r=(null===(t=l.selectedPaymentMethod)||void 0===t?void 0:t.type)===E.NEW_CARD,c=(null===(i=l.selectedPaymentMethod)||void 0===i?void 0:i.type)===E.NEW_BANK_ACCOUNT,h=(null===(s=l.selectedPaymentMethod)||void 0===s?void 0:s.type)===E.PLAID;if(r||c){const t=await this.tokenizePaymentMethod(e);if(null==t?void 0:t.error)return void this.errorEvent.emit({message:t.error.message,errorCode:P.TOKENIZE_ERROR,severity:w.ERROR})}if(h&&!l.paymentToken){const e=l.plaidPublicToken,t=l.plaidLinkTokenId;if(!e)return void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:P.TOKENIZE_ERROR,severity:w.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(l.authToken,l.accountId,e,t||void 0,l.savePaymentMethod?l.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:P.TOKENIZE_ERROR,severity:w.ERROR});const s=null==i?void 0:i.data,o=(null===(n=null==s?void 0:s.bank_account)||void 0===n?void 0:n.token)||(null==s?void 0:s.token)||(null==s?void 0:s.id);l.paymentToken=o}catch(e){return void this.errorEvent.emit({message:(null==e?void 0:e.message)||"Plaid exchange error",errorCode:P.TOKENIZE_ERROR,severity:w.ERROR})}}if(!a)return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:P.VALIDATION_ERROR,severity:w.ERROR});if(!l.paymentToken)return void this.errorEvent.emit({message:"Payment token not found.",errorCode:P.TOKENIZE_ERROR,severity:w.ERROR});let d;d={payment_mode:(e=>{switch(e){case E.NEW_CARD:case E.SAVED_CARD:case E.NEW_BANK_ACCOUNT:case E.SAVED_BANK_ACCOUNT:case E.PLAID:return D.ECOM;case E.SEZZLE:return D.BNPL;case E.APPLE_PAY:return D.APPLE_PAY;default:return}})(null===(o=l.selectedPaymentMethod)||void 0===o?void 0:o.type),payment_token:l.paymentToken},this.completeCheckout({payment:d,onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:P.COMPLETE_CHECKOUT_ERROR,severity:w.ERROR})}})}render(){return e(s,{key:"63acafa8f4819ac63e564807779976e352ccbdfb"})}get hostEl(){return n(this)}};var J;!function(e){e.PLAID_SDK_LOAD_FAILED="plaid-sdk-load-failed",e.PLAID_LINK_INIT_FAILED="plaid-link-init-failed",e.PLAID_LINK_TOKEN_FAILED="plaid-link-token-failed",e.PLAID_AUTHENTICATION_FAILED="plaid-authentication-failed",e.PLAID_BANK_NOT_SUPPORTED="plaid-bank-not-supported",e.PLAID_TOKEN_EXPIRED="plaid-token-expired",e.PLAID_NETWORK_ERROR="plaid-network-error",e.PLAID_USER_CANCELLED="plaid-user-cancelled",e.PLAID_TIMEOUT="plaid-timeout",e.PLAID_INVALID_CREDENTIALS="plaid-invalid-credentials",e.PLAID_ACCOUNT_LOCKED="plaid-account-locked",e.PLAID_MAINTENANCE="plaid-maintenance",e.PLAID_RATE_LIMITED="plaid-rate-limited"}(J||(J={}));const K={[J.PLAID_SDK_LOAD_FAILED]:"Unable to load Plaid. Please refresh the page and try again.",[J.PLAID_LINK_INIT_FAILED]:"Unable to initialize bank connection. Please try again.",[J.PLAID_LINK_TOKEN_FAILED]:"Unable to connect to bank service. Please try again.",[J.PLAID_AUTHENTICATION_FAILED]:"Bank authentication failed. Please try again.",[J.PLAID_BANK_NOT_SUPPORTED]:"Your bank is not currently supported. Please try a different payment method.",[J.PLAID_TOKEN_EXPIRED]:"Your bank session has expired. Please reconnect your account.",[J.PLAID_NETWORK_ERROR]:"Network connection issue. Please check your internet connection and try again.",[J.PLAID_USER_CANCELLED]:"Bank connection was cancelled. Click to try again.",[J.PLAID_TIMEOUT]:"Bank connection timed out. Please try again.",[J.PLAID_INVALID_CREDENTIALS]:"Invalid bank credentials. Please check your username and password.",[J.PLAID_ACCOUNT_LOCKED]:"Your bank account is temporarily locked. Please contact your bank.",[J.PLAID_MAINTENANCE]:"Bank service is temporarily unavailable. Please try again later.",[J.PLAID_RATE_LIMITED]:"Too many connection attempts. Please wait a moment and try again."},$={[J.PLAID_SDK_LOAD_FAILED]:w.ERROR,[J.PLAID_LINK_INIT_FAILED]:w.ERROR,[J.PLAID_LINK_TOKEN_FAILED]:w.ERROR,[J.PLAID_AUTHENTICATION_FAILED]:w.ERROR,[J.PLAID_BANK_NOT_SUPPORTED]:w.WARNING,[J.PLAID_TOKEN_EXPIRED]:w.WARNING,[J.PLAID_NETWORK_ERROR]:w.WARNING,[J.PLAID_USER_CANCELLED]:w.INFO,[J.PLAID_TIMEOUT]:w.WARNING,[J.PLAID_INVALID_CREDENTIALS]:w.ERROR,[J.PLAID_ACCOUNT_LOCKED]:w.ERROR,[J.PLAID_MAINTENANCE]:w.WARNING,[J.PLAID_RATE_LIMITED]:w.WARNING},ee=class{constructor(e){t(this,e),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.plaidError=i(this,"plaidError"),this.plaidErrorRecovered=i(this,"plaidErrorRecovered"),this.isAuthenticating=!1,this.publicToken=null,this.linkToken=null,this.linkTokenId=null,this.error=null,this.plaidLink=null,this.isSelected=!1,this.retryCount=0,this.isRetrying=!1,this.plaidService=new G,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{l.authToken&&l.accountId&&l.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:J.PLAID_SDK_LOAD_FAILED,message:K[J.PLAID_SDK_LOAD_FAILED],severity:$[J.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:J.PLAID_LINK_TOKEN_FAILED,message:K[J.PLAID_LINK_TOKEN_FAILED],severity:$[J.PLAID_LINK_TOKEN_FAILED],retryable:!0,userAction:"Click to try again"});const e=window.Plaid;this.plaidLink=e.create({token:this.linkToken,onSuccess:this.handlePlaidSuccess,onExit:this.handlePlaidExit,onEvent:this.handlePlaidEvent,onLoad:this.handlePlaidLoad})}catch(e){this.handleError({code:J.PLAID_LINK_INIT_FAILED,message:K[J.PLAID_LINK_INIT_FAILED],severity:$[J.PLAID_LINK_INIT_FAILED],originalError:e,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var e,t,i,s,n;try{if(!l.authToken||!l.accountId)return void this.handleError({code:J.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:w.ERROR,retryable:!1,userAction:"Refresh the page"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var e;null===(e=this.abortController)||void 0===e||e.abort()}),3e4);const t=await this.plaidService.getLinkToken(l.authToken,l.accountId,l.checkoutId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),t.error)throw new Error("string"==typeof t.error?t.error:t.error.message||"Failed to get link token");this.linkToken=t.data.link_token,this.linkTokenId=(null==t?void 0:t.id)||(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.id)||null,this.linkTokenId&&(l.plaidLinkTokenId=this.linkTokenId)}catch(e){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let o=J.PLAID_LINK_TOKEN_FAILED,a=K[o],r=!0;"AbortError"===e.name?(o=J.PLAID_TIMEOUT,a=K[o],r=!0):(null===(t=e.message)||void 0===t?void 0:t.includes("network"))||(null===(i=e.message)||void 0===i?void 0:i.includes("fetch"))?(o=J.PLAID_NETWORK_ERROR,a=K[o],r=!0):((null===(s=e.message)||void 0===s?void 0:s.includes("401"))||(null===(n=e.message)||void 0===n?void 0:n.includes("unauthorized")))&&(o=J.PLAID_INVALID_CREDENTIALS,a="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:o,message:a,severity:$[o],originalError:e,retryable:r,userAction:r?"Click to try again":"Refresh the page"})}},this.mapApiErrorToPlaidError=e=>{if("string"==typeof e){if(e.includes("rate_limit"))return J.PLAID_RATE_LIMITED;if(e.includes("maintenance"))return J.PLAID_MAINTENANCE;if(e.includes("not_authenticated"))return J.PLAID_INVALID_CREDENTIALS}if(null==e?void 0:e.code)switch(e.code){case"rate_limited":return J.PLAID_RATE_LIMITED;case"maintenance":return J.PLAID_MAINTENANCE;case"not_authenticated":return J.PLAID_INVALID_CREDENTIALS;default:return J.PLAID_LINK_TOKEN_FAILED}return J.PLAID_LINK_TOKEN_FAILED},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=e=>{this.publicToken=e,this.isAuthenticating=!1,this.clearError(),this.retryCount=0,this.isSelected||(this.isSelected=!0,l.selectedPaymentMethod={type:E.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:w.INFO}),l.plaidPublicToken=e},this.handlePlaidExit=e=>{this.isAuthenticating=!1,e&&this.handlePlaidError(e)},this.handlePlaidEvent=(e,t)=>{switch(e){case"OPEN":this.isAuthenticating=!0;break;case"CLOSE":this.isAuthenticating=!1;break;case"ERROR":this.handlePlaidError(t)}},this.handlePlaidLoad=()=>{},this.handlePlaidError=e=>{let t=J.PLAID_AUTHENTICATION_FAILED,i=K[t],s=!0,n="Click to try again";if(e.error_code)switch(e.error_code){case"INVALID_CREDENTIALS":t=J.PLAID_INVALID_CREDENTIALS,i=K[t],s=!0;break;case"ITEM_LOGIN_REQUIRED":t=J.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":t=J.PLAID_ACCOUNT_LOCKED,i=K[t],s=!1,n="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":t=J.PLAID_MAINTENANCE,i=K[t],s=!0;break;case"RATE_LIMIT_EXCEEDED":t=J.PLAID_RATE_LIMITED,i=K[t],s=!0;break;case"INVALID_REQUEST":t=J.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":t=J.PLAID_AUTHENTICATION_FAILED,i=e.error_message||"Bank authentication failed. Please try again.",s=!0;break;default:e.error_message&&(i=e.error_message)}if(e.error_message){const o=e.error_message.toLowerCase();o.includes("not supported")||o.includes("unsupported")?(t=J.PLAID_BANK_NOT_SUPPORTED,i=K[t],s=!1,n="Try a different payment method"):(o.includes("expired")||o.includes("timeout"))&&(t=J.PLAID_TOKEN_EXPIRED,i=K[t],s=!0)}this.handleError({code:t,message:i,severity:$[t],originalError:e,retryable:s,userAction:n}),this.isAuthenticating=!1},this.handleError=e=>{this.error=e,this.plaidError.emit({code:e.code,message:e.message,severity:e.severity,data:{originalError:e.originalError,retryable:e.retryable,userAction:e.userAction,retryCount:this.retryCount}}),console.error("Plaid error:",e),e.retryable&&this.retryCount<this.maxRetries&&this.scheduleRetry()},this.scheduleRetry=()=>{this.isRetrying||(this.isRetrying=!0,this.retryCount++,setTimeout((()=>{this.isRetrying=!1,this.clearError(),this.waitForStoreAndInitialize()}),this.retryDelay*this.retryCount))},this.clearError=()=>{this.error&&(this.error=null,this.retryCount=0)},this.syncWithStore=()=>{var e;const t=(null===(e=l.selectedPaymentMethod)||void 0===e?void 0:e.type)===E.PLAID;this.isSelected!==t&&(this.isSelected=t)}}onSelectionChange(e){var t;e&&(null===(t=l.selectedPaymentMethod)||void 0===t?void 0:t.type)!==E.PLAID&&(l.selectedPaymentMethod={type:E.PLAID}),!e||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.waitForStoreAndInitialize()},this.scriptRef.onerror=()=>{this.handleError({code:J.PLAID_SDK_LOAD_FAILED,message:K[J.PLAID_SDK_LOAD_FAILED],severity:$[J.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}componentWillLoad(){var e;this.isSelected=(null===(e=l.selectedPaymentMethod)||void 0===e?void 0:e.type)===E.PLAID}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return l.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,l.selectedPaymentMethod={type:E.PLAID},this.error)return this.clearError(),void this.waitForStoreAndInitialize();!this.plaidLink||this.publicToken||this.isAuthenticating||this.openPlaidLink()}async setSelected(e){this.isSelected=e,e&&(l.selectedPaymentMethod={type:E.PLAID})}async isCurrentlySelected(){return this.isSelected}async deselect(){this.isSelected=!1}async reset(){this.publicToken=null,this.clearError(),this.isAuthenticating=!1,this.linkToken=null,this.plaidLink=null,this.retryCount=0,this.isRetrying=!1,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.abortController&&(this.abortController.abort(),this.abortController=null)}async isReadyForAuthentication(){return!(!this.plaidLink||!this.linkToken||this.isAuthenticating)}async retry(){this.error&&this.error.retryable&&(this.clearError(),this.waitForStoreAndInitialize())}async getErrorInfo(){return this.error}componentDidLoad(){const e=d("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=e}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(!0!==l.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[PlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const t=e("img",{class:"plaid-logo-img",src:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=",alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return e(a,{class:"payment-method"},e("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:e=>this.scriptRef=e}),e("div",{title:"Pay with Plaid"},e("div",{onClick:e=>{e.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",t," "),(()=>this.error?e("div",{class:(this.error.severity===w.ERROR?"text-danger":this.error.severity===w.WARNING?"text-warning":"text-info")+" mt-2"},e("small",null,this.error.message),e("br",null),e("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&e("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?e("div",{class:"text-info mt-2"},e("small",null,"Connecting to your bank...")):this.publicToken?e("div",{class:"text-success mt-2"},e("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:e("div",{class:"text-muted mt-2"},e("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},te=class{constructor(e){t(this,e),this.onPaymentMethodOptionClick=e=>t=>{t.preventDefault(),l.selectedPaymentMethod={id:e.id,type:e.type},l.paymentToken=e.id},this.isAllowedPaymentMethod=e=>!(e===E.SAVED_CARD&&l.disableCreditCard||e===E.SAVED_BANK_ACCOUNT&&l.disableBankAccount)}componentWillLoad(){l.paymentMethods.length||console.warn("No saved payment methods available."),l.disablePaymentMethodGroup&&console.warn("Payment method group is disabled.")}render(){return l.disablePaymentMethodGroup?null:e(a,null,e("div",{class:"saved-payment-methods"},l.paymentMethods.length?l.paymentMethods.filter((e=>this.isAllowedPaymentMethod(e.type))).map((t=>e("div",{class:"radio-list-item p-3",part:u,onClick:this.onPaymentMethodOptionClick(t)},e("form-control-radio",{name:"paymentMethodType",value:null==t?void 0:t.id,checked:l.paymentToken===(null==t?void 0:t.id),label:`${O[null==t?void 0:t.brand]||""} *${null==t?void 0:t.acct_last_four}`})))):null))}},ie=e("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),se=class{constructor(e){t(this,e),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.paymentMethodOptionId=E.SEZZLE,this.initializeSezzleCheckout=()=>{let e;this.sezzlePromise=new Promise((t=>{e=t}));const t=Number(l.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:l.bnplProviderClientId,apiMode:l.bnplProviderMode,apiVersion:l.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(e){e.preventDefault(),i.startCheckout({checkout_url:l.bnplProviderCheckoutUrl})},onComplete:t=>e({bnpl:t.data}),onCancel:t=>e({bnpl:t.data}),onFailure:t=>e({bnpl:t.data})}),this.sezzleCheckout=i,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(t)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(e){return e.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}async handleSelectionClick(){l.selectedPaymentMethod={type:E.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var t,i;return l.bnplEnabled?e(a,{class:"payment-method"},e("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:e=>this.scriptRef=e}),e("div",null,e("div",null,"Buy now, pay later with ",ie),this.installmentPlan&&e("small",null,e("span",null,null===(t=this.installmentPlan)||void 0===t?void 0:t.installments.length)," ",e("span",null,this.installmentPlan.schedule," payments of")," ",e("span",{class:"fw-bold"},y(null===(i=this.installmentPlan)||void 0===i?void 0:i.installments[0].amountInCents))))):(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null)}},ne={[E.NEW_BANK_ACCOUNT]:"New bank account",[E.NEW_CARD]:"New credit or debit card"},oe="Payment form not ready",ae="Validation error",re=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){A(),this.analytics=new k(this)}handleRadioClick(e){this.selectedPaymentMethod=e.detail,l.selectedPaymentMethod={type:e.detail}}async fillBillingForm(e){var t;null===(t=this.billingFormRef)||void 0===t||t.fill(e)}async tokenizePaymentMethod(e){null==e||e.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:P.TOKENIZE_ERROR,message:ae}),void(this.isLoading=!1);const e=await this.resolvePaymentMethod({isValid:!0});return e.error&&this.emitError({errorCode:e.error.code,message:e.error.message}),this.submitEvent.emit({response:e}),e}catch(e){const t=this.createErrorResponse(P.TOKENIZE_ERROR,e.message);return this.emitError({errorCode:P.TOKENIZE_ERROR,message:e.message}),this.submitEvent.emit({response:t}),t}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:oe}};const[e,t]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:e.isValid&&t.isValid,errors:Object.assign(Object.assign({},e.errors),t.errors)}}async tokenize(){try{const e=await this.billingFormRef.getValues(),t={clientId:this.authToken||l.authToken,account:this.accountId||l.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(e)};return await this.paymentMethodFormRef.tokenize(t)}catch(e){return e}}validateRequiredProps(){this.authToken||l.authToken||this.emitError({errorCode:P.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||l.accountId||this.emitError({errorCode:P.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=E.NEW_BANK_ACCOUNT,l.selectedPaymentMethod={type:E.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=E.NEW_CARD,l.selectedPaymentMethod={type:E.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const e=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=e}isSlottedWithinModularCheckout(){var e;let t=null===(e=this.host)||void 0===e?void 0:e.parentElement;for(;t;){if("JUSTIFI-MODULAR-CHECKOUT"===t.tagName)return!0;t=t.parentElement}return!1}get availablePaymentMethods(){const e=[];return this.disableCreditCard||e.push(E.NEW_CARD),this.disableBankAccount||e.push(E.NEW_BANK_ACCOUNT),e}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(e){this.errorEvent.emit(Object.assign(Object.assign({},e),{severity:w.ERROR}))}createErrorResponse(e,t){return{error:{code:e,message:t,decline_code:void 0}}}async resolvePaymentMethod(e){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",oe);try{const t=await this.validate();if(!t.isValid||!e.isValid){const e=Object.values(t.errors)[0]||ae;return{validationError:!0,error:{code:"validation_error",message:String(e),decline_code:void 0}}}return await this.performTokenization()}catch(e){return{error:e}}}async performTokenization(){var e,t;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(e=s.card)||void 0===e?void 0:e.token)||(null===(t=s.bank_account)||void 0===t?void 0:t.token),data:s}}buildPaymentMethodMetadata(e){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},e),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},e)}get paymentMethodGroupID(){return this.paymentMethodGroupId||l.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!l.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const i=this.selectedPaymentMethod===t&&void 0===l.selectedPaymentMethod.id;return e("div",{class:"payment-method"},e("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:i,label:ne[t],hidden:this.shouldHideRadioInput}),i&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return e("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),e("div",{class:"mt-4"},e("justifi-billing-form",{ref:e=>this.billingFormRef=e,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),e("div",{class:"mt-4"},e("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return e(t===E.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:e=>this.paymentMethodFormRef=e})}render(){return e(a,{key:"bf221d17739bf70c3f581f3b9791a725e76c3f35"},e("form",{key:"df117d42d4160f31df1fca5d6903967cc48ad573"},e("fieldset",{key:"550e670feffb405c669d44c44eb9073f535c6cb6"},e("div",{key:"8eff7d3ab19618da54161220b92641bf19bfa82d",class:"row gy-3"},e("div",{key:"bf9d19e92be74abf48ce65c97efb3f9df52d4c3c",class:"col-12"},this.availablePaymentMethods.map((e=>this.renderPaymentMethodOption(e)))),e("div",{key:"eef1f4e1e03c2263efb51ae94085c5a3d73a9166",class:"col-12"},e("justifi-button",{key:"f0e5697e658236610da45c34e64a8cbb3f0f9d95",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:e=>this.tokenizePaymentMethod(e),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return n(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}};export{H as justifi_apple_pay,q as justifi_checkout_summary,W as justifi_header,X as justifi_modular_checkout,ee as justifi_plaid_payment_method,te as justifi_saved_payment_methods,se as justifi_sezzle_payment_method,re as justifi_tokenize_payment_method}