{"version":3,"names":["scPaymentCss","ScPaymentStyle0","wp","i18n","__","h","label","slot","name","style","width","hasOtherAvailableCreditCardProcessor","key","processor","id","class","fontSize","mollie","Tag","collapsible","theme","_b","availableProcessors","length","_c","availableManualPaymentMethods","type","open","_e","_d","window","scData","user_permissions","manage_sc_shop_settings","Fragment","href","addQueryArgs","_f","admin_url","map"],"sources":["src/components/controllers/checkout-form/payment/sc-payment.scss?tag=sc-payment&encapsulation=shadow","src/components/controllers/checkout-form/payment/sc-payment.tsx"],"sourcesContent":[":host {\n display: flex !important;\n flex-direction: column;\n gap: var(--sc-input-label-margin);\n position: relative;\n font-family: var(--sc-font-sans);\n}\n\n.sc-payment-toggle-summary {\n line-height: 1;\n display: flex;\n align-items: center;\n gap: 0.5em;\n font-weight: var(--sc-font-weight-semibold);\n}\n\n.sc-payment-label {\n display: flex;\n justify-content: space-between;\n}\n\n.sc-payment-instructions {\n color: var(--sc-color-gray-600);\n font-size: var(--sc-font-size-small);\n line-height: var(--sc-line-height-dense);\n}\n\n.sc-payment {\n &__stripe-card-element {\n display: flex !important;\n flex-direction: column;\n gap: var(--sc-input-label-margin);\n position: relative;\n }\n}\n","import { Component, Element, Fragment, h, Host, Prop } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\nimport { state as checkoutState } from '@store/checkout';\nimport { state as processorsState } from '@store/processors';\nimport { state as selectedProcessor } from '@store/selected-processor';\nimport { ManualPaymentMethods } from './ManualPaymentMethods';\nimport {\n getAvailableProcessor,\n hasMultipleProcessorChoices,\n availableManualPaymentMethods,\n availableProcessors,\n hasOtherAvailableCreditCardProcessor,\n} from '@store/processors/getters';\nimport { addQueryArgs } from '@wordpress/url';\nimport { MockProcessor } from './MockProcessor';\n\n/**\n * @part base - The elements base wrapper.\n * @part form-control - The form control wrapper.\n * @part label - The input label.\n * @part help-text - Help text that describes how to use the input.\n * @part test-badge__base - Test badge base.\n * @part test-badge__content - Test badge content.\n */\n@Component({\n tag: 'sc-payment',\n styleUrl: 'sc-payment.scss',\n shadow: true,\n})\nexport class ScPayment {\n /** This element. */\n @Element() el: HTMLScPaymentElement;\n\n @Prop() stripePaymentElement: boolean;\n\n /** Disabled processor types */\n @Prop() disabledProcessorTypes: string[];\n\n @Prop() secureNotice: string;\n\n /** The input's label. */\n @Prop() label: string;\n\n /** Hide the test mode badge */\n @Prop() hideTestModeBadge: boolean;\n\n componentWillLoad() {\n processorsState.disabled.processors = this.disabledProcessorTypes;\n }\n\n renderStripe(processor) {\n const title = hasOtherAvailableCreditCardProcessor('stripe') ? __('Credit Card (Stripe)', 'surecart') : __('Credit Card', 'surecart');\n return (\n \n \n \n {title}\n \n\n
\n \n
\n
\n );\n }\n\n renderPayPal(processor) {\n return (\n \n \n \n \n {__('PayPal', 'surecart')}\n \n\n \n \n \n {__('Another step will appear after submitting your order to complete your purchase details.', 'surecart')}\n \n \n \n {!hasOtherAvailableCreditCardProcessor('paypal') && (\n \n \n \n {__('Credit Card', 'surecart')}\n \n\n \n \n \n {__('Another step will appear after submitting your order to complete your purchase details.', 'surecart')}\n \n \n \n )}\n \n );\n }\n\n renderMock(processor) {\n return ;\n }\n\n renderPaystack(processor) {\n const title = hasOtherAvailableCreditCardProcessor('paystack') ? __('Credit Card (Paystack)', 'surecart') : __('Credit Card', 'surecart');\n\n // if system currency is not in the supported currency list, then stop.\n if (!(processor?.supported_currencies ?? []).includes(window?.scData?.currency)) {\n return;\n }\n\n return (\n \n \n \n {title}\n \n\n \n \n \n {__('Another step will appear after submitting your order to complete your purchase details.', 'surecart')}\n \n \n \n \n );\n }\n\n render() {\n // payment is not required for this order.\n if (checkoutState.checkout?.payment_method_required === false) {\n return null;\n }\n\n const Tag = hasMultipleProcessorChoices() || selectedProcessor?.id === 'paypal' ? 'sc-toggles' : 'div';\n const mollie = getAvailableProcessor('mollie');\n\n return (\n \n \n
\n
{this.label}
\n {checkoutState.mode === 'test' && !this.hideTestModeBadge && (\n \n {__('Test Mode', 'surecart')}\n \n )}\n
\n\n {mollie?.id ? (\n \n ) : (\n \n {!availableProcessors()?.length && !availableManualPaymentMethods()?.length && (\n \n {window?.scData?.user_permissions?.manage_sc_shop_settings ? (\n \n {__('You do not have any processors enabled for this mode and cart. ', 'surecart')}\n \n {__('Please configure your processors', 'surecart')}\n \n .\n \n ) : (\n __('Please contact us for payment.', 'surecart')\n )}\n \n )}\n {(availableProcessors() || []).map(processor => {\n switch (processor?.processor_type) {\n case 'stripe':\n return this.renderStripe(processor);\n case 'paypal':\n return this.renderPayPal(processor);\n case 'paystack':\n return this.renderPaystack(processor);\n case 'mock':\n return this.renderMock(processor);\n }\n })}\n \n \n )}\n
\n
\n );\n }\n}\n"],"mappings":"8gBAAA,MAAMA,EAAe,2kBACrB,MAAAC,EAAeD,E,6SCkDoDE,GAAAC,KAAAC,GAAE,mCAAuCF,GAAAC,KAAAC,GAAE,0B,wpBAqB7EF,GAAAC,KAAAC,GAAE,uBAAAC,EAAA,eAAAA,EAAA,uBAAAC,MAIKJ,GAAAC,KAAAC,GAAE,8CAAAC,EAAA,WAAAE,KAAA,OAAAC,KAAA,SAAAC,MAAA,CAAAC,MAAA,+BAE3BR,GAAAC,KAAAC,GAAE,0GAAAO,EAAA,WAAAN,EAAA,4BAAAO,IAAAC,IAAA,MAAAA,SAAA,SAAAA,EAAAC,GAAA,4CAAAT,EAAA,QAAAE,KAAA,UAAAQ,MAAA,6BAAAV,EAAA,WAAAG,KAAA,cAAAC,MAAA,CAAAO,SAAA,+BAAAX,EAAA,YAQIH,GAAAC,KAAAC,GAAE,4BAAAC,EAAA,eAAAA,EAAA,uBAAAC,MAImBJ,GAAAC,KAAAC,GAAE,mDAAAC,EAAA,WAAAG,KAAA,cAAAD,KAAA,OAAAE,MAAA,CAAAO,SAAA,+BAE3Bd,GAAAC,KAAAC,GAAE,yG,yFAckDF,GAAAC,KAAAC,GAAE,qCAAyCF,GAAAC,KAAAC,GAAE,0B,sfAe5EF,GAAAC,KAAAC,GAAE,mDAAAC,EAAA,WAAAE,KAAA,OA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