import{a as t}from"./index-n5dZU89t.js";const e="user_location_cache_v2",r=()=>{return r=null,o=null,c=function*(){try{const r=localStorage.getItem(e);if(r){const t=JSON.parse(r);if(Date.now()-t.timestamp<864e5)return{province:t.province,city:t.city}}const o=yield t.get({url:"/api/common/location",showErrorMessage:!1});if(o){const{province:t,city:r}=o,c={province:t||"",city:r||"",timestamp:Date.now()};return(t||r)&&localStorage.setItem(e,JSON.stringify(c)),{province:c.province,city:c.city}}}catch(r){}return{province:"",city:""}},new Promise((t,e)=>{var n=t=>{try{a(c.next(t))}catch(r){e(r)}},i=t=>{try{a(c.throw(t))}catch(r){e(r)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(n,i);a((c=c.apply(r,o)).next())});var r,o,c};export{r as g};
