import{a as addQueryArgs}from"./add-query-args.js";var _a;const lang=(null===(_a=window.scData)||void 0===_a?void 0:_a.locale)||navigator.language||(null===navigator||void 0===navigator?void 0:navigator.browserLanguage)||(navigator.languages||["en"])[0],countryChoices=async()=>{var a,o,l,i;const n=addQueryArgs("https://api.surecart.com/v1/public/atlas",{locale:lang}),t=await fetch(n),r=await t.json(),s=null===(a=(null==r?void 0:r.data)||[])||void 0===a?void 0:a.map((({code:a,name:o})=>({value:a,label:o})));return(null===(i=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)||void 0===i?void 0:i.call(l,"surecart_address_countries",s))||s},getCountryDetails=async a=>{const o=addQueryArgs(`https://api.surecart.com/v1/public/atlas/${a}`,{locale:lang}),l=await fetch(o);return await l.json()};export{countryChoices as c,getCountryDetails as g};