@dcl/vesting-dashboard 3.4.0 → 3.4.1-11501425816.commit-f9cd158
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/{fortmatic-e0c32184.js → fortmatic-cc7babf5.js} +1 -1
- package/assets/{index-9ab4b2f8.js → index-18b3dfcd.js} +7 -7
- package/assets/{index-1d8346ff.js → index-31698ce2.js} +1 -1
- package/assets/{index-d326c9c7.css → index-34dd439d.css} +7 -7
- package/assets/{index-ca7be960.js → index-353052d6.js} +1 -1
- package/assets/{index-82a5f67d.js → index-3849c0d9.js} +1 -1
- package/assets/{index-b90c7536.js → index-48efc568.js} +1 -1
- package/assets/{index-7058a6d1.js → index-62d2e0b3.js} +1 -1
- package/assets/{index-f3bb1efd.js → index-9982ed00.js} +1 -1
- package/assets/{index.es-548f3f57.js → index.es-760111fd.js} +2 -2
- package/index.html +4 -4
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as fe,_ as pe}from"./index-9ab4b2f8.js";const he=Symbol(),Z=Object.getPrototypeOf,J=new WeakMap,me=e=>e&&(J.has(e)?J.get(e):Z(e)===Object.prototype||Z(e)===Array.prototype),ge=e=>me(e)&&e[he]||null,ee=(e,t=!0)=>{J.set(e,t)},q=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ve=(e=Object.is,t=(r,g)=>new Proxy(r,g),s=r=>q(r)&&!x.has(r)&&(Array.isArray(r)||!(Symbol.iterator in r))&&!(r instanceof WeakMap)&&!(r instanceof WeakSet)&&!(r instanceof Error)&&!(r instanceof Number)&&!(r instanceof Date)&&!(r instanceof String)&&!(r instanceof RegExp)&&!(r instanceof ArrayBuffer),n=r=>{switch(r.status){case"fulfilled":return r.value;case"rejected":throw r.reason;default:throw r}},c=new WeakMap,l=(r,g,E=n)=>{const v=c.get(r);if((v==null?void 0:v[0])===g)return v[1];const y=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r));return ee(y,!0),c.set(r,[g,y]),Reflect.ownKeys(r).forEach(U=>{if(Object.getOwnPropertyDescriptor(y,U))return;const O=Reflect.get(r,U),P={value:O,enumerable:!0,configurable:!0};if(x.has(O))ee(O,!1);else if(O instanceof Promise)delete P.value,P.get=()=>E(O);else if(C.has(O)){const[b,z]=C.get(O);P.value=l(b,z(),E)}Object.defineProperty(y,U,P)}),Object.preventExtensions(y)},d=new WeakMap,f=[1,1],L=r=>{if(!q(r))throw new Error("object required");const g=d.get(r);if(g)return g;let E=f[0];const v=new Set,y=(i,a=++f[0])=>{E!==a&&(E=a,v.forEach(o=>o(i,a)))};let U=f[1];const O=(i=++f[1])=>(U!==i&&!v.size&&(U=i,b.forEach(([a])=>{const o=a[1](i);o>E&&(E=o)})),E),P=i=>(a,o)=>{const m=[...a];m[1]=[i,...m[1]],y(m,o)},b=new Map,z=(i,a)=>{if(v.size){const o=a[3](P(i));b.set(i,[a,o])}else b.set(i,[a])},X=i=>{var a;const o=b.get(i);o&&(b.delete(i),(a=o[1])==null||a.call(o))},de=i=>(v.add(i),v.size===1&&b.forEach(([o,m],j)=>{const $=o[3](P(j));b.set(j,[o,$])}),()=>{v.delete(i),v.size===0&&b.forEach(([o,m],j)=>{m&&(m(),b.set(j,[o]))})}),H=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r)),k=t(H,{deleteProperty(i,a){const o=Reflect.get(i,a);X(a);const m=Reflect.deleteProperty(i,a);return m&&y(["delete",[a],o]),m},set(i,a,o,m){const j=Reflect.has(i,a),$=Reflect.get(i,a,m);if(j&&(e($,o)||d.has(o)&&e($,d.get(o))))return!0;X(a),q(o)&&(o=ge(o)||o);let V=o;if(o instanceof Promise)o.then(W=>{o.status="fulfilled",o.value=W,y(["resolve",[a],W])}).catch(W=>{o.status="rejected",o.reason=W,y(["reject",[a],W])});else{!C.has(o)&&s(o)&&(V=L(o));const W=!x.has(V)&&C.get(V);W&&z(a,W)}return Reflect.set(i,a,V,m),y(["set",[a],o,$]),!0}});d.set(r,k);const ue=[H,O,l,de];return C.set(k,ue),Reflect.ownKeys(r).forEach(i=>{const a=Object.getOwnPropertyDescriptor(r,i);"value"in a&&(k[i]=r[i],delete a.value,delete a.writable),Object.defineProperty(H,i,a)}),k})=>[L,C,x,e,t,s,n,c,l,d,f],[ye]=ve();function A(e={}){return ye(e)}function M(e,t,s){const n=C.get(e);let c;const l=[],d=n[3];let f=!1;const r=d(g=>{if(l.push(g),s){t(l.splice(0));return}c||(c=Promise.resolve().then(()=>{c=void 0,f&&t(l.splice(0))}))});return f=!0,()=>{f=!1,r()}}function be(e,t){const s=C.get(e),[n,c,l]=s;return l(n,c(),t)}const u=A({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ce={state:u,subscribe(e){return M(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}},h={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 h.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return h.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},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(h.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const c=encodeURIComponent(t);return`${n}wc?uri=${c}`},formatUniversalUrl(e,t,s){if(!h.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const l=fe.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",l),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const c=encodeURIComponent(t);return`${n}wc?uri=${c}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(h.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(h.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(h.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(h.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=ce.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=A({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),Ee={state:p,subscribe(e){return M(p.events,()=>e(be(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)}}},I=A({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:I,subscribe(e){return M(I,()=>e(I))},setChains(e){I.chains=e},setWalletConnectUri(e){I.walletConnectUri=e},setIsCustomDesktop(e){I.isCustomDesktop=e},setIsCustomMobile(e){I.isCustomMobile=e},setIsDataLoaded(e){I.isDataLoaded=e},setIsUiLoaded(e){I.isUiLoaded=e},setIsAuth(e){I.isAuth=e}},B=A({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:B,subscribe(e){return M(B,()=>e(B))},setConfig(e){var t,s;Ee.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)),h.setModalVersionInStorage(),Object.assign(B,e)}};var Ie=Object.defineProperty,te=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,se=(e,t,s)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))_e.call(t,s)&&se(e,s,t[s]);if(te)for(var s of te(t))Oe.call(t,s)&&se(e,s,t[s]);return e};const Y="https://explorer-api.walletconnect.com",G="wcm",Q="js-2.7.0";async function K(e,t){const s=Le({sdkType:G,sdkVersion:Q},t),n=new URL(e,Y);return n.searchParams.append("projectId",T.state.projectId),Object.entries(s).forEach(([l,d])=>{d&&n.searchParams.append(l,String(d))}),(await fetch(n)).json()}const S={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`${Y}/w3m/v1/getWalletImage/${e}?projectId=${T.state.projectId}&sdkType=${G}&sdkVersion=${Q}`},getAssetImageUrl(e){return`${Y}/w3m/v1/getAssetImage/${e}?projectId=${T.state.projectId}&sdkType=${G}&sdkVersion=${Q}`}};var We=Object.defineProperty,ne=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Pe=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&re(e,s,t[s]);if(ne)for(var s of ne(t))Ae.call(t,s)&&re(e,s,t[s]);return e};const oe=h.isMobile(),_=A({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:_,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=T.state;if(e==="NONE"||t==="ALL"&&!e)return _.recomendedWallets;if(h.isArray(e)){const n={recommendedIds:e.join(",")},{listings:c}=await S.getAllListings(n),l=Object.values(c);l.sort((d,f)=>{const L=e.indexOf(d.id),r=e.indexOf(f.id);return L-r}),_.recomendedWallets=l}else{const{chains:s,isAuth:n}=w.state,c=s==null?void 0:s.join(","),l=h.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:h.RECOMMENDED_WALLET_AMOUNT,chains:c,version:2,excludedIds:l?t.join(","):void 0},{listings:f}=oe?await S.getMobileListings(d):await S.getDesktopListings(d);_.recomendedWallets=Object.values(f)}return _.recomendedWallets},async getWallets(e){const t=Pe({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=T.state,{recomendedWallets:c}=_;if(n==="ALL")return _.wallets;c.length?t.excludedIds=c.map(E=>E.id).join(","):h.isArray(s)&&(t.excludedIds=s.join(",")),h.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:l,search:d}=e,{listings:f,total:L}=oe?await S.getMobileListings(t):await S.getDesktopListings(t),r=Object.values(f),g=d?"search":"wallets";return _[g]={listings:[..._[g].listings,...r],total:L,page:l??1},{listings:r,total:L}},getWalletImageUrl(e){return S.getWalletImageUrl(e)},getAssetImageUrl(e){return S.getAssetImageUrl(e)},resetSearch(){_.search={listings:[],total:0,page:1}}},R=A({open:!1}),F={state:R,subscribe(e){return M(R,()=>e(R))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=w.state;if(h.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),ce.reset("ConnectWallet"),s&&n)R.open=!0,t();else{const c=setInterval(()=>{const l=w.state;l.isUiLoaded&&l.isDataLoaded&&(clearInterval(c),R.open=!0,t())},200)}})},close(){R.open=!1}};var Se=Object.defineProperty,ae=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,ie=(e,t,s)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&ie(e,s,t[s]);if(ae)for(var s of ae(t))Me.call(t,s)&&ie(e,s,t[s]);return e};function je(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const N=A({themeMode:je()?"dark":"light"}),le={state:N,subscribe(e){return M(N,()=>e(N))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(N.themeMode=t),s&&(N.themeVariables=Ue({},s))}},D=A({open:!1,message:"",variant:"success"}),ke={state:D,subscribe(e){return M(D,()=>e(D))},openToast(e,t){D.open=!0,D.message=e,D.variant=t},closeToast(){D.open=!1}};class Re{constructor(t){this.openModal=F.open,this.closeModal=F.close,this.subscribeModal=F.subscribe,this.setTheme=le.setThemeConfig,le.setThemeConfig(t),T.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-b90c7536.js"),["assets/index-b90c7536.js","assets/index-9ab4b2f8.js","assets/index-d326c9c7.css"]);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Re},Symbol.toStringTag,{value:"Module"}));export{h as C,Ne as E,F as M,w as O,ce as R,le as T,ke as a,Ee as b,T as c,Ve as i};
|
|
1
|
+
import{B as fe,_ as pe}from"./index-18b3dfcd.js";const me=Symbol(),Z=Object.getPrototypeOf,J=new WeakMap,he=e=>e&&(J.has(e)?J.get(e):Z(e)===Object.prototype||Z(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,ee=(e,t=!0)=>{J.set(e,t)},q=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ve=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>q(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},c=new WeakMap,l=(o,g,E=n)=>{const v=c.get(o);if((v==null?void 0:v[0])===g)return v[1];const y=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return ee(y,!0),c.set(o,[g,y]),Reflect.ownKeys(o).forEach(U=>{if(Object.getOwnPropertyDescriptor(y,U))return;const O=Reflect.get(o,U),P={value:O,enumerable:!0,configurable:!0};if(x.has(O))ee(O,!1);else if(O instanceof Promise)delete P.value,P.get=()=>E(O);else if(C.has(O)){const[b,z]=C.get(O);P.value=l(b,z(),E)}Object.defineProperty(y,U,P)}),Object.preventExtensions(y)},d=new WeakMap,f=[1,1],L=o=>{if(!q(o))throw new Error("object required");const g=d.get(o);if(g)return g;let E=f[0];const v=new Set,y=(i,a=++f[0])=>{E!==a&&(E=a,v.forEach(r=>r(i,a)))};let U=f[1];const O=(i=++f[1])=>(U!==i&&!v.size&&(U=i,b.forEach(([a])=>{const r=a[1](i);r>E&&(E=r)})),E),P=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],y(h,r)},b=new Map,z=(i,a)=>{if(v.size){const r=a[3](P(i));b.set(i,[a,r])}else b.set(i,[a])},X=i=>{var a;const r=b.get(i);r&&(b.delete(i),(a=r[1])==null||a.call(r))},de=i=>(v.add(i),v.size===1&&b.forEach(([r,h],j)=>{const $=r[3](P(j));b.set(j,[r,$])}),()=>{v.delete(i),v.size===0&&b.forEach(([r,h],j)=>{h&&(h(),b.set(j,[r]))})}),H=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),k=t(H,{deleteProperty(i,a){const r=Reflect.get(i,a);X(a);const h=Reflect.deleteProperty(i,a);return h&&y(["delete",[a],r]),h},set(i,a,r,h){const j=Reflect.has(i,a),$=Reflect.get(i,a,h);if(j&&(e($,r)||d.has(r)&&e($,d.get(r))))return!0;X(a),q(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(W=>{r.status="fulfilled",r.value=W,y(["resolve",[a],W])}).catch(W=>{r.status="rejected",r.reason=W,y(["reject",[a],W])});else{!C.has(r)&&s(r)&&(V=L(r));const W=!x.has(V)&&C.get(V);W&&z(a,W)}return Reflect.set(i,a,V,h),y(["set",[a],r,$]),!0}});d.set(o,k);const ue=[H,O,l,de];return C.set(k,ue),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(k[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(H,i,a)}),k})=>[L,C,x,e,t,s,n,c,l,d,f],[ye]=ve();function A(e={}){return ye(e)}function M(e,t,s){const n=C.get(e);let c;const l=[],d=n[3];let f=!1;const o=d(g=>{if(l.push(g),s){t(l.splice(0));return}c||(c=Promise.resolve().then(()=>{c=void 0,f&&t(l.splice(0))}))});return f=!0,()=>{f=!1,o()}}function be(e,t){const s=C.get(e),[n,c,l]=s;return l(n,c(),t)}const u=A({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ce={state:u,subscribe(e){return M(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}},m={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 m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.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},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const c=encodeURIComponent(t);return`${n}wc?uri=${c}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const l=fe.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",l),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const c=encodeURIComponent(t);return`${n}wc?uri=${c}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.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(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=ce.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=A({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),Ee={state:p,subscribe(e){return M(p.events,()=>e(be(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)}}},I=A({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:I,subscribe(e){return M(I,()=>e(I))},setChains(e){I.chains=e},setWalletConnectUri(e){I.walletConnectUri=e},setIsCustomDesktop(e){I.isCustomDesktop=e},setIsCustomMobile(e){I.isCustomMobile=e},setIsDataLoaded(e){I.isDataLoaded=e},setIsUiLoaded(e){I.isUiLoaded=e},setIsAuth(e){I.isAuth=e}},B=A({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:B,subscribe(e){return M(B,()=>e(B))},setConfig(e){var t,s;Ee.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)),m.setModalVersionInStorage(),Object.assign(B,e)}};var Ie=Object.defineProperty,te=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,se=(e,t,s)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))_e.call(t,s)&&se(e,s,t[s]);if(te)for(var s of te(t))Oe.call(t,s)&&se(e,s,t[s]);return e};const Y="https://explorer-api.walletconnect.com",G="wcm",Q="js-2.7.0";async function K(e,t){const s=Le({sdkType:G,sdkVersion:Q},t),n=new URL(e,Y);return n.searchParams.append("projectId",T.state.projectId),Object.entries(s).forEach(([l,d])=>{d&&n.searchParams.append(l,String(d))}),(await fetch(n)).json()}const S={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`${Y}/w3m/v1/getWalletImage/${e}?projectId=${T.state.projectId}&sdkType=${G}&sdkVersion=${Q}`},getAssetImageUrl(e){return`${Y}/w3m/v1/getAssetImage/${e}?projectId=${T.state.projectId}&sdkType=${G}&sdkVersion=${Q}`}};var We=Object.defineProperty,ne=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,oe=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Pe=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&oe(e,s,t[s]);if(ne)for(var s of ne(t))Ae.call(t,s)&&oe(e,s,t[s]);return e};const re=m.isMobile(),_=A({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:_,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=T.state;if(e==="NONE"||t==="ALL"&&!e)return _.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:c}=await S.getAllListings(n),l=Object.values(c);l.sort((d,f)=>{const L=e.indexOf(d.id),o=e.indexOf(f.id);return L-o}),_.recomendedWallets=l}else{const{chains:s,isAuth:n}=w.state,c=s==null?void 0:s.join(","),l=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:c,version:2,excludedIds:l?t.join(","):void 0},{listings:f}=re?await S.getMobileListings(d):await S.getDesktopListings(d);_.recomendedWallets=Object.values(f)}return _.recomendedWallets},async getWallets(e){const t=Pe({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=T.state,{recomendedWallets:c}=_;if(n==="ALL")return _.wallets;c.length?t.excludedIds=c.map(E=>E.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:l,search:d}=e,{listings:f,total:L}=re?await S.getMobileListings(t):await S.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return _[g]={listings:[..._[g].listings,...o],total:L,page:l??1},{listings:o,total:L}},getWalletImageUrl(e){return S.getWalletImageUrl(e)},getAssetImageUrl(e){return S.getAssetImageUrl(e)},resetSearch(){_.search={listings:[],total:0,page:1}}},R=A({open:!1}),F={state:R,subscribe(e){return M(R,()=>e(R))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=w.state;if(m.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),ce.reset("ConnectWallet"),s&&n)R.open=!0,t();else{const c=setInterval(()=>{const l=w.state;l.isUiLoaded&&l.isDataLoaded&&(clearInterval(c),R.open=!0,t())},200)}})},close(){R.open=!1}};var Se=Object.defineProperty,ae=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,ie=(e,t,s)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&ie(e,s,t[s]);if(ae)for(var s of ae(t))Me.call(t,s)&&ie(e,s,t[s]);return e};function je(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const N=A({themeMode:je()?"dark":"light"}),le={state:N,subscribe(e){return M(N,()=>e(N))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(N.themeMode=t),s&&(N.themeVariables=Ue({},s))}},D=A({open:!1,message:"",variant:"success"}),ke={state:D,subscribe(e){return M(D,()=>e(D))},openToast(e,t){D.open=!0,D.message=e,D.variant=t},closeToast(){D.open=!1}};class Re{constructor(t){this.openModal=F.open,this.closeModal=F.close,this.subscribeModal=F.subscribe,this.setTheme=le.setThemeConfig,le.setThemeConfig(t),T.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-48efc568.js"),["assets/index-48efc568.js","assets/index-18b3dfcd.js","assets/index-34dd439d.css"]);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Re},Symbol.toStringTag,{value:"Module"}));export{m as C,Ne as E,F as M,w as O,ce as R,le as T,ke as a,Ee as b,T as c,Ve as i};
|