Root Zanli
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
o5t6x7pgljbm
/
public_html
/
tuitwallet.com
/
static
/
js
/
Filename :
495.956dd640.chunk.js
back
Copy
"use strict";(self.webpackChunkwallet_connect=self.webpackChunkwallet_connect||[]).push([[495],{6022:(e,t,s)=>{s.d(t,{AV:()=>n,ConfigCtrl:()=>m,ExplorerCtrl:()=>k,OptionsCtrl:()=>p,ThemeCtrl:()=>R,ToastCtrl:()=>H,jb:()=>T,uA:()=>d,zv:()=>i});var o=s(1735);const a=(0,o.sj)({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),n={state:a,subscribe:e=>(0,o.Ld)(a,(()=>e(a))),push(e,t){e!==a.view&&(a.view=e,t&&(a.data=t),a.history.push(e))},reset(e){a.view=e,a.history=[e]},replace(e){a.history.length>1&&(a.history[a.history.length-1]=e,a.view=e)},goBack(){if(a.history.length>1){a.history.pop();const[e]=a.history.slice(-1);a.view=e}},setData(e){a.data=e}},i={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>typeof window<"u"&&Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>i.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return i.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,formatNativeUrl(e,t,s){if(i.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);return`${o}wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,s){if(!i.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let o=e;o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);return`${o}wc?uri=${encodeURIComponent(t)}`},wait:async e=>new Promise((t=>{setTimeout(t,e)})),openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(i.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(i.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(i.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(i.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=null==(e=n.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},l=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),r=(0,o.sj)({enabled:l,userSessionId:"",events:[],connectedWalletId:void 0}),d={state:r,subscribe:e=>(0,o.Ld)(r.events,(()=>e((0,o.CO)(r.events[r.events.length-1])))),initialize(){r.enabled&&typeof(null==crypto?void 0:crypto.randomUUID)<"u"&&(r.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){r.connectedWalletId=e},click(e){if(r.enabled){const t={type:"CLICK",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}},track(e){if(r.enabled){const t={type:"TRACK",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}},view(e){if(r.enabled){const t={type:"VIEW",name:e.name,userSessionId:r.userSessionId,timestamp:Date.now(),data:e};r.events.push(t)}}},c=(0,o.sj)({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),p={state:c,subscribe:e=>(0,o.Ld)(c,(()=>e(c))),setChains(e){c.chains=e},setWalletConnectUri(e){c.walletConnectUri=e},setIsCustomDesktop(e){c.isCustomDesktop=e},setIsCustomMobile(e){c.isCustomMobile=e},setIsDataLoaded(e){c.isDataLoaded=e},setIsUiLoaded(e){c.isUiLoaded=e},setIsAuth(e){c.isAuth=e}},u=(0,o.sj)({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),m={state:u,subscribe:e=>(0,o.Ld)(u,(()=>e(u))),setConfig(e){var t,s;d.initialize(),p.setChains(e.chains),p.setIsAuth(Boolean(e.enableAuthMode)),p.setIsCustomMobile(Boolean(null==(t=e.mobileWallets)?void 0:t.length)),p.setIsCustomDesktop(Boolean(null==(s=e.desktopWallets)?void 0:s.length)),i.setModalVersionInStorage(),Object.assign(u,e)}};var g=Object.defineProperty,h=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,I=(e,t,s)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const C="https://explorer-api.walletconnect.com",y="wcm",f="js-2.6.2";async function w(e,t){const s=((e,t)=>{for(var s in t||(t={}))b.call(t,s)&&I(e,s,t[s]);if(h)for(var s of h(t))v.call(t,s)&&I(e,s,t[s]);return e})({sdkType:y,sdkVersion:f},t),o=new URL(e,C);return o.searchParams.append("projectId",m.state.projectId),Object.entries(s).forEach((e=>{let[t,s]=e;s&&o.searchParams.append(t,String(s))})),(await fetch(o)).json()}const L={getDesktopListings:async e=>w("/w3m/v1/getDesktopListings",e),getMobileListings:async e=>w("/w3m/v1/getMobileListings",e),getInjectedListings:async e=>w("/w3m/v1/getInjectedListings",e),getAllListings:async e=>w("/w3m/v1/getAllListings",e),getWalletImageUrl:e=>`${C}/w3m/v1/getWalletImage/${e}?projectId=${m.state.projectId}&sdkType=${y}&sdkVersion=${f}`,getAssetImageUrl:e=>`${C}/w3m/v1/getAssetImage/${e}?projectId=${m.state.projectId}&sdkType=${y}&sdkVersion=${f}`};var W=Object.defineProperty,O=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,A=(e,t,s)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const U=i.isMobile(),M=(0,o.sj)({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),k={state:M,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=m.state;if("NONE"===e||"ALL"===t&&!e)return M.recomendedWallets;if(i.isArray(e)){const t={recommendedIds:e.join(",")},{listings:s}=await L.getAllListings(t),o=Object.values(s);o.sort(((t,s)=>e.indexOf(t.id)-e.indexOf(s.id))),M.recomendedWallets=o}else{const{chains:e,isAuth:s}=p.state,o=null===e||void 0===e?void 0:e.join(","),a=i.isArray(t),n={page:1,sdks:s?"auth_v1":void 0,entries:i.RECOMMENDED_WALLET_AMOUNT,chains:o,version:2,excludedIds:a?t.join(","):void 0},{listings:l}=U?await L.getMobileListings(n):await L.getDesktopListings(n);M.recomendedWallets=Object.values(l)}return M.recomendedWallets},async getWallets(e){const t=((e,t)=>{for(var s in t||(t={}))E.call(t,s)&&A(e,s,t[s]);if(O)for(var s of O(t))j.call(t,s)&&A(e,s,t[s]);return e})({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:o}=m.state,{recomendedWallets:a}=M;if("ALL"===o)return M.wallets;a.length?t.excludedIds=a.map((e=>e.id)).join(","):i.isArray(s)&&(t.excludedIds=s.join(",")),i.isArray(o)&&(t.excludedIds=[t.excludedIds,o].filter(Boolean).join(",")),p.state.isAuth&&(t.sdks="auth_v1");const{page:n,search:l}=e,{listings:r,total:d}=U?await L.getMobileListings(t):await L.getDesktopListings(t),c=Object.values(r),u=l?"search":"wallets";return M[u]={listings:[...M[u].listings,...c],total:d,page:null!==n&&void 0!==n?n:1},{listings:c,total:d}},getWalletImageUrl:e=>L.getWalletImageUrl(e),getAssetImageUrl:e=>L.getAssetImageUrl(e),resetSearch(){M.search={listings:[],total:0,page:1}}},D=(0,o.sj)({open:!1}),T={state:D,subscribe:e=>(0,o.Ld)(D,(()=>e(D))),open:async e=>new Promise((t=>{const{isUiLoaded:s,isDataLoaded:o}=p.state;if(i.removeWalletConnectDeepLink(),p.setWalletConnectUri(null===e||void 0===e?void 0:e.uri),p.setChains(null===e||void 0===e?void 0:e.chains),n.reset("ConnectWallet"),s&&o)D.open=!0,t();else{const e=setInterval((()=>{const s=p.state;s.isUiLoaded&&s.isDataLoaded&&(clearInterval(e),D.open=!0,t())}),200)}})),close(){D.open=!1}};var N=Object.defineProperty,S=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,x=(e,t,s)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const $=(0,o.sj)({themeMode:typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),R={state:$,subscribe:e=>(0,o.Ld)($,(()=>e($))),setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&($.themeMode=t),s&&($.themeVariables=((e,t)=>{for(var s in t||(t={}))P.call(t,s)&&x(e,s,t[s]);if(S)for(var s of S(t))_.call(t,s)&&x(e,s,t[s]);return e})({},s))}},V=(0,o.sj)({open:!1,message:"",variant:"success"}),H={state:V,subscribe:e=>(0,o.Ld)(V,(()=>e(V))),openToast(e,t){V.open=!0,V.message=e,V.variant=t},closeToast(){V.open=!1}}},2495:(e,t,s)=>{s.d(t,{WalletConnectModal:()=>a});var o=s(6022);class a{constructor(e){this.openModal=o.jb.open,this.closeModal=o.jb.close,this.subscribeModal=o.jb.subscribe,this.setTheme=o.ThemeCtrl.setThemeConfig,o.ThemeCtrl.setThemeConfig(e),o.ConfigCtrl.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await s.e(889).then(s.bind(s,7889));const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),o.OptionsCtrl.setIsUiLoaded(!0)}}}}}]); //# sourceMappingURL=495.956dd640.chunk.js.map