import{i as g,n as c,t as f,s as m,b,x as l,o as M,l as it,a as rt,e as h,c as Fe}from"./if-defined-Dhd0Yj5H.js";import{u as z,F as nt,p as D,q as k,f as L,b as I,W as x,d as O,i as u,P as A,g as W,C as T}from"./index-Vmx-EkLq.js";import"./index-CXyQ5sGC.js";import"./lodash-CQGrF3PQ.js";var qe=Object.defineProperty,ke=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,$e=(t,e,o)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Tt=(t,e)=>{for(var o in e||(e={}))Ke.call(e,o)&&$e(t,o,e[o]);if(ke)for(var o of ke(e))Ye.call(e,o)&&$e(t,o,e[o]);return t};function Qe(){var t;const e=(t=z.state.themeMode)!=null?t:"dark",o={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--w3m-color-fg-1":o.foreground[1],"--w3m-color-fg-2":o.foreground[2],"--w3m-color-fg-3":o.foreground[3],"--w3m-color-bg-1":o.background[1],"--w3m-color-bg-2":o.background[2],"--w3m-color-bg-3":o.background[3],"--w3m-color-overlay":o.overlay}}function Ie(){return{"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-wallet-icon-large-border-radius":"30px","--w3m-wallet-icon-small-border-radius":"7px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)","--w3m-overlay-background-color":"rgba(0, 0, 0, 0.3)","--w3m-overlay-backdrop-filter":"none"}}function Xe(){const{themeVariables:t}=z.state;return{"--w3m-background-image-url":t!=null&&t["--w3m-background-image-url"]?`url(${t["--w3m-background-image-url"]})`:"none"}}const p={getPreset(t){return Ie()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=z.state;if(t){const o=Tt(Tt(Tt(Tt({},Qe()),Ie()),e),Xe());Object.entries(o).forEach(([r,a])=>t.style.setProperty(r,a))}},globalCss:g`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-accent-fill-color);background:var(--w3m-accent-color)}`},Je=g`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}button:disabled{opacity:.7}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-accent-color);border-radius:var(--w3m-icon-button-border-radius);margin-bottom:4px}button path{fill:var(--w3m-accent-fill-color)}`;var ta=Object.defineProperty,ea=Object.getOwnPropertyDescriptor,bt=(t,e,o,r)=>{for(var a=r>1?void 0:r?ea(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&ta(e,o,a),a};let Y=class extends m{constructor(){super(...arguments),this.icon=void 0,this.label="",this.loading=!1,this.onClick=()=>null}render(){return l`${this.loading?l` `:l`${this.icon}`}
${this.label} `}};Y.styles=[p.globalCss,Je],bt([c()],Y.prototype,"icon",2),bt([c()],Y.prototype,"label",2),bt([c()],Y.prototype,"loading",2),bt([c()],Y.prototype,"onClick",2),Y=bt([h("w3m-box-button")],Y);const aa=g`button{border-radius:var(--w3m-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--w3m-accent-color)}button path{fill:var(--w3m-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:active::after{background-color:var(--w3m-color-overlay)}.w3m-ghost,.w3m-ghost:active::after,.w3m-outline{background-color:transparent}.w3m-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}.w3m-ghost:hover::after{background-color:transparent}.w3m-ghost:hover{opacity:.5}}button:disabled{background-color:var(--w3m-color-bg-3);pointer-events:none}.w3m-ghost::after{border-color:transparent}.w3m-ghost path{fill:var(--w3m-color-fg-2)}.w3m-outline path{fill:var(--w3m-accent-color)}.w3m-outline:disabled{background-color:transparent;opacity:.5}`;var oa=Object.defineProperty,ra=Object.getOwnPropertyDescriptor,st=(t,e,o,r)=>{for(var a=r>1?void 0:r?ra(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&oa(e,o,a),a};let G=class extends m{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0,"w3m-ghost":this.variant==="ghost","w3m-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),l`${this.iconLeft} ${this.iconRight} `}};G.styles=[p.globalCss,aa],st([c()],G.prototype,"disabled",2),st([c()],G.prototype,"iconLeft",2),st([c()],G.prototype,"iconRight",2),st([c()],G.prototype,"onClick",2),st([c()],G.prototype,"variant",2),G=st([h("w3m-button")],G);const ia=g`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--w3m-button-border-radius);color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:active::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-accent-color);background-color:transparent}.w3m-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}}`;var na=Object.defineProperty,la=Object.getOwnPropertyDescriptor,Yt=(t,e,o,r)=>{for(var a=r>1?void 0:r?la(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&na(e,o,a),a};let ft=class extends m{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return l` `}};ft.styles=[p.globalCss,ia],Yt([c()],ft.prototype,"disabled",2),Yt([c()],ft.prototype,"variant",2),ft=Yt([h("w3m-button-big")],ft);const sa=g`:host{background-color:var(--w3m-color-bg-2);border-top:1px solid var(--w3m-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var ca=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let Qt=class extends m{render(){return l`
`}};Qt.styles=[p.globalCss,sa],Qt=ca([h("w3m-info-footer")],Qt);const w={CROSS_ICON:b` `,WALLET_CONNECT_LOGO:b` `,WALLET_CONNECT_ICON:b` `,WALLET_CONNECT_ICON_COLORED:b` `,BACK_ICON:b` `,COPY_ICON:b` `,RETRY_ICON:b` `,DESKTOP_ICON:b` `,MOBILE_ICON:b` `,ARROW_DOWN_ICON:b` `,ARROW_UP_RIGHT_ICON:b` `,ARROW_RIGHT_ICON:b` `,QRCODE_ICON:b` `,SCAN_ICON:b` `,CHECKMARK_ICON:b` `,HELP_ETH_IMG:b` `,HELP_PAINTING_IMG:b` `,HELP_CHART_IMG:b` `,HELP_KEY_IMG:b` `,HELP_USER_IMG:b` `,HELP_LOCK_IMG:b` `,HELP_COMPAS_IMG:b` `,HELP_NOUN_IMG:b` `,HELP_DAO_IMG:b` `,SEARCH_ICON:b` `,HELP_ICON:b` `,WALLET_ICON:b` `,NETWORK_PLACEHOLDER:b` `,WALLET_PLACEHOLDER:b` `,TOKEN_PLACEHOLDER:b` `,ACCOUNT_COPY:b` `,ACCOUNT_DISCONNECT:b` `,GLOBE_ICON:b` `},da=g`.w3m-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--w3m-background-border-radius) * .9);background-color:var(--w3m-background-color);background-image:var(--w3m-background-image-url);background-position:center;background-size:cover}.w3m-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--w3m-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--w3m-color-fg-1)}.w3m-toolbar div{display:flex}.w3m-toolbar div button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}@media(hover:hover){button:hover{background-color:var(--w3m-color-bg-2)}}`;var ma=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,Oe=(t,e,o,r)=>{for(var a=r>1?void 0:r?ha(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&ma(e,o,a),a};let Pt=class extends m{constructor(){super(),this.isHelp=!1,this.unsubscribeRouter=void 0,this.unsubscribeRouter=x.subscribe(t=>{this.isHelp=t.view==="Help"})}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this)}onHelp(){x.push("Help")}logoTemplate(){var t;const e=(t=z.state.themeVariables)==null?void 0:t["--w3m-logo-image-url"];return e?l` `:w.WALLET_CONNECT_LOGO}render(){const t={"w3m-help-active":this.isHelp};return l`
`}};Pt.styles=[p.globalCss,da],Oe([f()],Pt.prototype,"isHelp",2),Pt=Oe([h("w3m-modal-backcard")],Pt);const wa=g`main{padding:20px;padding-top:0;width:100%}`;var pa=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let Xt=class extends m{render(){return l` `}};Xt.styles=[p.globalCss,wa],Xt=pa([h("w3m-modal-content")],Xt);const ga=g`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var ua=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let Jt=class extends m{render(){return l``}};Jt.styles=[p.globalCss,ga],Jt=ua([h("w3m-modal-footer")],Jt);const va=g`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-accent-color)}`;var ba=Object.defineProperty,fa=Object.getOwnPropertyDescriptor,xt=(t,e,o,r)=>{for(var a=r>1?void 0:r?fa(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&ba(e,o,a),a};let Q=class extends m{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return l`${w.BACK_ICON} `}actionBtnTemplate(){return l`${this.actionIcon} `}render(){const t={"w3m-border":this.border},e=x.state.history.length>1,o=this.title?l`${this.title} `:l` `;return l`${e?this.backBtnTemplate():null} ${o} ${this.onAction?this.actionBtnTemplate():null} `}};Q.styles=[p.globalCss,va],xt([c()],Q.prototype,"title",2),xt([c()],Q.prototype,"onAction",2),xt([c()],Q.prototype,"actionIcon",2),xt([c()],Q.prototype,"border",2),Q=xt([h("w3m-modal-header")],Q);const xa={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00"},ya={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}},R={externalWallets(){let t=L.client().getConnectors();return t=t.filter(e=>e.id!=="injected"),t},manualWallets(){var t,e;const{mobileWallets:o,desktopWallets:r}=T.state,a=(t=R.recentWallet())==null?void 0:t.id,i=u.isMobile()?o:r,n=i==null?void 0:i.filter(d=>a!==d.id);return(e=u.isMobile()?n==null?void 0:n.map(({id:d,name:v,links:y})=>({id:d,name:v,mobile:y,links:y})):n==null?void 0:n.map(({id:d,name:v,links:y})=>({id:d,name:v,desktop:y,links:y})))!=null?e:[]},installedInjectedWallets(){if(!L.client().isInjectedProviderInstalled())return[];const{namespace:t}=L.client(),{injectedWallets:e}=O.state;let o=e.filter(({injected:r})=>!!r.some(a=>L.client().safeCheckInjectedProvider(a.injected_id)&&a.namespace===t));return o.length>1&&(o=o.filter(({injected:r})=>!!r.map(({injected_id:i})=>i).every(i=>i!=="isMetaMask"))),o.length?o:[{name:"Browser",id:"browser",image_id:void 0}]},injectedWallets(){const{explorerExcludedWalletIds:t,explorerRecommendedWalletIds:e}=T.state,o=u.isMobile();if(t==="ALL"||o)return[];const{namespace:r}=L.client(),{injectedWallets:a}=O.state;return a.filter(({id:i,injected:n})=>{const d=u.isArray(t)?t:[],v=u.isArray(e)?e:[];return!!n.some(y=>y.namespace===r&&!d.includes(i)&&!v.includes(i))})},recentWallet(){return s.getRecentWallet()},recomendedWallets(t=!1){var e;const o=R.installedInjectedWallets().map(({id:n})=>n),r=t||(e=R.recentWallet())==null?void 0:e.id,a=[...o,r],{recomendedWallets:i}=O.state;return i.filter(n=>!a.includes(n.id))}},s={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET_INFO:"W3M_RECENT_WALLET_INFO",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",WAGMI_WALLET:"wagmi.wallet",getShadowRootElement(t,e){const o=t.renderRoot.querySelector(e);if(!o)throw new Error(`${e} not found`);return o},getWalletIcon({id:t,image_id:e}){const{walletImages:o}=T.state;return o!=null&&o[t]?o[t]:e?O.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e&&t.length>8?`${t.substring(0,8)}..`:t},getChainIcon(t){var e;const o=xa[t],{projectId:r,chainImages:a}=T.state;return(e=a==null?void 0:a[t])!=null?e:r&&o?O.getAssetImageUrl(o):""},getTokenIcon(t){var e,o;const r=(e=ya[t])==null?void 0:e.icon,{projectId:a,tokenImages:i}=T.state;return(o=i==null?void 0:i[t])!=null?o:a&&r?O.getAssetImageUrl(r):""},isMobileAnimation(){return window.innerWidth<=s.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((o,r)=>{const a=new Image;a.onload=o,a.onerror=r,a.crossOrigin="anonymous",a.src=t});return Promise.race([e,u.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let o;return(...r)=>{function a(){t(...r)}o&&clearTimeout(o),o=setTimeout(a,e)}},handleMobileLinking(t){const{pairingUri:e}=A.state,{mobile:o,name:r}=t,a=o==null?void 0:o.native,i=o==null?void 0:o.universal;s.setRecentWallet(t);function n(d){let v="";a?v=u.formatUniversalUrl(a,d,r):i&&(v=u.formatNativeUrl(i,d,r)),u.openHref(v,"_self")}n(e)},handleAndroidLinking(){const{pairingUri:t}=A.state;u.setWalletConnectAndroidDeepLink(t),u.openHref(t,"_self")},async handleUriCopy(){try{const{pairingUri:t}=A.state;await navigator.clipboard.writeText(t),W.openToast("Link copied","success")}catch{W.openToast("Failed to copy","error")}},async handleConnectorConnection(t,e){try{const{selectedChain:o}=I.state;await L.client().connectConnector(t,o==null?void 0:o.id),D.close()}catch(o){console.error(o),e?e():W.openToast(s.getErrorMessage(o),"error")}},getCustomImageUrls(){const{chainImages:t,walletImages:e}=T.state,o=Object.values(t??{}),r=Object.values(e??{});return Object.values([...o,...r])},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;const o=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),r=[];o==null||o.forEach(i=>{let n=0;for(let v=0;v>v*8&255;d[v]=y}r.push(`rgb(${d[0]}, ${d[1]}, ${d[2]})`)});const a=document.querySelector(":root");if(a){const i={"--w3m-color-av-1":r[0],"--w3m-color-av-2":r[1],"--w3m-color-av-3":r[2],"--w3m-color-av-4":r[3],"--w3m-color-av-5":r[4]};Object.entries(i).forEach(([n,d])=>a.style.setProperty(n,d))}},setRecentWallet(t){try{localStorage.setItem(s.W3M_RECENT_WALLET_INFO,JSON.stringify(t))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const t=localStorage.getItem(s.W3M_RECENT_WALLET_INFO);return t?JSON.parse(t):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){u.openHref(s.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{id:t,desktop:e,mobile:o,injected:r}=u.getWalletRouterData(),a=R.installedInjectedWallets(),i=!!(r!=null&&r.length),n=a.some(H=>H.id===t),d=!!(e!=null&&e.native),v=!!(e!=null&&e.universal),y=!!(o!=null&&o.native)||!!(o!=null&&o.universal);return{isInjectedInstalled:n,isInjected:i,isDesktop:d,isMobile:y,isWeb:v}},goToConnectingView(t){x.setData({Wallet:t});const e=u.isMobile(),{isDesktop:o,isWeb:r,isMobile:a,isInjectedInstalled:i}=s.getCachedRouterWalletPlatforms();e?i?x.push("InjectedConnecting"):a?x.push("MobileConnecting"):r?x.push("WebConnecting"):x.push("InstallWallet"):i?x.push("InjectedConnecting"):o?x.push("DesktopConnecting"):r?x.push("WebConnecting"):a?x.push("MobileQrcodeConnecting"):x.push("InstallWallet")},getWagmiWalletType(){return localStorage.getItem(s.WAGMI_WALLET)}},Ca=g`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var ka=Object.defineProperty,$a=Object.getOwnPropertyDescriptor,te=(t,e,o,r)=>{for(var a=r>1?void 0:r?$a(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&ka(e,o,a),a};let yt=class extends m{constructor(){super(),this.view=x.state.view,this.prevView=x.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=x.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&rt(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return s.getShadowRootElement(this,".w3m-router")}get contentEl(){return s.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return l` `;case"SelectNetwork":return l` `;case"InjectedConnecting":return l` `;case"DesktopConnecting":return l` `;case"MobileConnecting":return l` `;case"WebConnecting":return l` `;case"MobileQrcodeConnecting":return l` `;case"GetWallet":return l` `;case"WalletExplorer":return l` `;case"Qrcode":return l` `;case"Help":return l` `;case"Account":return l` `;case"SwitchNetwork":return l` `;case"InstallWallet":return l` `;default:return l`Not Found
`}}async onChangeRoute(){await rt(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=x.state.view,rt(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return l``}};yt.styles=[p.globalCss,Ca],te([f()],yt.prototype,"view",2),te([f()],yt.prototype,"prevView",2),yt=te([h("w3m-modal-router")],yt);const Ia=g`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--w3m-notification-border-radius);border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-accent-color)}.w3m-error path{fill:var(--w3m-error-color)}`;var Oa=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,Ee=(t,e,o,r)=>{for(var a=r>1?void 0:r?Ea(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Oa(e,o,a),a};let _t=class extends m{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=W.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>W.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),W.closeToast()}render(){const{message:t,variant:e}=W.state,o={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?l`${e==="success"?w.CHECKMARK_ICON:null} ${e==="error"?w.CROSS_ICON:null}${t}
`:null}};_t.styles=[p.globalCss,Ia],Ee([f()],_t.prototype,"open",2),_t=Ee([h("w3m-modal-toast")],_t);const Aa=g`button{padding:5px;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px;position:relative}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:active{background-color:var(--w3m-color-overlay)}.w3m-unsupported{opacity:.3}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}`;var Wa=Object.defineProperty,Ma=Object.getOwnPropertyDescriptor,Ct=(t,e,o,r)=>{for(var a=r>1?void 0:r?Ma(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Wa(e,o,a),a};let X=class extends m{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId="",this.unsupported=!1}render(){const t={"w3m-unsupported":this.unsupported};return l`${this.name} `}};X.styles=[p.globalCss,Aa],Ct([c()],X.prototype,"onClick",2),Ct([c()],X.prototype,"name",2),Ct([c()],X.prototype,"chainId",2),Ct([c()],X.prototype,"unsupported",2),X=Ct([h("w3m-network-button")],X);const La=g`@keyframes loading{to{stroke-dashoffset:0}}:host{width:inherit;height:inherit;position:relative}path{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}image{clip-path:path('M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z')}`;var ja=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,Ae=(t,e,o,r)=>{for(var a=r>1?void 0:r?Ta(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&ja(e,o,a),a};let Nt=class extends m{constructor(){super(...arguments),this.chainId=""}render(){const t=s.getChainIcon(this.chainId);return t?l` `:l`${w.NETWORK_PLACEHOLDER}`}};Nt.styles=[p.globalCss,La],Ae([c()],Nt.prototype,"chainId",2),Nt=Ae([h("w3m-network-image")],Nt);const Pa=.1,We=2.5,U=7;function ee(t,e,o){return t===e?!1:(t-e<0?e-t:t-e)<=o+Pa}function _a(t,e){const o=Array.prototype.slice.call(Fe.create(t,{errorCorrectionLevel:e}).modules.data,0),r=Math.sqrt(o.length);return o.reduce((a,i,n)=>(n%r===0?a.push([i]):a[a.length-1].push(i))&&a,[])}const Na={generate(t,e,o){const r="#141414",a="#ffffff",i=[],n=_a(t,"Q"),d=e/n.length,v=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];v.forEach(({x:E,y:C})=>{const P=(n.length-U)*d*E,$=(n.length-U)*d*C,N=.45;for(let B=0;B`)}});const y=Math.floor((o+25)/d),H=n.length/2-y/2,Z=n.length/2+y/2-1,_=[];n.forEach((E,C)=>{E.forEach((P,$)=>{if(n[C][$]&&!(Cn.length-(U+1)&&$n.length-(U+1))&&!(C>H&&CH&&${vt[E]?vt[E].push(C):vt[E]=[C]}),Object.entries(vt).map(([E,C])=>{const P=C.filter($=>C.every(N=>!ee($,N,d)));return[Number(E),P]}).forEach(([E,C])=>{C.forEach(P=>{i.push(b``)})}),Object.entries(vt).filter(([E,C])=>C.length>1).map(([E,C])=>{const P=C.filter($=>C.some(N=>ee($,N,d)));return[Number(E),P]}).map(([E,C])=>{C.sort(($,N)=>$B.some(lt=>ee($,lt,d)));N?N.push($):P.push([$])}return[E,P.map($=>[$[0],$[$.length-1]])]}).forEach(([E,C])=>{C.forEach(([P,$])=>{i.push(b``)})}),i}},Ra=g`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.w3m-dark{background-color:#fff;border-radius:var(--w3m-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:var(--w3m-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-accent-color)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var Da=Object.defineProperty,Za=Object.getOwnPropertyDescriptor,ct=(t,e,o,r)=>{for(var a=r>1?void 0:r?Za(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Da(e,o,a),a};let F=class extends m{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const t=z.state.themeMode==="light"?this.size:this.size-36;return b`${Na.generate(this.uri,t,t/4)} `}render(){const t={"w3m-dark":z.state.themeMode==="dark"};return l`${this.walletId||this.imageUrl?l` `:w.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};F.styles=[p.globalCss,Ra],ct([c()],F.prototype,"uri",2),ct([c({type:Number})],F.prototype,"size",2),ct([c()],F.prototype,"imageId",2),ct([c()],F.prototype,"walletId",2),ct([c()],F.prototype,"imageUrl",2),F=ct([h("w3m-qrcode")],F);const Ha=g`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--w3m-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--w3m-color-fg-1);background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);caret-color:var(--w3m-accent-color)}input::placeholder{color:var(--w3m-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var Ba=Object.defineProperty,Sa=Object.getOwnPropertyDescriptor,Me=(t,e,o,r)=>{for(var a=r>1?void 0:r?Sa(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Ba(e,o,a),a};let Rt=class extends m{constructor(){super(...arguments),this.onChange=()=>null}render(){return l` ${w.SEARCH_ICON}`}};Rt.styles=[p.globalCss,Ha],Me([c()],Rt.prototype,"onChange",2),Rt=Me([h("w3m-search-input")],Rt);const Ua=g`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}:host{width:100%;height:100%;display:flex;justify-content:center;align-items:center}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite}.accent{stroke:var(--w3m-accent-color)}.fill{stroke:var(--w3m-accent-fill-color)}`;var Va=Object.defineProperty,za=Object.getOwnPropertyDescriptor,ae=(t,e,o,r)=>{for(var a=r>1?void 0:r?za(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Va(e,o,a),a};let kt=class extends m{constructor(){super(...arguments),this.color="accent",this.size=24}render(){return l` `}};kt.styles=[p.globalCss,Ua],ae([c()],kt.prototype,"color",2),ae([c({type:Number})],kt.prototype,"size",2),kt=ae([h("w3m-spinner")],kt);const Ga=g`span{font-style:normal;font-family:var(--w3m-font-family);font-feature-settings:var(--w3m-font-feature-settings)}.w3m-xsmall-bold{font-family:var(--w3m-text-xsmall-bold-font-family);font-weight:var(--w3m-text-xsmall-bold-weight);font-size:var(--w3m-text-xsmall-bold-size);line-height:var(--w3m-text-xsmall-bold-line-height);letter-spacing:var(--w3m-text-xsmall-bold-letter-spacing);text-transform:var(--w3m-text-xsmall-bold-text-transform)}.w3m-xsmall-regular{font-family:var(--w3m-text-xsmall-regular-font-family);font-weight:var(--w3m-text-xsmall-regular-weight);font-size:var(--w3m-text-xsmall-regular-size);line-height:var(--w3m-text-xsmall-regular-line-height);letter-spacing:var(--w3m-text-xsmall-regular-letter-spacing);text-transform:var(--w3m-text-xsmall-regular-text-transform)}.w3m-small-thin{font-family:var(--w3m-text-small-thin-font-family);font-weight:var(--w3m-text-small-thin-weight);font-size:var(--w3m-text-small-thin-size);line-height:var(--w3m-text-small-thin-line-height);letter-spacing:var(--w3m-text-small-thin-letter-spacing);text-transform:var(--w3m-text-small-thin-text-transform)}.w3m-small-regular{font-family:var(--w3m-text-small-regular-font-family);font-weight:var(--w3m-text-small-regular-weight);font-size:var(--w3m-text-small-regular-size);line-height:var(--w3m-text-small-regular-line-height);letter-spacing:var(--w3m-text-small-regular-letter-spacing);text-transform:var(--w3m-text-small-regular-text-transform)}.w3m-medium-regular{font-family:var(--w3m-text-medium-regular-font-family);font-weight:var(--w3m-text-medium-regular-weight);font-size:var(--w3m-text-medium-regular-size);line-height:var(--w3m-text-medium-regular-line-height);letter-spacing:var(--w3m-text-medium-regular-letter-spacing);text-transform:var(--w3m-text-medium-regular-text-transform)}.w3m-big-bold{font-family:var(--w3m-text-big-bold-font-family);font-weight:var(--w3m-text-big-bold-weight);font-size:var(--w3m-text-big-bold-size);line-height:var(--w3m-text-big-bold-line-height);letter-spacing:var(--w3m-text-big-bold-letter-spacing);text-transform:var(--w3m-text-big-bold-text-transform)}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-accent-fill-color)}.w3m-color-accnt{color:var(--w3m-accent-color)}.w3m-color-error{color:var(--w3m-error-color)}`;var Fa=Object.defineProperty,qa=Object.getOwnPropertyDescriptor,oe=(t,e,o,r)=>{for(var a=r>1?void 0:r?qa(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Fa(e,o,a),a};let $t=class extends m{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"w3m-big-bold":this.variant==="big-bold","w3m-medium-regular":this.variant==="medium-regular","w3m-small-regular":this.variant==="small-regular","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-regular":this.variant==="xsmall-regular","w3m-xsmall-bold":this.variant==="xsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return l` `}};$t.styles=[p.globalCss,Ga],oe([c()],$t.prototype,"variant",2),oe([c()],$t.prototype,"color",2),$t=oe([h("w3m-text")],$t);const Ka=g`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var Ya=Object.defineProperty,Qa=Object.getOwnPropertyDescriptor,Le=(t,e,o,r)=>{for(var a=r>1?void 0:r?Qa(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Ya(e,o,a),a};let Dt=class extends m{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=s.getTokenIcon((t=this.symbol)!=null?t:"");return e?l``:w.TOKEN_PLACEHOLDER}};Dt.styles=[p.globalCss,Ka],Le([c()],Dt.prototype,"symbol",2),Dt=Le([h("w3m-token-image")],Dt);const Xa=g`button{width:100%;height:100%;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--w3m-wallet-icon-border-radius);margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var Ja=Object.defineProperty,to=Object.getOwnPropertyDescriptor,q=(t,e,o,r)=>{for(var a=r>1?void 0:r?to(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Ja(e,o,a),a};let S=class extends m{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?l`RECENT `:this.installed?l`INSTALLED `:null}handleClick(){nt.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return l`${(t=this.label)!=null?t:s.getWalletName(this.name,!0)} ${this.sublabelTemplate()}
`}};S.styles=[p.globalCss,Xa],q([c()],S.prototype,"onClick",2),q([c()],S.prototype,"name",2),q([c()],S.prototype,"walletId",2),q([c()],S.prototype,"label",2),q([c()],S.prototype,"imageId",2),q([c()],S.prototype,"installed",2),q([c()],S.prototype,"recent",2),S=q([h("w3m-wallet-button")],S);const eo=g`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--w3m-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var ao=Object.defineProperty,oo=Object.getOwnPropertyDescriptor,Zt=(t,e,o,r)=>{for(var a=r>1?void 0:r?oo(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&ao(e,o,a),a};let dt=class extends m{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:s.getWalletIcon({id:this.walletId,image_id:this.imageId});return l`${e.length?l``:w.WALLET_PLACEHOLDER}`}};dt.styles=[p.globalCss,eo],Zt([c()],dt.prototype,"walletId",2),Zt([c()],dt.prototype,"imageId",2),Zt([c()],dt.prototype,"imageUrl",2),dt=Zt([h("w3m-wallet-image")],dt);var ro=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let je=class extends m{constructor(){super(),this.unwatchAccount=void 0,k.getAccount(),this.fetchProfile(),this.fetchBalance(),this.unwatchAccount=L.client().watchAccount(t=>{const{address:e,isConnected:o}=k.state;t.isConnected&&t.address!==e&&(this.fetchProfile(t.address),this.fetchBalance(t.address),k.setAddress(t.address)),t.isConnected||k.resetAccount(),o!==t.isConnected&&D.close(),!o&&t.isConnected?nt.track({name:"ACCOUNT_CONNECTED"}):o&&!t.isConnected&&nt.track({name:"ACCOUNT_DISCONNECTED"}),k.setIsConnected(t.isConnected)})}disconnectedCallback(){var t;(t=this.unwatchAccount)==null||t.call(this)}async fetchProfile(t){var e;const o=(e=I.state.chains)==null?void 0:e.find(r=>r.id===1);if(T.state.enableAccountView&&o)try{await k.fetchProfile(s.preloadImage,t)}catch(r){console.error(r),W.openToast(s.getErrorMessage(r),"error")}}async fetchBalance(t){if(T.state.enableAccountView)try{await k.fetchBalance(t)}catch(e){console.error(e),W.openToast(s.getErrorMessage(e),"error")}}};je=ro([h("w3m-account-context")],je);var io=Object.defineProperty,no=Object.getOwnPropertyDescriptor,Te=(t,e,o,r)=>{for(var a=r>1?void 0:r?no(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&io(e,o,a),a};let re=class extends m{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>s.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){var t;if(T.state.enableExplorer){const{chains:e}=I.state;await Promise.all([O.getRecomendedWallets(),O.getInjectedWallets()]),I.setIsDataLoaded(!0);const{recomendedWallets:o}=O.state,r=R.installedInjectedWallets(),a=(t=e==null?void 0:e.map(d=>s.getChainIcon(d.id)))!=null?t:[],i=o.map(d=>s.getWalletIcon(d)),n=r.map(d=>s.getWalletIcon(d));await this.loadImages([...a,...i,...n])}else I.setIsDataLoaded(!0)}async preloadCustomImages(){const t=s.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),W.openToast("Failed preloading","error")}}};Te([f()],re.prototype,"preload",2),re=Te([h("w3m-explorer-context")],re);var lo=Object.defineProperty,so=Object.getOwnPropertyDescriptor,Pe=(t,e,o,r)=>{for(var a=r>1?void 0:r?so(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&lo(e,o,a),a};let ie=class extends m{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const t=I.getSelectedChain();this.activeChainId=t==null?void 0:t.id,this.unwatchNetwork=L.client().watchNetwork(e=>{const o=e.chain;o&&this.activeChainId!==o.id&&(I.setSelectedChain(o),this.activeChainId=o.id,k.resetBalance(),this.fetchBalance())})}disconnectedCallback(){var t;(t=this.unwatchNetwork)==null||t.call(this)}async fetchBalance(){if(T.state.enableAccountView)try{await k.fetchBalance()}catch(t){console.error(t),W.openToast(s.getErrorMessage(t),"error")}}};Pe([f()],ie.prototype,"activeChainId",2),ie=Pe([h("w3m-network-context")],ie);var co=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let _e=class extends m{constructor(){super(),this.unsubscribeTheme=void 0,p.setTheme(),this.unsubscribeTheme=z.subscribe(p.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=z.state,e=[t==null?void 0:t["--w3m-background-image-url"],t==null?void 0:t["--w3m-logo-image-url"]].filter(Boolean);e.length&&await Promise.all(e.map(async o=>s.preloadImage(o)))}catch{console.info("Unsuccessful attempt at preloading some images")}}};_e=co([h("w3m-theme-context")],_e);var mo=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};const ho=24e4,wo=1e3;var Ne;let Re=class extends m{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.unwatchWcConnection=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=(Ne=I.state.selectedChain)==null?void 0:Ne.id,this.isAccountConnected=k.state.isConnected,this.lastRetry=Date.now(),this.unwatchOptions=I.subscribe(t=>{var e,o;((e=t.selectedChain)==null?void 0:e.id)!==this.selectedChainId&&(this.selectedChainId=(o=t.selectedChain)==null?void 0:o.id,this.connectAndWait())}),this.unwatchAccount=k.subscribe(t=>{(this.isAccountConnected!==t.isConnected||!this.isGenerated)&&(this.isAccountConnected=t.isConnected,this.connectAndWait())}),this.unwatchWcConnection=A.subscribe(t=>{t.pairingEnabled&&!this.isGenerated&&this.connectAndWait()})}disconnectedCallback(){var t,e,o;(t=this.unwatchOptions)==null||t.call(this),(e=this.unwatchAccount)==null||e.call(this),(o=this.unwatchWcConnection)==null||o.call(this)}async connectAndWait(){const{pairingEnabled:t}=A.state;if(clearTimeout(this.timeout),!this.isAccountConnected&&t){this.isGenerated=!0,this.timeout=setTimeout(this.connectAndWait.bind(this),ho);try{const{selectedChain:e}=I.state;await L.client().connectWalletConnect(o=>A.setPairingUri(o),e==null?void 0:e.id)}catch(e){console.error(e),A.setPairingError(!0),W.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=wo&&(this.lastRetry=Date.now(),this.connectAndWait())}}}};Re=mo([h("w3m-wc-connection-context")],Re);const po=g`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:var(--w3m-button-border-radius);padding:4px 4px 4px 8px}div button{border-radius:var(--w3m-secondary-button-border-radius);padding:4px 8px;padding-left:4px;height:auto;margin-left:10px;color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}.w3m-no-avatar{padding-left:8px}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var go=Object.defineProperty,uo=Object.getOwnPropertyDescriptor,ne=(t,e,o,r)=>{for(var a=r>1?void 0:r?uo(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&go(e,o,a),a};let It=class extends m{constructor(){super(),this.balance="hide",this.avatar="show"}onOpen(){nt.click({name:"ACCOUNT_BUTTON"}),D.open({route:"Account"})}accountTemplate(){const t=this.avatar==="show";return l`${t?l` `:null} `}render(){const t=this.balance==="show",e={"w3m-no-avatar":this.avatar==="hide"};return t?l`${this.accountTemplate()}
`:l`${this.accountTemplate()} `}};It.styles=[p.globalCss,po],ne([c()],It.prototype,"balance",2),ne([c()],It.prototype,"avatar",2),It=ne([h("w3m-account-button")],It);const vo=g`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var bo=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,le=(t,e,o,r)=>{for(var a=r>1?void 0:r?fo(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&bo(e,o,a),a};let Ot=class extends m{constructor(){super(),this.chainId=0,this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=I.state;this.chainId=t==null?void 0:t.id,this.label=t==null?void 0:t.name,this.unsubscribeNetwork=I.subscribe(({selectedChain:e})=>{this.chainId=e==null?void 0:e.id,this.label=e==null?void 0:e.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){x.push("SelectNetwork")}render(){const{chains:t,selectedChain:e}=I.state,o=t==null?void 0:t.map(i=>i.id),r=e&&(o==null?void 0:o.includes(e.id)),a=t&&t.length<=1&&r;return l`${this.label} `}};Ot.styles=[p.globalCss,vo],le([f()],Ot.prototype,"chainId",2),le([f()],Ot.prototype,"label",2),Ot=le([h("w3m-account-network-button")],Ot);const xo=g`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var yo=Object.defineProperty,Co=Object.getOwnPropertyDescriptor,Et=(t,e,o,r)=>{for(var a=r>1?void 0:r?Co(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&yo(e,o,a),a};let J=class extends m{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=k.state.address,this.name=k.state.profileName,this.loading=!!k.state.profileLoading,this.unsubscribeAccount=k.subscribe(({address:t,profileName:e,profileLoading:o})=>{this.address=t,this.name=e,this.loading=!!o})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;const e=this.variant==="button",o={"w3m-loading":this.loading};return l`${this.name?this.name:s.truncate((t=this.address)!=null?t:"")} `}};J.styles=[p.globalCss,xo],Et([f()],J.prototype,"address",2),Et([f()],J.prototype,"name",2),Et([f()],J.prototype,"loading",2),Et([c()],J.prototype,"variant",2),J=Et([h("w3m-address-text")],J);const j={onConnecting(t){s.goToConnectingView(t)},onExternal(t){s.handleConnectorConnection(t)},manualWalletsTemplate(){return R.manualWallets().map(t=>l` `)},recomendedWalletsTemplate(t=!1){return R.recomendedWallets(t).map(e=>l` `)},externalWalletsTemplate(){return R.externalWallets().map(t=>l` `)},recentWalletTemplate(){const t=R.recentWallet();if(t)return l` `},installedInjectedWalletsTemplate(){return R.installedInjectedWallets().map(t=>l` `)},injectedWalletsTemplate(){return R.injectedWallets().map(t=>l` `)}},ko=g`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.w3m-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.w3m-track svg{margin:0 5px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--w3m-wallet-icon-border-radius)}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-title{display:flex;align-items:center;margin-bottom:10px}.w3m-title svg{margin-right:6px}.w3m-title path{fill:var(--w3m-accent-color)}w3m-modal-footer .w3m-title{padding:0 10px}w3m-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--w3m-color-bg-1))}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var $o=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let se=class extends m{onGoToQrcode(){x.push("Qrcode")}onGetWallet(){x.push("GetWallet")}render(){const{recomendedWallets:t}=O.state,e=[...t,...t],o=j.externalWalletsTemplate(),r=j.installedInjectedWalletsTemplate(),a=[...r,...o].length>0,i=u.RECOMMENDED_WALLET_AMOUNT*2;return l`${w.MOBILE_ICON}WalletConnect
${[...Array(i)].map((n,d)=>{const v=e[d%e.length];return v?l` `:w.WALLET_PLACEHOLDER})}
Select Wallet ${a?l`${w.WALLET_ICON}Other
${r} ${o}
`:null}${`Choose WalletConnect to see supported apps on your device${a?", or select from other options":""}`} I don't have a wallet `}};se.styles=[p.globalCss,ko],se=$o([h("w3m-android-wallet-selection")],se);const Io=g`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var Oo=Object.defineProperty,Eo=Object.getOwnPropertyDescriptor,At=(t,e,o,r)=>{for(var a=r>1?void 0:r?Eo(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Oo(e,o,a),a};let tt=class extends m{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=k.state.address,this.avatar=k.state.profileAvatar,this.loading=!!k.state.profileLoading,this.unsubscribeAccount=k.subscribe(({address:t,profileAvatar:e,profileLoading:o})=>{this.address=t,this.avatar=e,this.loading=!!o})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?l` `:this.address?(s.generateAvatarColors(this.address),l``):null}};tt.styles=[p.globalCss,Io],At([f()],tt.prototype,"address",2),At([f()],tt.prototype,"avatar",2),At([f()],tt.prototype,"loading",2),At([c()],tt.prototype,"size",2),tt=At([h("w3m-avatar")],tt);const Ao=g`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var Wo=Object.defineProperty,Mo=Object.getOwnPropertyDescriptor,ce=(t,e,o,r)=>{for(var a=r>1?void 0:r?Mo(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Wo(e,o,a),a};let Wt=class extends m{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=k.state.balance)==null?void 0:t.symbol,this.amount=(e=k.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=k.subscribe(({balance:o})=>{this.symbol=o==null?void 0:o.symbol,this.amount=o==null?void 0:o.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"?t="0":typeof this.amount=="string"&&this.amount.length>6?t=this.amount.substring(0,6):typeof this.amount=="string"&&(t=this.amount),l`${t} ${this.symbol}
`}};Wt.styles=[p.globalCss,Ao],ce([f()],Wt.prototype,"symbol",2),ce([f()],Wt.prototype,"amount",2),Wt=ce([h("w3m-balance")],Wt);const Lo=g`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-accent-fill-color)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var jo=Object.defineProperty,To=Object.getOwnPropertyDescriptor,Ht=(t,e,o,r)=>{for(var a=r>1?void 0:r?To(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&jo(e,o,a),a};let mt=class extends m{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,this.modalUnsub=D.subscribe(t=>{t.open&&(this.loading=!0),t.open||(this.loading=!1)})}disconnectedCallback(){var t;(t=this.modalUnsub)==null||t.call(this)}iconTemplate(){return this.icon==="show"?w.WALLET_CONNECT_ICON:null}onClick(){k.state.isConnected?this.onDisconnect():this.onConnect()}async onConnect(){this.loading=!0,nt.click({name:"CONNECT_BUTTON"}),await D.open(),D.state.open||(this.loading=!1)}async onDisconnect(){nt.click({name:"DISCONNECT_BUTTON"}),await L.client().disconnect()}render(){return l`${this.loading?l`Connecting... `:l`${this.iconTemplate()}${this.label} `} `}};mt.styles=[p.globalCss,Lo],Ht([f()],mt.prototype,"loading",2),Ht([c()],mt.prototype,"label",2),Ht([c()],mt.prototype,"icon",2),mt=Ht([h("w3m-connect-button")],mt);const Po=g`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:90px;height:90px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.w3m-stale svg,.w3m-stale use{display:none}`;var _o=Object.defineProperty,No=Object.getOwnPropertyDescriptor,ht=(t,e,o,r)=>{for(var a=r>1?void 0:r?No(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&_o(e,o,a),a};let K=class extends m{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const o=(e=(t=z.state.themeVariables)==null?void 0:t["--w3m-wallet-icon-large-border-radius"])!=null?e:p.getPreset("--w3m-wallet-icon-large-border-radius");let r=0;o.includes("%")?r=88/100*parseInt(o,10):r=parseInt(o,10),r*=1.17;const a=317-r*1.57,i=425-r*1.8;return l` `}render(){const t={"w3m-error":this.isError,"w3m-stale":this.isStale};return l`${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label} `}};K.styles=[p.globalCss,Po],ht([c()],K.prototype,"walletId",2),ht([c()],K.prototype,"imageId",2),ht([c()],K.prototype,"isError",2),ht([c()],K.prototype,"isStale",2),ht([c()],K.prototype,"label",2),K=ht([h("w3m-connector-waiting")],K);var Ro=Object.defineProperty,Do=Object.getOwnPropertyDescriptor,wt=(t,e,o,r)=>{for(var a=r>1?void 0:r?Do(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Ro(e,o,a),a};let et=class extends m{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.avatar="show",this.balance="hide",this.unsubscribeAccount=void 0,this.isConnected=k.state.isConnected,this.unsubscribeAccount=k.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=T.state,e=this.balance,o=this.label,r=this.icon,a=this.avatar;return this.isConnected&&t?l` `:l` `}};wt([f()],et.prototype,"isConnected",2),wt([c()],et.prototype,"label",2),wt([c()],et.prototype,"icon",2),wt([c()],et.prototype,"avatar",2),wt([c()],et.prototype,"balance",2),et=wt([h("w3m-core-button")],et);const Zo=g`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-accent-color)}`;var Ho=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let de=class extends m{render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=T.state,o=t!=="ALL"&&e,r=j.manualWalletsTemplate(),a=j.recomendedWalletsTemplate(),i=j.externalWalletsTemplate(),n=j.recentWalletTemplate();let d=[...j.installedInjectedWalletsTemplate(),n,...i,...r,...a];d=d.filter(Boolean);const v=d.length>4||o;let y=[];v?y=d.slice(0,3):y=d;const H=!!y.length;return l`${w.MOBILE_ICON}Mobile
${w.SCAN_ICON}Scan with your wallet
${H?l`${w.DESKTOP_ICON}Desktop
${y} ${v?l` `:null}
`:null}`}};de.styles=[p.globalCss,Zo],de=Ho([h("w3m-desktop-wallet-selection")],de);const Bo=g`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var So=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let me=class extends m{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=T.state;return t??e?l``:null}};me.styles=[p.globalCss,Bo],me=So([h("w3m-legal-notice")],me);const Uo=g`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var Vo=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let he=class extends m{onQrcode(){x.push("Qrcode")}render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=T.state,o=t!=="ALL"&&e,r=j.manualWalletsTemplate(),a=j.recomendedWalletsTemplate(),i=j.externalWalletsTemplate(),n=j.recentWalletTemplate();let d=[...j.installedInjectedWalletsTemplate(),n,...i,...r,...a];d=d.filter(Boolean);const v=d.length>8||o;let y=[];v?y=d.slice(0,7):y=d;const H=!!y.length;return l` ${H?l`${y} ${v?l` `:null}
`:null}`}};he.styles=[p.globalCss,Uo],he=Vo([h("w3m-mobile-wallet-selection")],he);const zo=g`:host{all:initial}.w3m-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--w3m-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--w3m-overlay-background-color);backdrop-filter:var(--w3m-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.w3m-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.w3m-active{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) var(--w3m-container-border-radius) var(--w3m-container-border-radius);border:1px solid var(--w3m-color-overlay);overflow:hidden}.w3m-card{width:100%;position:relative;border-radius:var(--w3m-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) 0 0}.w3m-card{border-radius:var(--w3m-container-border-radius) var(--w3m-container-border-radius) 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:440px){.w3m-container{border:0}}`;var Go=Object.defineProperty,Fo=Object.getOwnPropertyDescriptor,we=(t,e,o,r)=>{for(var a=r>1?void 0:r?Fo(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Go(e,o,a),a};let Mt=class extends m{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=D.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return s.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return s.getShadowRootElement(this,".w3m-container")}toggleBodyScroll(t){if(document.querySelector("body"))if(t){const e=document.getElementById("w3m-styles");e==null||e.remove()}else document.head.insertAdjacentHTML("beforeend",'')}onCloseModal(t){t.target===t.currentTarget&&D.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=s.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,o=.2;await Promise.all([rt(this.overlayEl,{opacity:[0,1]},{delay:e,duration:o}).finished,rt(this.containerEl,t,{delay:e,duration:o}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=s.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([rt(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,rt(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?D.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"w3m-overlay":!0,"w3m-active":this.active};return l` `}};Mt.styles=[p.globalCss,zo],we([f()],Mt.prototype,"open",2),we([f()],Mt.prototype,"active",2),Mt=we([h("w3m-modal")],Mt);const qo=g`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var Ko=Object.defineProperty,Yo=Object.getOwnPropertyDescriptor,Bt=(t,e,o,r)=>{for(var a=r>1?void 0:r?Yo(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Ko(e,o,a),a};let pt=class extends m{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0;const{selectedChain:t}=I.state;this.onSetChainData(t),this.unsubscribeNetwork=I.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=I.state,o=e==null?void 0:e.map(r=>r.id);this.chainId=t.id.toString(),this.wrongNetwork=!(o!=null&&o.includes(t.id)),this.label=this.wrongNetwork?"Wrong Network":t.name}}onClick(){nt.click({name:"NETWORK_BUTTON"}),D.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=I.state,o=e&&e.length>1;return l`${(t=this.label)!=null&&t.length?this.label:"Select Network"} `}};pt.styles=[p.globalCss,qo],Bt([f()],pt.prototype,"chainId",2),Bt([f()],pt.prototype,"label",2),Bt([f()],pt.prototype,"wrongNetwork",2),pt=Bt([h("w3m-network-switch")],pt);const Qo=g`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:1px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-network-image{width:92px;height:92px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}`;var Xo=Object.defineProperty,Jo=Object.getOwnPropertyDescriptor,St=(t,e,o,r)=>{for(var a=r>1?void 0:r?Jo(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Xo(e,o,a),a};let gt=class extends m{constructor(){super(...arguments),this.chainId=void 0,this.isError=!1,this.label=""}svgLoaderTemplate(){return l` `}render(){const t={"w3m-error":this.isError};return l`${this.svgLoaderTemplate()}
${this.isError?"Switch declined":this.label} `}};gt.styles=[p.globalCss,Qo],St([c()],gt.prototype,"chainId",2),St([c()],gt.prototype,"isError",2),St([c()],gt.prototype,"label",2),gt=St([h("w3m-network-waiting")],gt);const tr=g`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var er=Object.defineProperty,ar=Object.getOwnPropertyDescriptor,at=(t,e,o,r)=>{for(var a=r>1?void 0:r?ar(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&er(e,o,a),a};let V=class extends m{constructor(){super(...arguments),this.isMobile=!1,this.isInjected=!1,this.isInjectedInstalled=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){u.isMobile()?x.replace("MobileConnecting"):x.replace("MobileQrcodeConnecting")}onInjected(){this.isInjectedInstalled?x.replace("InjectedConnecting"):x.replace("InstallWallet")}onDesktop(){x.replace("DesktopConnecting")}onWeb(){x.replace("WebConnecting")}render(){return l`${this.isRetry?l` `:null} ${this.isMobile?l`Mobile `:null} ${this.isInjected?l`Browser `:null} ${this.isDesktop?l`Desktop `:null} ${this.isWeb?l`Web `:null}
`}};V.styles=[p.globalCss,tr],at([c()],V.prototype,"isMobile",2),at([c()],V.prototype,"isInjected",2),at([c()],V.prototype,"isInjectedInstalled",2),at([c()],V.prototype,"isDesktop",2),at([c()],V.prototype,"isWeb",2),at([c()],V.prototype,"isRetry",2),V=at([h("w3m-platform-selection")],V);const or=g`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--w3m-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--w3m-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--w3m-wallet-icon-border-radius)/ 2);border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var rr=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let pe=class extends m{onClick(){x.push("WalletExplorer")}render(){const{recomendedWallets:t}=O.state,e=R.manualWallets(),o=[...t,...e].reverse().slice(0,4);return l`${o.map(r=>{const a=s.getWalletIcon(r);if(a)return l`
`;const i=s.getWalletIcon({id:r.id});return i?l`
`:w.WALLET_PLACEHOLDER})} ${[...Array(4-o.length)].map(()=>w.WALLET_PLACEHOLDER)}
View All `}};pe.styles=[p.globalCss,or],pe=rr([h("w3m-view-all-wallets-button")],pe);const ir=g`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var nr=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,Ut=(t,e,o,r)=>{for(var a=r>1?void 0:r?lr(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&nr(e,o,a),a};let ut=class extends m{constructor(){super(),this.walletId="",this.imageId="",this.uri="",this.unwatchWcConnection=void 0,setTimeout(()=>{const{pairingUri:t}=A.state;this.uri=t},0),this.unwatchWcConnection=A.subscribe(t=>{t.pairingUri&&(this.uri=t.pairingUri)})}disconnectedCallback(){var t;(t=this.unwatchWcConnection)==null||t.call(this)}get overlayEl(){return s.getShadowRootElement(this,".w3m-qr-container")}render(){return l`${this.uri?l` `:l` `}
`}};ut.styles=[p.globalCss,ir],Ut([c()],ut.prototype,"walletId",2),Ut([c()],ut.prototype,"imageId",2),Ut([f()],ut.prototype,"uri",2),ut=Ut([h("w3m-walletconnect-qr")],ut);const sr=g`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-success-color);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-success-color),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var cr=Object.defineProperty,dr=Object.getOwnPropertyDescriptor,De=(t,e,o,r)=>{for(var a=r>1?void 0:r?dr(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&cr(e,o,a),a};let Vt=class extends m{constructor(){super(...arguments),this.loading=!1}async onDisconnect(){this.loading||(this.loading=!0,await L.client().disconnect(),this.loading=!1)}async onCopyAddress(){var t;try{await navigator.clipboard.writeText((t=k.state.address)!=null?t:""),W.openToast("Address copied","success")}catch{W.openToast("Failed to copy","error")}}render(){return l`
`}};Vt.styles=[p.globalCss,sr],De([f()],Vt.prototype,"loading",2),Vt=De([h("w3m-account-view")],Vt);var mr=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let ge=class extends m{viewTemplate(){return u.isAndroid()?l` `:u.isMobile()?l` `:l` `}render(){return l`${this.viewTemplate()} `}};ge.styles=[p.globalCss],ge=mr([h("w3m-connect-wallet-view")],ge);const hr=g`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var wr=Object.defineProperty,pr=Object.getOwnPropertyDescriptor,Ze=(t,e,o,r)=>{for(var a=r>1?void 0:r?pr(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&wr(e,o,a),a};let zt=class extends m{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openDesktopApp(),this.unwatchConnection=A.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:o}=u.getWalletRouterData(),r=e==null?void 0:e.native;if(r){const a=u.formatNativeUrl(r,t,o);u.openHref(a,"_self")}}openDesktopApp(){A.setPairingError(!1);const{pairingUri:t}=A.state,e=u.getWalletRouterData();s.setRecentWallet(e),this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:o}=u.getWalletRouterData(),{isMobile:r,isInjected:a,isWeb:i}=s.getCachedRouterWalletPlatforms();return l`${`Connection can continue loading if ${t} is not installed on your device`} Retry `}};zt.styles=[p.globalCss,hr],Ze([f()],zt.prototype,"isError",2),zt=Ze([h("w3m-desktop-connecting-view")],zt);const gr=g`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var ur=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let ue=class extends m{onGet(t){u.openHref(t,"_blank")}render(){const t=O.state.recomendedWallets.slice(0,5),e=R.manualWallets().slice(0,5),o=t.length,r=e.length;return l`${o?t.map(a=>l``):null} ${r?e.map(a=>l``):null} `}};ue.styles=[p.globalCss,gr],ue=ur([h("w3m-get-wallet-view")],ue);const vr=g`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;var br=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let ve=class extends m{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){T.state.enableExplorer?x.push("GetWallet"):s.openWalletExplorerUrl()}onLearnMore(){u.openHref(this.learnUrl,"_blank")}render(){return l`${w.HELP_CHART_IMG} ${w.HELP_PAINTING_IMG} ${w.HELP_ETH_IMG}
A home for your digital assets A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs. ${w.HELP_KEY_IMG} ${w.HELP_USER_IMG} ${w.HELP_LOCK_IMG}
One login for all of web3 Log in to any app by connecting your wallet. Say goodbye to countless passwords! ${w.HELP_COMPAS_IMG} ${w.HELP_NOUN_IMG} ${w.HELP_DAO_IMG}
Your gateway to a new web With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more. `}};ve.styles=[p.globalCss,vr],ve=br([h("w3m-help-view")],ve);const fr=g`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var xr=Object.defineProperty,yr=Object.getOwnPropertyDescriptor,He=(t,e,o,r)=>{for(var a=r>1?void 0:r?yr(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&xr(e,o,a),a};let Gt=class extends m{constructor(){super(),this.isError=!1,this.connector=L.client().getConnectorById("injected"),this.openInjectedApp()}async openInjectedApp(){const{ready:t}=this.connector;t&&(this.isError=!1,await s.handleConnectorConnection("injected",()=>{this.isError=!0}))}render(){const{name:t,id:e,image_id:o}=u.getWalletRouterData(),{isMobile:r,isDesktop:a,isWeb:i}=s.getCachedRouterWalletPlatforms();return l`Connection can be declined if multiple wallets are installed or previous request is still active Retry `}};Gt.styles=[p.globalCss,fr],He([f()],Gt.prototype,"isError",2),Gt=He([h("w3m-injected-connecting-view")],Gt);const Cr=g`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var kr=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let be=class extends m{onInstall(t){t&&u.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:o,homepage:r}=u.getWalletRouterData();return l`${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`} Download `}};be.styles=[p.globalCss,Cr],be=kr([h("w3m-install-wallet-view")],be);const $r=g`w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}w3m-info-footer{display:flex;width:100%}.w3m-app-store{justify-content:space-between}.w3m-app-store w3m-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--w3m-wallet-icon-small-border-radius)}.w3m-app-store div{display:flex;align-items:center}.w3m-app-store w3m-button{margin-right:-10px}.w3m-note{flex-direction:column;align-items:center;padding:5px 0}.w3m-note w3m-text{text-align:center}w3m-platform-selection{margin-top:-15px}.w3m-note w3m-text{margin-top:15px}.w3m-note w3m-text span{color:var(--w3m-accent-color)}`;var Ir=Object.defineProperty,Or=Object.getOwnPropertyDescriptor,Be=(t,e,o,r)=>{for(var a=r>1?void 0:r?Or(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Ir(e,o,a),a};let Ft=class extends m{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openMobileApp(),this.unwatchConnection=A.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t,e=!1){const{mobile:o,name:r}=u.getWalletRouterData(),a=o==null?void 0:o.native,i=o==null?void 0:o.universal;if(a&&!e){const n=u.formatNativeUrl(a,t,r);u.openHref(n,"_self")}else if(i){const n=u.formatUniversalUrl(i,t,r);u.openHref(n,"_self")}}openMobileApp(t=!1){A.setPairingError(!1);const{pairingUri:e}=A.state,o=u.getWalletRouterData();s.setRecentWallet(o),this.onFormatAndRedirect(e,t)}onGoToAppStore(t){t&&u.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:o,app:r,mobile:a}=u.getWalletRouterData(),{isWeb:i}=s.getCachedRouterWalletPlatforms(),n=r==null?void 0:r.ios,d=a==null?void 0:a.universal;return l`Retry ${d?l`Still doesn't work? this.openMobileApp(!0)}">Try this alternate link `:null}${`Get ${t}`}
App Store `}};Ft.styles=[p.globalCss,$r],Be([f()],Ft.prototype,"isError",2),Ft=Be([h("w3m-mobile-connecting-view")],Ft);const Er=g`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var Ar=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let fe=class extends m{render(){const{name:t,id:e,image_id:o}=u.getWalletRouterData(),{isInjected:r,isDesktop:a,isWeb:i}=s.getCachedRouterWalletPlatforms();return l`${`Scan this QR Code with your phone's camera or inside ${t} app`} `}};fe.styles=[p.globalCss,Er],fe=Ar([h("w3m-mobile-qr-connecting-view")],fe);var Wr=(t,e,o,r)=>{for(var a=e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=n(a)||a);return a};let xe=class extends m{render(){return l` `}};xe.styles=[p.globalCss],xe=Wr([h("w3m-qrcode-view")],xe);const Mr=g`div{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center}`;var Ge=Object.defineProperty,Lr=Object.defineProperties,jr=Object.getOwnPropertyDescriptor,Tr=Object.getOwnPropertyDescriptors,Se=Object.getOwnPropertySymbols,Pr=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable,Ue=(t,e,o)=>e in t?Ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Nr=(t,e)=>{for(var o in e||(e={}))Pr.call(e,o)&&Ue(t,o,e[o]);if(Se)for(var o of Se(e))_r.call(e,o)&&Ue(t,o,e[o]);return t},Rr=(t,e)=>Lr(t,Tr(e)),ye=(t,e,o,r)=>{for(var a=r>1?void 0:r?jr(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Ge(e,o,a),a};let Lt=class extends m{constructor(){super(),this.connectedChains="ALL",this.isUnsupportedChains=!1,this.getConnectedChainIds()}async getConnectedChainIds(){this.connectedChains=await L.client().getConnectedChainIds()}async onSelectChain(t){try{const{selectedChain:e,isPreferInjected:o}=I.state,{isConnected:r}=k.state;r?(e==null?void 0:e.id)===t.id?x.reset("Account"):s.getWagmiWalletType()==='"walletConnect"'?(await L.client().switchNetwork({chainId:t.id}),x.reset("Account")):x.push("SwitchNetwork",{SwitchNetwork:t}):o?(I.setSelectedChain(t),D.close()):(I.setSelectedChain(t),x.push("ConnectWallet"))}catch(e){console.error(e),W.openToast("Unsupported chain","error")}}isUnsuportedChainId(t){return typeof this.connectedChains=="string"&&this.connectedChains!=="ALL"?(this.isUnsupportedChains=!0,!0):Array.isArray(this.connectedChains)&&!this.connectedChains.includes(String(t))?(this.isUnsupportedChains=!0,!0):!1}render(){const{chains:t}=I.state,e=t==null?void 0:t.map(r=>Rr(Nr({},r),{unsupported:this.isUnsuportedChainId(r.id)})),o=e==null?void 0:e.sort((r,a)=>Number(r.unsupported)-Number(a.unsupported));return l`${o==null?void 0:o.map(r=>l`${r.name} `)}
${this.isUnsupportedChains?l`Your connected wallet may not support some of the networks available for this dapp `:null}`}};Lt.styles=[p.globalCss,Mr],ye([f()],Lt.prototype,"connectedChains",2),ye([f()],Lt.prototype,"isUnsupportedChains",2),Lt=ye([h("w3m-select-network-view")],Lt);const Dr=g`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var Zr=Object.defineProperty,Hr=Object.getOwnPropertyDescriptor,Ve=(t,e,o,r)=>{for(var a=r>1?void 0:r?Hr(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Zr(e,o,a),a};let qt=class extends m{constructor(){super(),this.isError=!1,this.onSwitchNetwork()}async onSwitchNetwork(){try{this.isError=!1;const t=u.getSwitchNetworkRouterData();await L.client().switchNetwork({chainId:t.id}),I.setSelectedChain(t),x.reset("Account")}catch{this.isError=!0}}render(){const{id:t,name:e}=u.getSwitchNetworkRouterData();return l`Switch can be declined if chain is not supported by a wallet or previous request is still active Try Again `}};qt.styles=[p.globalCss,Dr],Ve([f()],qt.prototype,"isError",2),qt=Ve([h("w3m-switch-network-view")],qt);const Br=g`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var Sr=Object.defineProperty,Ur=Object.getOwnPropertyDescriptor,jt=(t,e,o,r)=>{for(var a=r>1?void 0:r?Ur(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&Sr(e,o,a),a};const Ce=40;let ot=class extends m{constructor(){super(...arguments),this.loading=!O.state.wallets.listings.length,this.firstFetch=!O.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=s.debounce(t=>{t.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=t,O.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),O.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return s.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=O.state,{listings:o,total:r}=this.search?e:t;return r<=Ce||o.length>=r}async fetchWallets(){const{wallets:t,search:e,injectedWallets:o}=O.state,{listings:r,total:a,page:i}=this.search?e:t;if(!this.endReached&&(this.firstFetch||a>Ce&&r.lengths.getWalletIcon(y)),v=o.map(y=>s.getWalletIcon(y));await Promise.all([...d.map(async y=>s.preloadImage(y)),...v.map(async y=>s.preloadImage(y)),u.wait(300)]),this.endReached=this.isLastPage()}catch(n){console.error(n),W.openToast(s.getErrorMessage(n),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){u.isAndroid()?s.handleMobileLinking(t):s.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=O.state,{listings:o}=this.search?e:t,r=this.loading&&!o.length,a=this.search.length>=3;let i=j.injectedWalletsTemplate(),n=j.manualWalletsTemplate(),d=j.recomendedWalletsTemplate(!0);a&&(i=i.filter(({values:Z})=>s.caseSafeIncludes(Z[0],this.search)),n=n.filter(({values:Z})=>s.caseSafeIncludes(Z[0],this.search)),d=d.filter(({values:Z})=>s.caseSafeIncludes(Z[0],this.search))),i=i.filter(Z=>!d.find(_=>s.caseSafeIncludes(Z.values[0],_.values[0])));const v=!this.loading&&!o.length&&!i.length&&!d.length,y=Math.max(i.length,o.length),H={"w3m-loading":r,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":v};return l`${r?null:d} ${r?null:[...Array(y)].map((Z,_)=>l`${n[_]} ${i[_]} ${o[_]?l` `:null}`)}
${v?l`No results found `:null} ${!v&&this.loading?l` `:null}
`}};ot.styles=[p.globalCss,Br],jt([f()],ot.prototype,"loading",2),jt([f()],ot.prototype,"firstFetch",2),jt([f()],ot.prototype,"search",2),jt([f()],ot.prototype,"endReached",2),ot=jt([h("w3m-wallet-explorer-view")],ot);const Vr=g`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var zr=Object.defineProperty,Gr=Object.getOwnPropertyDescriptor,ze=(t,e,o,r)=>{for(var a=r>1?void 0:r?Gr(e,o):e,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(r?n(e,o,a):n(a))||a);return r&&a&&zr(e,o,a),a};let Kt=class extends m{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openWebWallet(),this.unwatchConnection=A.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:o}=u.getWalletRouterData(),r=e==null?void 0:e.universal;if(r){const a=u.formatUniversalUrl(r,t,o);u.openHref(a,"_blank")}}openWebWallet(){A.setPairingError(!1);const{pairingUri:t}=A.state,e=u.getWalletRouterData();s.setRecentWallet(e),this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:o}=u.getWalletRouterData(),{isMobile:r,isInjected:a,isDesktop:i}=s.getCachedRouterWalletPlatforms(),n=u.isMobile();return l`${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`} Retry `}};Kt.styles=[p.globalCss,Vr],ze([f()],Kt.prototype,"isError",2),Kt=ze([h("w3m-web-connecting-view")],Kt);export{It as W3mAccountButton,mt as W3mConnectButton,et as W3mCoreButton,Mt as W3mModal,pt as W3mNetworkSwitch,F as W3mQrCode};