(function(){let e=`https://api.cashing.com.br`,t=`@cashing:storage`,n=document.currentScript?.src,r=``;try{n&&(r=new URL(n).searchParams.get(`store`)||``)}catch{}let i=document.createElement(`link`);i.rel=`preconnect`,i.href=e,i.crossOrigin=`anonymous`,document.head.appendChild(i);let a=document.createElement(`link`);a.rel=`dns-prefetch`,a.href=e,document.head.appendChild(a);function o(e){try{return localStorage.getItem(e)}catch{return null}}function s(e,t){try{localStorage.setItem(e,t)}catch{}}function c(e){try{let t=JSON.parse(e||``);return t?.api_url?t:null}catch{return null}}async function l(t=2e3){let n=new AbortController,i=setTimeout(()=>n.abort(),t);try{return await fetch(`${e}/store?id_store=${r}`,{signal:n.signal})}finally{clearTimeout(i)}}async function u(){let e=c(o(t));try{let n=await l();if(!n.ok&&!e&&(n=await l(3e3)),!n.ok)return e;let r=await n.text(),i=c(r);return i&&s(t,r),i||e}catch{return e}}(async()=>{let e=await u();if(!e?.api_url)return;let{api_url:t,modules:n}=e;window.CA_URL=t,window.CA_OPTS=n||{};let r=document.createDocumentFragment();Object.entries(n).map(([e,t])=>({name:e,url:t.url})).forEach(({url:e})=>{let t=document.createElement(`script`);t.src=e,t.async=!0,r.appendChild(t)}),document.head.appendChild(r)})()})();