@dcl/profile-site 0.6.6-6101860464.commit-23dbd1c → 0.6.7-6162920852.commit-91b418e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{index-7d8674d8.css → index-15d10ca3.css} +3 -3
- package/assets/{index-0ae3473a.js → index-2c3ee63b.js} +1 -1
- package/assets/{index-2a4dfafd.js → index-4bdb3a41.js} +1 -1
- package/assets/{index-9f42bf97.js → index-eaf6aff8.js} +127 -127
- package/assets/{index-8835906a.js → index-ff1b100f.js} +1 -1
- package/index.html +5 -5
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as _t,s as ce,T as N,t as U,a as C,o as ot,R as Bo,p as q,y as gt}from"./index-
|
|
1
|
+
import{n as _t,s as ce,T as N,t as U,a as C,o as ot,R as Bo,p as q,y as gt}from"./index-4bdb3a41.js";import{o as Do}from"./index-eaf6aff8.js";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as fe}from"./index-9f42bf97.js";const me=Symbol(),ee=Object.getPrototypeOf,F=new WeakMap,ge=e=>e&&(F.has(e)?F.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),he=e=>ge(e)&&e[me]||null,te=(e,t=!0)=>{F.set(e,t)},J=e=>typeof e=="object"&&e!==null,D=new WeakMap,B=new WeakSet,be=(e=Object.is,t=(n,W)=>new Proxy(n,W),s=n=>J(n)&&!B.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),i=n=>n.configurable&&n.enumerable&&n.writable,c=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},d=new WeakMap,g=(n,W,C=c)=>{const b=d.get(n);if((b==null?void 0:b[0])===W)return b[1];const y=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return te(y,!0),d.set(n,[W,y]),Reflect.ownKeys(n).forEach(k=>{if(Object.getOwnPropertyDescriptor(y,k))return;const A=Reflect.get(n,k),M={value:A,enumerable:!0,configurable:!0};if(B.has(A))te(A,!1);else if(A instanceof Promise)delete M.value,M.get=()=>C(A);else if(D.has(A)){const[v,z]=D.get(A);M.value=g(v,z(),C)}Object.defineProperty(y,k,M)}),Object.preventExtensions(y)},m=new WeakMap,h=[1,1],j=n=>{if(!J(n))throw new Error("object required");const W=m.get(n);if(W)return W;let C=h[0];const b=new Set,y=(a,o=++h[0])=>{C!==o&&(C=o,b.forEach(l=>l(a,o)))};let k=h[1];const A=(a=++h[1])=>(k!==a&&!b.size&&(k=a,v.forEach(([o])=>{const l=o[1](a);l>C&&(C=l)})),C),M=a=>(o,l)=>{const r=[...o];r[1]=[a,...r[1]],y(r,l)},v=new Map,z=(a,o)=>{if(b.size){const l=o[3](M(a));v.set(a,[o,l])}else v.set(a,[o])},Y=a=>{var o;const l=v.get(a);l&&(v.delete(a),(o=l[1])==null||o.call(l))},ue=a=>(b.add(a),b.size===1&&v.forEach(([l,r],I)=>{const S=l[3](M(I));v.set(I,[l,S])}),()=>{b.delete(a),b.size===0&&v.forEach(([l,r],I)=>{r&&(r(),v.set(I,[l]))})}),H=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),Z=(a,o,l,r,I)=>{if(a&&(e(o,r)||m.has(r)&&e(o,m.get(r))))return;Y(l),J(r)&&(r=he(r)||r);let S=r;if(r instanceof Promise)r.then(E=>{r.status="fulfilled",r.value=E,y(["resolve",[l],E])}).catch(E=>{r.status="rejected",r.reason=E,y(["reject",[l],E])});else{!D.has(r)&&s(r)&&(S=j(r));const E=!B.has(S)&&D.get(S);E&&z(l,E)}I(S),y(["set",[l],r,o])},$=t(H,{deleteProperty(a,o){const l=Reflect.get(a,o);Y(o);const r=Reflect.deleteProperty(a,o);return r&&y(["delete",[o],l]),r},set(a,o,l,r){const I=Reflect.has(a,o),S=Reflect.get(a,o,r);return Z(I,S,o,l,E=>{Reflect.set(a,o,E,r)}),!0},defineProperty(a,o,l){if(i(l)){const r=Reflect.getOwnPropertyDescriptor(a,o);if(!r||i(r))return Z(!!r&&"value"in r,r==null?void 0:r.value,o,l.value,I=>{Reflect.defineProperty(a,o,{...l,value:I})}),!0}return Reflect.defineProperty(a,o,l)}});m.set(n,$);const pe=[H,A,g,ue];return D.set($,pe),Reflect.ownKeys(n).forEach(a=>{const o=Object.getOwnPropertyDescriptor(n,a);"value"in o&&($[a]=n[a],delete o.value,delete o.writable),Object.defineProperty(H,a,o)}),$})=>[j,D,B,e,t,s,i,c,d,g,m,h],[ye]=be();function U(e={}){return ye(e)}function _(e,t,s){const i=D.get(e);let c;const d=[],g=i[3];let m=!1;const j=g(n=>{if(d.push(n),s){t(d.splice(0));return}c||(c=Promise.resolve().then(()=>{c=void 0,m&&t(d.splice(0))}))});return m=!0,()=>{m=!1,j()}}function ve(e,t){const s=D.get(e),[i,c,d]=s;return d(i,c(),t)}const u=U({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return _(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},f={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return f.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return f.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(f.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let i=e;i.includes("://")||(i=e.replaceAll("/","").replaceAll(":",""),i=`${i}://`),i.endsWith("/")||(i=`${i}/`),this.setWalletConnectDeepLink(i,s);const c=encodeURIComponent(t);return`${i}wc?uri=${c}`},formatUniversalUrl(e,t,s){if(!f.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let i=e;i.endsWith("/")||(i=`${i}/`),this.setWalletConnectDeepLink(i,s);const c=encodeURIComponent(t);return`${i}wc?uri=${c}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(f.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(f.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(f.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(f.WCM_VERSION,"2.6.1")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=U({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:p,subscribe(e){return _(p.events,()=>e(ve(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},L=U({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:L,subscribe(e){return _(L,()=>e(L))},setChains(e){L.chains=e},setWalletConnectUri(e){L.walletConnectUri=e},setIsCustomDesktop(e){L.isCustomDesktop=e},setIsCustomMobile(e){L.isCustomMobile=e},setIsDataLoaded(e){L.isDataLoaded=e},setIsUiLoaded(e){L.isUiLoaded=e},setIsAuth(e){L.isAuth=e}},x=U({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}),T={state:x,subscribe(e){return _(x,()=>e(x))},setConfig(e){var t,s;Ie.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),f.setModalVersionInStorage(),Object.assign(x,e)}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Le.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.6.1";async function K(e,t){const s=We({sdkType:Q,sdkVersion:X},t),i=new URL(e,G);return i.searchParams.append("projectId",T.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&i.searchParams.append(c,String(d))}),(await fetch(i)).json()}const P={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${T.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${T.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Ae=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,De=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Se.call(t,s)&&re(e,s,t[s]);return e};const ie=f.isMobile(),O=U({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Te={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=T.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(f.isArray(e)){const s={recommendedIds:e.join(",")},{listings:i}=await P.getAllListings(s),c=Object.values(i);c.sort((d,g)=>{const m=e.indexOf(d.id),h=e.indexOf(g.id);return m-h}),O.recomendedWallets=c}else{const{chains:s,isAuth:i}=w.state,c=s==null?void 0:s.join(","),d=f.isArray(t),g={page:1,sdks:i?"auth_v1":void 0,entries:f.RECOMMENDED_WALLET_AMOUNT,chains:c,version:2,excludedIds:d?t.join(","):void 0},{listings:m}=ie?await P.getMobileListings(g):await P.getDesktopListings(g);O.recomendedWallets=Object.values(m)}return O.recomendedWallets},async getWallets(e){const t=De({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:i}=T.state,{recomendedWallets:c}=O;if(i==="ALL")return O.wallets;c.length?t.excludedIds=c.map(W=>W.id).join(","):f.isArray(s)&&(t.excludedIds=s.join(",")),f.isArray(i)&&(t.excludedIds=[t.excludedIds,i].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:d,search:g}=e,{listings:m,total:h}=ie?await P.getMobileListings(t):await P.getDesktopListings(t),j=Object.values(m),n=g?"search":"wallets";return O[n]={listings:[...O[n].listings,...j],total:h,page:d??1},{listings:j,total:h}},getWalletImageUrl(e){return P.getWalletImageUrl(e)},getAssetImageUrl(e){return P.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},N=U({open:!1}),q={state:N,subscribe(e){return _(N,()=>e(N))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:i}=w.state;if(f.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&i)N.open=!0,t();else{const c=setInterval(()=>{const d=w.state;d.isUiLoaded&&d.isDataLoaded&&(clearInterval(c),N.open=!0,t())},200)}})},close(){N.open=!1}};var Ue=Object.defineProperty,ae=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Pe=(e,t)=>{for(var s in t||(t={}))je.call(t,s)&&le(e,s,t[s]);if(ae)for(var s of ae(t))Me.call(t,s)&&le(e,s,t[s]);return e};function Re(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const V=U({themeMode:Re()?"dark":"light"}),ce={state:V,subscribe(e){return _(V,()=>e(V))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(V.themeMode=t),s&&(V.themeVariables=Pe({},s))}},R=U({open:!1,message:"",variant:"success"}),Ve={state:R,subscribe(e){return _(R,()=>e(R))},openToast(e,t){R.open=!0,R.message=e,R.variant=t},closeToast(){R.open=!1}};class _e{constructor(t){this.openModal=q.open,this.closeModal=q.close,this.subscribeModal=q.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),T.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await fe(()=>import("./index-0ae3473a.js"),["assets/index-0ae3473a.js","assets/index-9f42bf97.js","assets/index-7d8674d8.css"]);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const $e=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:_e},Symbol.toStringTag,{value:"Module"}));export{Ie as R,de as T,f as a,$e as i,ce as n,Ve as o,w as p,q as s,Te as t,T as y};
|
|
1
|
+
import{n as fe}from"./index-eaf6aff8.js";const me=Symbol(),ee=Object.getPrototypeOf,F=new WeakMap,ge=e=>e&&(F.has(e)?F.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),he=e=>ge(e)&&e[me]||null,te=(e,t=!0)=>{F.set(e,t)},J=e=>typeof e=="object"&&e!==null,D=new WeakMap,B=new WeakSet,be=(e=Object.is,t=(n,W)=>new Proxy(n,W),s=n=>J(n)&&!B.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),i=n=>n.configurable&&n.enumerable&&n.writable,c=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},d=new WeakMap,g=(n,W,C=c)=>{const b=d.get(n);if((b==null?void 0:b[0])===W)return b[1];const y=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return te(y,!0),d.set(n,[W,y]),Reflect.ownKeys(n).forEach(k=>{if(Object.getOwnPropertyDescriptor(y,k))return;const A=Reflect.get(n,k),M={value:A,enumerable:!0,configurable:!0};if(B.has(A))te(A,!1);else if(A instanceof Promise)delete M.value,M.get=()=>C(A);else if(D.has(A)){const[v,z]=D.get(A);M.value=g(v,z(),C)}Object.defineProperty(y,k,M)}),Object.preventExtensions(y)},m=new WeakMap,h=[1,1],j=n=>{if(!J(n))throw new Error("object required");const W=m.get(n);if(W)return W;let C=h[0];const b=new Set,y=(a,o=++h[0])=>{C!==o&&(C=o,b.forEach(l=>l(a,o)))};let k=h[1];const A=(a=++h[1])=>(k!==a&&!b.size&&(k=a,v.forEach(([o])=>{const l=o[1](a);l>C&&(C=l)})),C),M=a=>(o,l)=>{const r=[...o];r[1]=[a,...r[1]],y(r,l)},v=new Map,z=(a,o)=>{if(b.size){const l=o[3](M(a));v.set(a,[o,l])}else v.set(a,[o])},Y=a=>{var o;const l=v.get(a);l&&(v.delete(a),(o=l[1])==null||o.call(l))},ue=a=>(b.add(a),b.size===1&&v.forEach(([l,r],I)=>{const S=l[3](M(I));v.set(I,[l,S])}),()=>{b.delete(a),b.size===0&&v.forEach(([l,r],I)=>{r&&(r(),v.set(I,[l]))})}),H=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),Z=(a,o,l,r,I)=>{if(a&&(e(o,r)||m.has(r)&&e(o,m.get(r))))return;Y(l),J(r)&&(r=he(r)||r);let S=r;if(r instanceof Promise)r.then(E=>{r.status="fulfilled",r.value=E,y(["resolve",[l],E])}).catch(E=>{r.status="rejected",r.reason=E,y(["reject",[l],E])});else{!D.has(r)&&s(r)&&(S=j(r));const E=!B.has(S)&&D.get(S);E&&z(l,E)}I(S),y(["set",[l],r,o])},$=t(H,{deleteProperty(a,o){const l=Reflect.get(a,o);Y(o);const r=Reflect.deleteProperty(a,o);return r&&y(["delete",[o],l]),r},set(a,o,l,r){const I=Reflect.has(a,o),S=Reflect.get(a,o,r);return Z(I,S,o,l,E=>{Reflect.set(a,o,E,r)}),!0},defineProperty(a,o,l){if(i(l)){const r=Reflect.getOwnPropertyDescriptor(a,o);if(!r||i(r))return Z(!!r&&"value"in r,r==null?void 0:r.value,o,l.value,I=>{Reflect.defineProperty(a,o,{...l,value:I})}),!0}return Reflect.defineProperty(a,o,l)}});m.set(n,$);const pe=[H,A,g,ue];return D.set($,pe),Reflect.ownKeys(n).forEach(a=>{const o=Object.getOwnPropertyDescriptor(n,a);"value"in o&&($[a]=n[a],delete o.value,delete o.writable),Object.defineProperty(H,a,o)}),$})=>[j,D,B,e,t,s,i,c,d,g,m,h],[ye]=be();function U(e={}){return ye(e)}function _(e,t,s){const i=D.get(e);let c;const d=[],g=i[3];let m=!1;const j=g(n=>{if(d.push(n),s){t(d.splice(0));return}c||(c=Promise.resolve().then(()=>{c=void 0,m&&t(d.splice(0))}))});return m=!0,()=>{m=!1,j()}}function ve(e,t){const s=D.get(e),[i,c,d]=s;return d(i,c(),t)}const u=U({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return _(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},f={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return f.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return f.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(f.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let i=e;i.includes("://")||(i=e.replaceAll("/","").replaceAll(":",""),i=`${i}://`),i.endsWith("/")||(i=`${i}/`),this.setWalletConnectDeepLink(i,s);const c=encodeURIComponent(t);return`${i}wc?uri=${c}`},formatUniversalUrl(e,t,s){if(!f.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let i=e;i.endsWith("/")||(i=`${i}/`),this.setWalletConnectDeepLink(i,s);const c=encodeURIComponent(t);return`${i}wc?uri=${c}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(f.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(f.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(f.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(f.WCM_VERSION,"2.6.1")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=U({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:p,subscribe(e){return _(p.events,()=>e(ve(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},L=U({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:L,subscribe(e){return _(L,()=>e(L))},setChains(e){L.chains=e},setWalletConnectUri(e){L.walletConnectUri=e},setIsCustomDesktop(e){L.isCustomDesktop=e},setIsCustomMobile(e){L.isCustomMobile=e},setIsDataLoaded(e){L.isDataLoaded=e},setIsUiLoaded(e){L.isUiLoaded=e},setIsAuth(e){L.isAuth=e}},x=U({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}),T={state:x,subscribe(e){return _(x,()=>e(x))},setConfig(e){var t,s;Ie.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),f.setModalVersionInStorage(),Object.assign(x,e)}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Le.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.6.1";async function K(e,t){const s=We({sdkType:Q,sdkVersion:X},t),i=new URL(e,G);return i.searchParams.append("projectId",T.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&i.searchParams.append(c,String(d))}),(await fetch(i)).json()}const P={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${T.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${T.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Ae=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,De=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Se.call(t,s)&&re(e,s,t[s]);return e};const ie=f.isMobile(),O=U({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Te={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=T.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(f.isArray(e)){const s={recommendedIds:e.join(",")},{listings:i}=await P.getAllListings(s),c=Object.values(i);c.sort((d,g)=>{const m=e.indexOf(d.id),h=e.indexOf(g.id);return m-h}),O.recomendedWallets=c}else{const{chains:s,isAuth:i}=w.state,c=s==null?void 0:s.join(","),d=f.isArray(t),g={page:1,sdks:i?"auth_v1":void 0,entries:f.RECOMMENDED_WALLET_AMOUNT,chains:c,version:2,excludedIds:d?t.join(","):void 0},{listings:m}=ie?await P.getMobileListings(g):await P.getDesktopListings(g);O.recomendedWallets=Object.values(m)}return O.recomendedWallets},async getWallets(e){const t=De({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:i}=T.state,{recomendedWallets:c}=O;if(i==="ALL")return O.wallets;c.length?t.excludedIds=c.map(W=>W.id).join(","):f.isArray(s)&&(t.excludedIds=s.join(",")),f.isArray(i)&&(t.excludedIds=[t.excludedIds,i].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:d,search:g}=e,{listings:m,total:h}=ie?await P.getMobileListings(t):await P.getDesktopListings(t),j=Object.values(m),n=g?"search":"wallets";return O[n]={listings:[...O[n].listings,...j],total:h,page:d??1},{listings:j,total:h}},getWalletImageUrl(e){return P.getWalletImageUrl(e)},getAssetImageUrl(e){return P.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},N=U({open:!1}),q={state:N,subscribe(e){return _(N,()=>e(N))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:i}=w.state;if(f.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&i)N.open=!0,t();else{const c=setInterval(()=>{const d=w.state;d.isUiLoaded&&d.isDataLoaded&&(clearInterval(c),N.open=!0,t())},200)}})},close(){N.open=!1}};var Ue=Object.defineProperty,ae=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Pe=(e,t)=>{for(var s in t||(t={}))je.call(t,s)&&le(e,s,t[s]);if(ae)for(var s of ae(t))Me.call(t,s)&&le(e,s,t[s]);return e};function Re(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const V=U({themeMode:Re()?"dark":"light"}),ce={state:V,subscribe(e){return _(V,()=>e(V))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(V.themeMode=t),s&&(V.themeVariables=Pe({},s))}},R=U({open:!1,message:"",variant:"success"}),Ve={state:R,subscribe(e){return _(R,()=>e(R))},openToast(e,t){R.open=!0,R.message=e,R.variant=t},closeToast(){R.open=!1}};class _e{constructor(t){this.openModal=q.open,this.closeModal=q.close,this.subscribeModal=q.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),T.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await fe(()=>import("./index-2c3ee63b.js"),["assets/index-2c3ee63b.js","assets/index-eaf6aff8.js","assets/index-15d10ca3.css"]);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const $e=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:_e},Symbol.toStringTag,{value:"Module"}));export{Ie as R,de as T,f as a,$e as i,ce as n,Ve as o,w as p,q as s,Te as t,T as y};
|