import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{t}from"./vendor-axios-BKU8NR6A.js";var n=[200,201,301,302,307,308];const checkUrlReachable=async e=>{try{let r=await t.head(e);return n.includes(r.status)}catch{return!1}};async function isInChina(){let e=navigator.language.toLowerCase().startsWith(`zh-cn`);try{if(await Promise.race([fetch(`https://www.google.com`,{mode:`no-cors`,cache:`no-cache`}),new Promise((e,t)=>setTimeout(()=>t(),2e3))]))return!1}catch{if(e)return!0;try{let e=performance.now();return await fetch(`https://www.baidu.com`,{mode:`no-cors`,cache:`no-cache`}),performance.now()-e<150}catch{return e}}return!1}export{isInChina as n,checkUrlReachable as t};
//# sourceMappingURL=networkUtil-DwmQqSmq.js.map