@skip-go/widget-web-component 3.5.0 → 3.6.5
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/build/324.index.js +1 -0
- package/build/394.index.js +1 -0
- package/build/557.index.js +1 -0
- package/build/559.index.js +2 -0
- package/build/559.index.js.LICENSE.txt +23 -0
- package/build/586.index.js +1 -0
- package/build/696.index.js +2 -0
- package/build/696.index.js.LICENSE.txt +17 -0
- package/build/838.index.js +2 -0
- package/build/838.index.js.LICENSE.txt +23 -0
- package/build/996.index.js +1 -0
- package/build/index.js +64 -26
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const id=996;export const ids=[996];export const modules={49937:(e,t,s)=>{s.d(t,{t6:()=>O,pb:()=>m,mb:()=>j,Ao:()=>b,vZ:()=>y,pV:()=>B,D8:()=>F,IN:()=>C,jL:()=>w,lH:()=>Y,dC:()=>te,gA:()=>K}),Symbol();const n=Symbol(),a=Object.getPrototypeOf,o=new WeakMap,r=(e,t=!0)=>{o.set(e,t);},i=e=>"object"==typeof e&&null!==e,l=new WeakMap,c=new WeakSet,[d]=((e=Object.is,t=(e,t)=>new Proxy(e,t),s=e=>i(e)&&!c.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer),d=e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e;}},u=new WeakMap,p=(e,t,s=d)=>{const n=u.get(e);if((null==n?void 0:n[0])===t)return n[1];const a=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return r(a,!0),u.set(e,[t,a]),Reflect.ownKeys(e).forEach((t=>{if(Object.getOwnPropertyDescriptor(a,t))return;const n=Reflect.get(e,t),o={value:n,enumerable:!0,configurable:!0};if(c.has(n))r(n,!1);else if(n instanceof Promise)delete o.value,o.get=()=>s(n);else if(l.has(n)){const[e,t]=l.get(n);o.value=p(e,t(),s);}Object.defineProperty(a,t,o);})),a;},f=new WeakMap,h=[1,1],m=r=>{if(!i(r))throw new Error("object required");const d=f.get(r);if(d)return d;let u=h[0];const g=new Set,w=(e,t=++h[0])=>{u!==t&&(u=t,g.forEach((s=>s(e,t))));};let b=h[1];const v=e=>(t,s)=>{const n=[...t];n[1]=[e,...n[1]],w(n,s);},y=new Map,I=e=>{var t;const s=y.get(e);s&&(y.delete(e),null==(t=s[1])||t.call(s));},C=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r)),E=t(C,{deleteProperty(e,t){const s=Reflect.get(e,t);I(t);const n=Reflect.deleteProperty(e,t);return n&&w(["delete",[t],s]),n;},set(t,r,d,u){const p=Reflect.has(t,r),h=Reflect.get(t,r,u);if(p&&(e(h,d)||f.has(d)&&e(h,f.get(d))))return!0;var b;I(r),i(d)&&(d=(e=>e&&(o.has(e)?o.get(e):a(e)===Object.prototype||a(e)===Array.prototype))(b=d)&&b[n]||null||d);let C=d;if(d instanceof Promise)d.then((e=>{d.status="fulfilled",d.value=e,w(["resolve",[r],e]);})).catch((e=>{d.status="rejected",d.reason=e,w(["reject",[r],e]);}));else{!l.has(d)&&s(d)&&(C=m(d));const e=!c.has(C)&&l.get(C);e&&((e,t)=>{if(y.has(e))throw new Error("prop listener already exists");if(g.size){const s=t[3](v(e));y.set(e,[t,s]);}else y.set(e,[t]);})(r,e);}return Reflect.set(t,r,C,u),w(["set",[r],d,h]),!0;}});f.set(r,E);const j=[C,(e=++h[1])=>(b===e||g.size||(b=e,y.forEach((([t])=>{const s=t[1](e);s>u&&(u=s);}))),u),p,e=>(g.add(e),1===g.size&&y.forEach((([e,t],s)=>{if(t)throw new Error("remove already exists");const n=e[3](v(s));y.set(s,[e,n]);})),()=>{g.delete(e),0===g.size&&y.forEach((([e,t],s)=>{t&&(t(),y.set(s,[e]));}));})];return l.set(E,j),Reflect.ownKeys(r).forEach((e=>{const t=Object.getOwnPropertyDescriptor(r,e);"value"in t&&(E[e]=r[e],delete t.value,delete t.writable),Object.defineProperty(C,e,t);})),E;})=>[m,l,c,e,t,s,d,u,p,f,h])();function u(e={}){return d(e);}function p(e,t,s){const n=l.get(e);let a;n||console.warn("Please use proxy object");const o=[],r=n[3];let i=!1;const c=r((e=>{o.push(e),s?t(o.splice(0)):a||(a=Promise.resolve().then((()=>{a=void 0,i&&t(o.splice(0));})));}));return i=!0,()=>{i=!1,c();};}var f=s(1048);let h;const m={ethereumClient:void 0,setEthereumClient(e){h=e;},client(){if(h)return h;throw new Error("ClientCtrl has no client set");}},g=u({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),w={state:g,subscribe:e=>p(g,(()=>e(g))),push(e,t){e!==g.view&&(g.view=e,t&&(g.data=t),g.history.push(e));},reset(e){g.view=e,g.history=[e];},replace(e){g.history.length>1&&(g.history[g.history.length-1]=e,g.view=e);},goBack(){if(g.history.length>1){g.history.pop();const[e]=g.history.slice(-1);g.view=e;}},setData(e){g.data=e;}},b={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",W3M_PREFER_INJECTED_URL_FLAG:"w3mPreferInjected",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>typeof window<"u"&&!(!window.matchMedia("(pointer:coarse)").matches&&!/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>b.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return b.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(b.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;return n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),this.setWalletConnectDeepLink(n,s),`${n}wc?uri=${encodeURIComponent(t)}`;},formatUniversalUrl(e,t,s){if(!b.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;return e.endsWith("/")&&(n=e.slice(0,-1)),this.setWalletConnectDeepLink(n,s),`${n}/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){localStorage.setItem(b.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}));},setWalletConnectAndroidDeepLink(e){const[t]=e.split("?");localStorage.setItem(b.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}));},removeWalletConnectDeepLink(){localStorage.removeItem(b.WALLETCONNECT_DEEPLINK_CHOICE);},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(b.W3M_VERSION,"2.4.2");},getWalletRouterData(){var e;const t=null==(e=w.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t;},getSwitchNetworkRouterData(){var e;const t=null==(e=w.state.data)?void 0:e.SwitchNetwork;if(!t)throw new Error('Missing "SwitchNetwork" view data');return t;},isPreferInjectedFlag:()=>typeof location<"u"&&new URLSearchParams(location.search).has(b.W3M_PREFER_INJECTED_URL_FLAG)},v=u({enabled:typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),userSessionId:"",events:[],connectedWalletId:void 0}),y={state:v,subscribe:e=>p(v.events,(()=>e(function(e){const t=l.get(e);t||console.warn("Please use proxy object");const[s,n,a]=t;return a(s,n(),void 0);}(v.events[v.events.length-1])))),initialize(){v.enabled&&typeof crypto<"u"&&(v.userSessionId=crypto.randomUUID());},setConnectedWalletId(e){v.connectedWalletId=e;},click(e){if(v.enabled){const t={type:"CLICK",name:e.name,userSessionId:v.userSessionId,timestamp:Date.now(),data:e};v.events.push(t);}},track(e){if(v.enabled){const t={type:"TRACK",name:e.name,userSessionId:v.userSessionId,timestamp:Date.now(),data:e};v.events.push(t);}},view(e){if(v.enabled){const t={type:"VIEW",name:e.name,userSessionId:v.userSessionId,timestamp:Date.now(),data:e};v.events.push(t);}}},I=u({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,isStandalone:!1,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,isPreferInjected:!1,walletConnectVersion:1}),C={state:I,subscribe:e=>p(I,(()=>e(I))),setChains(e){I.chains=e;},setStandaloneChains(e){I.standaloneChains=e;},setStandaloneUri(e){I.standaloneUri=e;},getSelectedChain(){const e=m.client().getNetwork().chain;return e&&(I.selectedChain=e),I.selectedChain;},setSelectedChain(e){I.selectedChain=e;},setIsStandalone(e){I.isStandalone=e;},setIsCustomDesktop(e){I.isCustomDesktop=e;},setIsCustomMobile(e){I.isCustomMobile=e;},setIsDataLoaded(e){I.isDataLoaded=e;},setIsUiLoaded(e){I.isUiLoaded=e;},setWalletConnectVersion(e){I.walletConnectVersion=e;},setIsPreferInjected(e){I.isPreferInjected=e;},setIsAuth(e){I.isAuth=e;}},E=u({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,tokenContracts:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableAuthMode:!1,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),j={state:E,subscribe:e=>p(E,(()=>e(E))),setConfig(e){var t,s,n,a;y.initialize(),C.setStandaloneChains(e.standaloneChains),C.setIsStandalone(!(null==(t=e.standaloneChains)||!t.length)||!!e.enableStandaloneMode),C.setIsAuth(!!e.enableAuthMode),C.setIsCustomMobile(!(null==(s=e.mobileWallets)||!s.length)),C.setIsCustomDesktop(!(null==(n=e.desktopWallets)||!n.length)),C.setWalletConnectVersion(null!=(a=e.walletConnectVersion)?a:1),C.state.isStandalone||(C.setChains(m.client().chains),C.setIsPreferInjected(m.client().isInjectedProviderInstalled()&&b.isPreferInjectedFlag())),e.defaultChain&&C.setSelectedChain(e.defaultChain),b.setWeb3ModalVersionInStorage(),Object.assign(E,e);}},W=u({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),O={state:W,subscribe:e=>p(W,(()=>e(W))),getAccount(){const e=m.client().getAccount();W.address=e.address,W.isConnected=e.isConnected;},async fetchProfile(e,t){var s;try{W.profileLoading=!0;const n=t??W.address,a=null==(s=C.state.chains)?void 0:s.find((e=>1===e.id));if(n&&a){const t=await m.client().fetchEnsName({address:n,chainId:1});if(t){const s=await m.client().fetchEnsAvatar({name:t,chainId:1});s&&await e(s),W.profileAvatar=s;}W.profileName=t;}}finally{W.profileLoading=!1;}},async fetchBalance(e){try{const{chain:t}=m.client().getNetwork(),{tokenContracts:s}=j.state;let n;t&&s&&(n=s[t.id]),W.balanceLoading=!0;const a=e??W.address;if(a){const e=await m.client().fetchBalance({address:a,token:n});W.balance={amount:e.formatted,symbol:e.symbol};}}finally{W.balanceLoading=!1;}},setAddress(e){W.address=e;},setIsConnected(e){W.isConnected=e;},resetBalance(){W.balance=void 0;},resetAccount(){W.address=void 0,W.isConnected=!1,W.profileName=void 0,W.profileAvatar=void 0,W.balance=void 0;}},A="https://explorer-api.walletconnect.com";async function L(e,t){const s=new URL(e,A);return s.searchParams.append("projectId",j.state.projectId),Object.entries(t).forEach((([e,t])=>{t&&s.searchParams.append(e,String(t));})),(await fetch(s)).json();}const S=async e=>L("/w3m/v1/getDesktopListings",e),P=async e=>L("/w3m/v1/getMobileListings",e),M=async e=>L("/w3m/v1/getInjectedListings",e),N=async e=>L("/w3m/v1/getAllListings",e),D=e=>`${A}/w3m/v1/getWalletImage/${e}?projectId=${j.state.projectId}`,U=e=>`${A}/w3m/v1/getAssetImage/${e}?projectId=${j.state.projectId}`;var k=Object.defineProperty,R=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,T=(e,t,s)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const V=b.isMobile(),H=u({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),B={state:H,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=j.state;if("NONE"===e||"ALL"===t&&!e)return H.recomendedWallets;if(b.isArray(e)){const t={recommendedIds:e.join(",")},{listings:s}=await N(t),n=Object.values(s);n.sort(((t,s)=>e.indexOf(t.id)-e.indexOf(s.id))),H.recomendedWallets=n;}else{const{standaloneChains:e,walletConnectVersion:s,isAuth:n}=C.state,a=e?.join(","),o=b.isArray(t),r={page:1,sdks:n?"auth_v1":void 0,entries:b.RECOMMENDED_WALLET_AMOUNT,chains:a,version:s,excludedIds:o?t.join(","):void 0},{listings:i}=V?await P(r):await S(r);H.recomendedWallets=Object.values(i);}return H.recomendedWallets;},async getWallets(e){const t=((e,t)=>{for(var s in t||(t={}))x.call(t,s)&&T(e,s,t[s]);if(R)for(var s of R(t))_.call(t,s)&&T(e,s,t[s]);return e;})({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=j.state,{recomendedWallets:a}=H;if("ALL"===n)return H.wallets;t.search||(a.length?t.excludedIds=a.map((e=>e.id)).join(","):b.isArray(s)&&(t.excludedIds=s.join(","))),b.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),C.state.isAuth&&(t.sdks="auth_v1");const{page:o,search:r}=e,{listings:i,total:l}=V?await P(t):await S(t),c=Object.values(i),d=r?"search":"wallets";return H[d]={listings:[...H[d].listings,...c],total:l,page:o??1},{listings:c,total:l};},async getInjectedWallets(){const{listings:e}=await M({}),t=Object.values(e);return H.injectedWallets=t,H.injectedWallets;},getWalletImageUrl:e=>D(e),getAssetImageUrl:e=>U(e),resetSearch(){H.search={listings:[],total:0,page:1};}},$=u({pairingUri:"",pairingError:!1}),K={state:$,subscribe:e=>p($,(()=>e($))),setPairingUri(e){$.pairingUri=e;},setPairingError(e){$.pairingError=e;}},z=u({open:!1}),F={state:z,subscribe:e=>p(z,(()=>e(z))),open:async e=>new Promise((t=>{const{isStandalone:s,isUiLoaded:n,isDataLoaded:a,isPreferInjected:o,selectedChain:r}=C.state,{isConnected:i}=O.state,{enableNetworkView:l}=j.state;if(s)C.setStandaloneUri(e?.uri),C.setStandaloneChains(e?.standaloneChains),w.reset("ConnectWallet");else if(null!=e&&e.route)w.reset(e.route);else if(i)w.reset("Account");else if(l)w.reset("SelectNetwork");else{if(o)return m.client().connectConnector("injected",r?.id).catch((e=>console.error(e))),void t();w.reset("ConnectWallet");}const{pairingUri:c}=K.state;if(n&&a&&(s||c||i))z.open=!0,t();else{const e=setInterval((()=>{const s=C.state,n=K.state;s.isUiLoaded&&s.isDataLoaded&&(s.isStandalone||n.pairingUri||i)&&(clearInterval(e),z.open=!0,t());}),200);}})),close(){z.open=!1;}};var J=Object.defineProperty,G=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,Q=(e,t,s)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const X=u({themeMode:typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),Y={state:X,subscribe:e=>p(X,(()=>e(X))),setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(X.themeMode=t),s&&(X.themeVariables=((e,t)=>{for(var s in t||(t={}))q.call(t,s)&&Q(e,s,t[s]);if(G)for(var s of G(t))Z.call(t,s)&&Q(e,s,t[s]);return e;})({},s));}},ee=u({open:!1,message:"",variant:"success"}),te={state:ee,subscribe:e=>p(ee,(()=>e(ee))),openToast(e,t){ee.open=!0,ee.message=e,ee.variant=t;},closeToast(){ee.open=!1;}};typeof window<"u"&&(window.Buffer||(window.Buffer=f.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));},28996:(e,t,s)=>{s.r(t),s.d(t,{Web3Modal:()=>c});var n=s(49937),a=Object.defineProperty,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,l=(e,t,s)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;class c{constructor(e){this.openModal=n.D8.open,this.closeModal=n.D8.close,this.subscribeModal=n.D8.subscribe,this.setTheme=n.lH.setThemeConfig,n.lH.setThemeConfig(e),n.mb.setConfig(((e,t)=>{for(var s in t||(t={}))r.call(t,s)&&l(e,s,t[s]);if(o)for(var s of o(t))i.call(t,s)&&l(e,s,t[s]);return e;})({enableStandaloneMode:!0},e)),this.initUi();}async initUi(){if(typeof window<"u"){await s.e(838).then(s.bind(s,68838));const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),n.IN.setIsUiLoaded(!0);}}}}};
|