"use strict";const util=require("./util-a15c420c.js"),index=require("./index-c3de642f.js"),utils=require("./utils-a9d13080.js"),mutations=require("./mutations-6e603e86.js"),watchers=require("./watchers-517825ae.js"),{processors:processors}=utils.getSerializedState(),{state:state,onChange:onChange,on:on,dispose:dispose}=index.createStore({processors:[],methods:[],manualPaymentMethods:[],disabled:{processors:[]},sortOrder:{processors:["stripe","paystack","paypal","mollie","mock"],manualPaymentMethods:[],paymentMethods:{mollie:["creditcard","paypal"],razorpay:["card","upi"]}},instances:{stripe:void 0},config:{stripe:{paymentElement:!1}},...processors},((e,s)=>JSON.stringify(e)!==JSON.stringify(s))),METHOD_AWARE_PROCESSORS=["mollie","razorpay"],isMethodAwareProcessor=e=>!!e&&METHOD_AWARE_PROCESSORS.includes(e),availableProcessors=()=>util.sortByArray(state.processors,"processor_type",state.sortOrder.processors).filter((e=>(null==e?void 0:e.live_mode)===("live"===(null===mutations.state||void 0===mutations.state?void 0:mutations.state.mode)))).filter((e=>!(state.disabled.processors||[]).includes(e.processor_type))).filter((e=>{var s;return!(null===(s=null===mutations.state||void 0===mutations.state?void 0:mutations.state.checkout)||void 0===s?void 0:s.reusable_payment_method_required)||!!(null==e?void 0:e.recurring_enabled)})).filter(((e,s,o)=>!o.some((e=>"mollie"===e.processor_type))||"mollie"===e.processor_type||"mock"===e.processor_type)),getProcessorByType=e=>availableProcessors().find((({processor_type:s})=>s===e)),getAvailableProcessor=e=>availableProcessors().find((({processor_type:s})=>s===e)),processorSupportsCurrentCurrency=e=>{var s,o;return!!e&&(null!==(s=e.supported_currencies)&&void 0!==s?s:[]).includes(null===(o=null===window||void 0===window?void 0:window.scData)||void 0===o?void 0:o.currency)},hasOtherAvailableCreditCardProcessor=e=>availableProcessors().some((({processor_type:s})=>s!==e&&"paypal"!==s&&"mock"!==s)),availableManualPaymentMethods=()=>util.sortByArray(state.manualPaymentMethods,"id",state.sortOrder.manualPaymentMethods).filter((e=>!(state.disabled.processors||[]).includes(null==e?void 0:e.id))).filter((e=>{var s;return!(null===(s=null===mutations.state||void 0===mutations.state?void 0:mutations.state.checkout)||void 0===s?void 0:s.reusable_payment_method_required)||!!(null==e?void 0:e.reusable)})),availableMethodTypes=()=>{const e=null===watchers.state||void 0===watchers.state?void 0:watchers.state.id,s=isMethodAwareProcessor(e)?state.sortOrder.paymentMethods[e]:[];return util.sortByArray(state.methods,"id",s||[]).filter((e=>{var s,o;return"applepay"!==e.id||(null===window||void 0===window?void 0:window.ApplePaySession)&&(null===(o=null===(s=null===window||void 0===window?void 0:window.ApplePaySession)||void 0===s?void 0:s.canMakePayments)||void 0===o?void 0:o.call(s))}))},availableProcessorChoices=()=>[...availableProcessors(),...availableManualPaymentMethods()],hasMultipleProcessorChoices=()=>{var e;return(null===(e=availableProcessorChoices())||void 0===e?void 0:e.length)>1},availableMethodChoices=()=>[...availableMethodTypes(),...availableManualPaymentMethods(),getProcessorByType("mock")].filter(Boolean),hasMultipleMethodChoices=()=>{var e;return(null===(e=availableMethodChoices())||void 0===e?void 0:e.length)>1};exports.availableManualPaymentMethods=availableManualPaymentMethods,exports.availableMethodTypes=availableMethodTypes,exports.availableProcessors=availableProcessors,exports.getAvailableProcessor=getAvailableProcessor,exports.getProcessorByType=getProcessorByType,exports.hasMultipleMethodChoices=hasMultipleMethodChoices,exports.hasMultipleProcessorChoices=hasMultipleProcessorChoices,exports.hasOtherAvailableCreditCardProcessor=hasOtherAvailableCreditCardProcessor,exports.isMethodAwareProcessor=isMethodAwareProcessor,exports.onChange=onChange,exports.processorSupportsCurrentCurrency=processorSupportsCurrentCurrency,exports.state=state;