const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/UnlockedWallet-B6hSmM5s.js","chunks/index-YPJa-kxZ.js","chunks/_virtual_wxt-plugins-D2Qy6pl9.js","chunks/TeamThemeProvider-BMMWqJEv.js","chunks/debounce-D1Adyjvd.js","chunks/headers-DBBLE3ii.js","chunks/gateway-auth-C4f--iOs.js","chunks/vault-state-DXmi8wtw.js","chunks/compact-runtime-gCeKtXYh.js","chunks/witness-BJx3-Jdf.js"])))=>i.map(i=>d[i]);
import{_ as u,__tla as __tla_0}from"./index-YPJa-kxZ.js";import{ak as c,al as C,am as S,an as _,ao as T,ap as y,aq as A,c as x,ar as s,as as h,a as H,__tla as __tla_1}from"./_virtual_wxt-plugins-D2Qy6pl9.js";import{C as k,c as w}from"./contract-state-cache-5DyKqU8u.js";import{f as v,__tla as __tla_2}from"./contract-state-fetch-B2eVmQET.js";import{v as D,__tla as __tla_3}from"./UnlockedWallet-B6hSmM5s.js";import{__tla as __tla_4}from"./TeamThemeProvider-BMMWqJEv.js";import{__tla as __tla_5}from"./debounce-D1Adyjvd.js";import{__tla as __tla_6}from"./headers-DBBLE3ii.js";import{__tla as __tla_7}from"./gateway-auth-C4f--iOs.js";import{__tla as __tla_8}from"./vault-state-DXmi8wtw.js";let B,p,q,V,K;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})(),(()=>{try{return __tla_8}catch{}})()]).then(async()=>{const{load:F,invalidate:E,clear:M,cache:g}=w();p=function(t,o){try{const e=t.data?.state?.asArray();if(!e||e.length<6)return null;const a=c(C,e[0]),r=S(c(_,e[1])),n=c(T,e[2]),i=c(y,e[3]),l=c(A,e[4]),d=c(x,e[5]),f=n.is_some?s(h(n.value)):void 0;return{contractAddress:s(o),projectName:a,metadata:r,tokenColor:f,totalSupply:i,launcher:s(h(l)),isLaunched:d}}catch{return null}};V=async function(t){const o=s(t.contractAddress),e=`${t.network}:ft:${o}`;return F(e,async()=>{if(t.indexerUrl){const a=await v({indexerUrl:t.indexerUrl,contractAddress:o,operationName:"FT_CONTRACT_STATE",fetcher:t.fetcher});if(a)return p(a,o)}try{const{getTokenMetaCache:a}=await u(async()=>{const{getTokenMetaCache:n}=await import("./UnlockedWallet-B6hSmM5s.js").then(async m=>{await m.__tla;return m}).then(i=>i.ed);return{getTokenMetaCache:n}},__vite__mapDeps([0,1,2,3,4,5,6,7])),r=a().get(o);if(r?.state&&r?.contractAddress){const{ContractState:n,fromHex:i}=await u(async()=>{const{ContractState:f,fromHex:m}=await import("./compact-runtime-gCeKtXYh.js").then(async m=>{await m.__tla;return m});return{ContractState:f,fromHex:m}},__vite__mapDeps([8,0,1,2,3,4,5,6,7,9])),l=n.deserialize(i(r.state)),d=p(l,r.contractAddress);if(d)return d}}catch{}return null},t.force)};q=function(t){const o=s(t.contractAddress);E(`${t.network}:ft:${o}`)};B=function(){M()};K=function(t){try{const o=s(t.contractAddress),e=H.deserialize(D(t.stateHex)),a=p(e,o);if(a){const r=`${t.network}:ft:${o}`;g.set(r,{expiresAt:Date.now()+k,snapshot:a})}return a}catch{return null}}});export{k as CONTRACT_STATE_CACHE_TTL_MS,B as clearFtContractSnapshotCache,p as decodeFtContractSnapshot,q as invalidateFtContractSnapshot,V as loadFtContractSnapshot,K as preloadFtSnapshotFromState,__tla};