import{o}from"./p-53e7f7d7.js";import{o as i,s as d}from"./p-4cae87fc.js";import{o as l,a as s,b as n,c as r}from"./p-566c9487.js";const t=()=>{var o,l;const i=[...s().map((({processor_type:o})=>o)),...n().map((({id:o})=>o))];i.includes(d.id)||(null===(l=null===(o=null===window||void 0===window?void 0:window.wp)||void 0===o?void 0:o.hooks)||void 0===l?void 0:l.applyFilters)&&!window.wp.hooks.applyFilters("surecart_auto_select_payment_method",!0)||(d.id=(null==i?void 0:i.length)?null==i?void 0:i[0]:null)},e=()=>{const o=(r()||[]).map((({id:o})=>o));"mollie"===(null==d?void 0:d.id)?o.includes(d.method)||(d.method=(null==o?void 0:o.length)?null==o?void 0:o[0]:null):d.method=null};o("checkout",(()=>{t(),e()})),i("id",(()=>t())),l("processors",(()=>t())),l("disabled",(()=>t())),l("methods",(()=>e()));