Reading from NEAR testnet…
Reading from NEAR testnet…
7TfXiDQSbPPr96VaEVDnYfTuwcqxkDTvrtviHjXyksJb
web4.nearbuilders.testnet to web4.nearbuilders.testnet · failed
fs_store()
te$16([r$4()],W3mEmailVerifyDeviceView.prototype,"loading",void 0);W3mEmailVerifyDeviceView=__decorate$16([customElement("w3m-email-verify-device-view")],W3mEmailVerifyDeviceView);const styles$I=i$6`
div {
width: 100%;
height: 400px;
}
[data-ready='false'] {
transform: scale(1.05);
}
@media (max-width: 430px) {
[data-ready='false'] {
transform: translateY(-50px);
}
}
`;var __decorate$15=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};const PAGE_HEIGHT=400,PAGE_WIDTH=360,HEADER_HEIGHT=64;let W3mApproveTransactionView=class extends r$6{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(ModalController.subscribeKey("open",Fn=>{Fn||(this.onHideIframe(),RouterController.popTransactionStack())}),ModalController.subscribeKey("shake",Fn=>{Fn?this.iframe.style.animation="w3m-shake 500ms var(--wui-ease-out-power-2)":this.iframe.style.animation="none"}))}disconnectedCallback(){var Fn;this.onHideIframe(),this.unsubscribe.forEach(io=>io()),(Fn=this.bodyObserver)==null||Fn.unobserve(window.document.body)}async firstUpdated(){await this.syncTheme(),this.iframe.style.display="block",this.bodyObserver=new ResizeObserver(Fn=>{var $o,mo;const io=($o=Fn==null?void 0:Fn[0])==null?void 0:$o.contentBoxSize,fo=(mo=io==null?void 0:io[0])==null?void 0:mo.inlineSize;this.iframe.style.height=`${PAGE_HEIGHT}px`,fo&&fo<=430?(this.iframe.style.width="100%",this.iframe.style.left="0px",this.iframe.style.bottom="0px",this.iframe.style.top="unset"):(this.iframe.style.width=`${PAGE_WIDTH}px`,this.iframe.style.left=`calc(50% - ${PAGE_WIDTH/2}px)`,this.iframe.style.top=`calc(50% - ${PAGE_HEIGHT/2}px + ${HEADER_HEIGHT/2}px)`,this.iframe.style.bottom="unset"),this.ready=!0,this.onShowIframe()}),this.bodyObserver.observe(window.document.body)}render(){return x$5`<div data-ready=${this.ready}></div>`}onShowIframe(){const Fn=window.innerWidth<=430;this.iframe.style.animation=Fn?"w3m-iframe-zoom-in-mobile 200ms var(--wui-ease-out-power-2)":"w3m-iframe-zoom-in 200ms var(--wui-ease-out-power-2)"}onHideIframe(){this.iframe.style.display="none",this.iframe.style.animation="w3m-iframe-fade-out 200ms var(--wui-ease-out-power-2)"}async syncTheme(){const Fn=ConnectorController.getAuthConnector();if(Fn){const io=ThemeController.getSnapshot().themeMode,fo=ThemeController.getSnapshot().themeVariables;await Fn.provider.syncTheme({themeVariables:fo,w3mThemeVariables:getW3mThemeVariables(fo,io)})}}};W3mApproveTransactionView.styles=styles$I;__decorate$15([r$4()],W3mApproveTransactionView.prototype,"ready",void 0);W3mApproveTransactionView=__decorate$15([customElement("w3m-approve-transaction-view")],W3mApproveTransactionView);var __decorate$14=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mUpgradeWalletView=class extends r$6{render(){return x$5`
<wui-flex flexDirection="column" alignItems="center" gap="xl" padding="xl">
<wui-text variant="paragraph-400" color="fg-100">Follow the instructions on</wui-text>
<wui-chip
icon="externalLink"
variant="fill"
href=${ConstantsUtil$1.SECURE_SITE_DASHBOARD}
imageSrc=${ConstantsUtil$1.SECURE_SITE_FAVICON}
data-testid="w3m-secure-website-button"
>
</wui-chip>
<wui-text variant="small-400" color="fg-200">
You will have to reconnect for security reasons
</wui-text>
</wui-flex>
`}};W3mUpgradeWalletView=__decorate$14([customElement("w3m-upgrade-wallet-view")],W3mUpgradeWalletView);var __decorate$13=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mUpgradeToSmartAccountView=class extends r$6{constructor(){super(...arguments),this.authConnector=ConnectorController.getAuthConnector(),this.loading=!1,this.setPreferSmartAccount=async()=>{if(this.authConnector)try{this.loading=!0,await ConnectionController.setPreferredAccountType(W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT),this.loading=!1,RouterUtil.navigateAfterPreferredAccountTypeSelect()}catch{SnackController.showError("Error upgrading to smart account")}}}render(){return x$5`
<wui-flex
flexDirection="column"
alignItems="center"
gap="xxl"
.padding=${["0","0","l","0"]}
>
${this.onboardingTemplate()} ${this.buttonsTemplate()}
<wui-link
@click=${()=>{CoreHelperUtil.openHref(NavigationUtil.URLS.FAQ,"_blank")}}
>
Learn more
<wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
</wui-link>
</wui-flex>
`}onboardingTemplate(){return x$5` <wui-flex
flexDirection="column"
gap="xxl"
alignItems="center"
.padding=${["0","xxl","0","xxl"]}
>
<wui-flex gap="s" alignItems="center" justifyContent="center">
<wui-visual name="google"></wui-visual>
<wui-visual name="pencil"></wui-visual>
<wui-visual name="lightbulb"></wui-visual>
</wui-flex>
<wui-flex flexDirection="column" alignItems="center" gap="s">
<wui-text align="center" variant="medium-600" color="fg-100">
Discover Smart Accounts
</wui-text>
<wui-text align="center" variant="paragraph-400" color="fg-100">
Access advanced features such as username, social login, improved security and a smoother
user experience!
</wui-text>
</wui-flex>
</wui-flex>`}buttonsTemplate(){return x$5`<wui-flex .padding=${["0","2l","0","2l"]} gap="s">
<wui-button
variant="accent"
@click=${this.redirectToAccount.bind(this)}
size="lg"
borderRadius="xs"
>
Do it later
</wui-button>
<wui-button
.loading=${this.loading}
size="lg"
borderRadius="xs"
@click=${this.setPreferSmartAccount.bind(this)}
>Continue
</wui-button>
</wui-flex>`}redirectToAccount(){RouterController.push("Account")}};__decorate$13([r$4()],W3mUpgradeToSmartAccountView.prototype,"authConnector",void 0);__decorate$13([r$4()],W3mUpgradeToSmartAccountView.prototype,"loading",void 0);W3mUpgradeToSmartAccountView=__decorate$13([customElement("w3m-upgrade-to-smart-account-view")],W3mUpgradeToSmartAccountView);const styles$H=i$6`
wui-email-input {
width: 100%;
}
form {
width: 100%;
display: block;
position: relative;
}
`;var __decorate$12=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mUpdateEmailWalletView=class extends r$6{constructor(){var Fn;super(...arguments),this.formRef=e$1(),this.initialEmail=((Fn=RouterController.state.data)==null?void 0:Fn.email)??"",this.email="",this.loading=!1}firstUpdated(){var Fn;(Fn=this.formRef.value)==null||Fn.addEventListener("keydown",io=>{io.key==="Enter"&&this.onSubmitEmail(io)})}render(){const Fn=!this.loading&&this.email.length>3&&this.email!==this.initialEmail;return x$5`
<wui-flex flexDirection="column" padding="m" gap="m">
<form ${n$5(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
<wui-email-input
value=${this.initialEmail}
.disabled=${this.loading}
@inputChange=${this.onEmailInputChange.bind(this)}
>
</wui-email-input>
<input type="submit" hidden />
</form>
<wui-flex gap="s">
<wui-button size="md" variant="neutral" fullWidth @click=${RouterController.goBack}>
Cancel
</wui-button>
<wui-button
size="md"
variant="main"
fullWidth
@click=${this.onSubmitEmail.bind(this)}
.disabled=${!Fn}
.loading=${this.loading}
>
Save
</wui-button>
</wui-flex>
</wui-flex>
`}onEmailInputChange(Fn){this.email=Fn.detail}async onSubmitEmail(Fn){try{if(this.loading)return;this.loading=!0,Fn.preventDefault();const io=ConnectorController.getAuthConnector();if(!io)throw new Error("w3m-update-email-wallet: Auth connector not found");const fo=await io.provider.updateEmail({email:this.email});EventsController.sendEvent({type:"track",event:"EMAIL_EDIT"}),fo.action==="VERIFY_SECONDARY_OTP"?RouterController.push("UpdateEmailSecondaryOtp",{email:this.initialEmail,newEmail:this.email}):RouterController.push("UpdateEmailPrimaryOtp",{email:this.initialEmail,newEmail:this.email})}catch(io){SnackController.showError(io),this.loading=!1}}};W3mUpdateEmailWalletView.styles=styles$H;__decorate$12([r$4()],W3mUpdateEmailWalletView.prototype,"email",void 0);__decorate$12([r$4()],W3mUpdateEmailWalletView.prototype,"loading",void 0);W3mUpdateEmailWalletView=__decorate$12([customElement("w3m-update-email-wallet-view")],W3mUpdateEmailWalletView);var __decorate$11=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mUpdateEmailPrimaryOtpView=class extends W3mEmailOtpWidget{constructor(){var Fn;super(),this.email=(Fn=RouterController.state.data)==null?void 0:Fn.email,this.onOtpSubmit=async io=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailPrimaryOtp({otp:io}),EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),RouterController.replace("UpdateEmailSecondaryOtp",RouterController.state.data))}catch(fo){throw EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),fo}},this.onStartOver=()=>{RouterController.replace("UpdateEmailWallet",RouterController.state.data)}}};W3mUpdateEmailPrimaryOtpView=__decorate$11([customElement("w3m-update-email-primary-otp-view")],W3mUpdateEmailPrimaryOtpView);var __decorate$10=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mUpdateEmailSecondaryOtpView=class extends W3mEmailOtpWidget{constructor(){var Fn;super(),this.email=(Fn=RouterController.state.data)==null?void 0:Fn.newEmail,this.onOtpSubmit=async io=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailSecondaryOtp({otp:io}),EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),RouterController.reset("Account"))}catch(fo){throw EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),fo}},this.onStartOver=()=>{RouterController.replace("UpdateEmailWallet",RouterController.state.data)}}};W3mUpdateEmailSecondaryOtpView=__decorate$10([customElement("w3m-update-email-secondary-otp-view")],W3mUpdateEmailSecondaryOtpView);const styles$G=i$6`
:host > wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
}
:host > wui-flex::-webkit-scrollbar {
display: none;
}
`;var __decorate$$=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mUnsupportedChainView=class extends r$6{constructor(){var Fn;super(...arguments),this.swapUnsupportedChain=(Fn=RouterController.state.data)==null?void 0:Fn.swapUnsupportedChain,this.disconecting=!1}render(){return x$5`
<wui-flex class="container" flexDirection="column" gap="0">
<wui-flex
class="container"
flexDirection="column"
.padding=${["m","xl","xs","xl"]}
alignItems="center"
gap="xl"
>
${this.descriptionTemplate()}
</wui-flex>
<wui-flex flexDirection="column" padding="s" gap="xs">
${this.networksTemplate()}
</wui-flex>
<wui-separator text="or"></wui-separator>
<wui-flex flexDirection="column" padding="s" gap="xs">
<wui-list-item
variant="icon"
iconVariant="overlay"
icon="disconnect"
?chevron=${!1}
.loading=${this.disconecting}
@click=${this.onDisconnect.bind(this)}
data-testid="disconnect-button"
>
<wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text>
</wui-list-item>
</wui-flex>
</wui-flex>
`}descriptionTemplate(){return this.swapUnsupportedChain?x$5`
<wui-text variant="small-400" color="fg-200" align="center">
The swap feature doesn’t support your current network. Switch to an available option to
continue.
</wui-text>
`:x$5`
<wui-text variant="small-400" color="fg-200" align="center">
This app doesn’t support your current network. Switch to an available option to continue.
</wui-text>
`}networksTemplate(){const Fn=NetworkController.getRequestedCaipNetworks(),io=NetworkController.state.approvedCaipNetworkIds,fo=CoreHelperUtil.sortRequestedNetworks(io,Fn);return(this.swapUnsupportedChain?fo.filter(mo=>ConstantsUtil$1.SWAP_SUPPORTED_NETWORKS.includes(mo.id)):fo).map(mo=>x$5`
<wui-list-network
imageSrc=${o$4(AssetUtil.getNetworkImage(mo))}
name=${mo.name??"Unknown"}
@click=${()=>this.onSwitchNetwork(mo)}
>
</wui-list-network>
`)}async onDisconnect(){try{this.disconecting=!0,await ConnectionController.disconnect(),EventsController.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),ModalController.close()}catch{EventsController.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),SnackController.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(Fn){const io=AccountController.state.isConnected,fo=NetworkController.state.approvedCaipNetworkIds,$o=NetworkController.state.supportsAllNetworks,mo=NetworkController.state.caipNetwork,Ao=RouterController.state.data;io&&(mo==null?void 0:mo.id)!==Fn.id?fo!=null&&fo.includes(Fn.id)?(await NetworkController.switchActiveNetwork(Fn),await NetworkUtil.onNetworkChange()):$o&&RouterController.push("SwitchNetwork",{...Ao,network:Fn}):io||(NetworkController.setActiveCaipNetwork(Fn),RouterController.push("Connect"))}};W3mUnsupportedChainView.styles=styles$G;__decorate$$([r$4()],W3mUnsupportedChainView.prototype,"disconecting",void 0);W3mUnsupportedChainView=__decorate$$([customElement("w3m-unsupported-chain-view")],W3mUnsupportedChainView);const styles$F=i$6`
wui-compatible-network {
margin-top: var(--wui-spacing-l);
}
`;var __decorate$_=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mWalletReceiveView=class extends r$6{constructor(){super(),this.unsubscribe=[],this.address=AccountController.state.address,this.profileName=AccountController.state.profileName,this.network=NetworkController.state.caipNetwork,this.preferredAccountType=AccountController.state.preferredAccountType,this.unsubscribe.push(AccountController.subscribe(Fn=>{Fn.address?(this.address=Fn.address,this.profileName=Fn.profileName,this.preferredAccountType=Fn.preferredAccountType):SnackController.showError("Account not found")}),NetworkController.subscribeKey("caipNetwork",Fn=>{Fn!=null&&Fn.id&&(this.network=Fn)}))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const Fn=AssetUtil.getNetworkImage(this.network);return x$5` <wui-flex
flexDirection="column"
.padding=${["0","l","l","l"]}
alignItems="center"
>
<wui-chip-button
data-testid="receive-address-copy-button"
@click=${this.onCopyClick.bind(this)}
text=${UiHelperUtil.getTruncateString({string:this.profileName||this.address||"",charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
icon="copy"
size="sm"
imageSrc=${Fn||""}
variant="gray"
></wui-chip-button>
<wui-flex
flexDirection="column"
.padding=${["l","0","0","0"]}
alignItems="center"
gap="s"
>
<wui-qr-code
size=${232}
theme=${ThemeController.state.themeMode}
uri=${this.address}
?arenaClear=${!0}
data-testid="wui-qr-code"
></wui-qr-code>
<wui-text variant="paragraph-500" color="fg-100" align="center">
Copy your address or scan this QR code
</wui-text>
</wui-flex>
${this.networkTemplate()}
</wui-flex>`}networkTemplate(){var Ao;const Fn=NetworkController.getRequestedCaipNetworks(),io=NetworkController.checkIfSmartAccountEnabled(),fo=NetworkController.state.caipNetwork;if(this.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT&&io)return fo?x$5`<wui-compatible-network
@click=${this.onReceiveClick.bind(this)}
text="Only receive assets on this network"
.networkImages=${[AssetUtil.getNetworkImage(fo)??""]}
></wui-compatible-network>`:null;const mo=((Ao=Fn==null?void 0:Fn.filter(jo=>jo==null?void 0:jo.imageId))==null?void 0:Ao.slice(0,5)).map(AssetUtil.getNetworkImage).filter(Boolean);return x$5`<wui-compatible-network
@click=${this.onReceiveClick.bind(this)}
text="Only receive assets on these networks"
.networkImages=${mo}
></wui-compatible-network>`}onReceiveClick(){RouterController.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(CoreHelperUtil.copyToClopboard(this.address),SnackController.showSuccess("Address copied"))}catch{SnackController.showError("Failed to copy")}}};W3mWalletReceiveView.styles=styles$F;__decorate$_([r$4()],W3mWalletReceiveView.prototype,"address",void 0);__decorate$_([r$4()],W3mWalletReceiveView.prototype,"profileName",void 0);__decorate$_([r$4()],W3mWalletReceiveView.prototype,"network",void 0);__decorate$_([r$4()],W3mWalletReceiveView.prototype,"preferredAccountType",void 0);W3mWalletReceiveView=__decorate$_([customElement("w3m-wallet-receive-view")],W3mWalletReceiveView);const styles$E=i$6`
:host > wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
}
:host > wui-flex::-webkit-scrollbar {
display: none;
}
`;var __decorate$Z=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mWalletCompatibleNetworksView=class extends r$6{constructor(){super(),this.unsubscribe=[],this.preferredAccountType=AccountController.state.preferredAccountType,this.unsubscribe.push(AccountController.subscribeKey("preferredAccountType",Fn=>{this.preferredAccountType=Fn}))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){return x$5` <wui-flex
flexDirection="column"
.padding=${["xs","s","m","s"]}
gap="xs"
>
<wui-banner
icon="warningCircle"
text="You can only receive assets on these networks"
></wui-banner>
${this.networkTemplate()}
</wui-flex>`}networkTemplate(){const Fn=NetworkController.getRequestedCaipNetworks(),io=NetworkController.state.approvedCaipNetworkIds,fo=NetworkController.state.caipNetwork,$o=NetworkController.checkIfSmartAccountEnabled();let mo=CoreHelperUtil.sortRequestedNetworks(io,Fn);if($o&&this.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT){if(!fo)return null;mo=[fo]}return mo.map(Ao=>x$5`
<wui-list-network
imageSrc=${o$4(AssetUtil.getNetworkImage(Ao))}
name=${Ao.name??"Unknown"}
?transparent=${!0}
>
</wui-list-network>
`)}};W3mWalletCompatibleNetworksView.styles=styles$E;__decorate$Z([r$4()],W3mWalletCompatibleNetworksView.prototype,"preferredAccountType",void 0);W3mWalletCompatibleNetworksView=__decorate$Z([customElement("w3m-wallet-compatible-networks-view")],W3mWalletCompatibleNetworksView);const styles$D=i$6`
:host {
display: block;
}
wui-flex {
position: relative;
}
wui-icon-box {
width: 40px;
height: 40px;
border-radius: var(--wui-border-radius-xs) !important;
border: 5px solid var(--wui-color-bg-125);
background: var(--wui-color-bg-175);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 3;
}
wui-button {
--local-border-radius: var(--wui-border-radius-xs) !important;
}
.inputContainer {
height: fit-content;
}
`;var __decorate$Y=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mWalletSendView=class extends r$6{constructor(){super(),this.unsubscribe=[],this.token=SendController.state.token,this.sendTokenAmount=SendController.state.sendTokenAmount,this.receiverAddress=SendController.state.receiverAddress,this.receiverProfileName=SendController.state.receiverProfileName,this.loading=SendController.state.loading,this.gasPriceInUSD=SendController.state.gasPriceInUSD,this.gasPrice=SendController.state.gasPrice,this.message="Preview Send",this.fetchNetworkPrice(),this.unsubscribe.push(SendController.subscribe(Fn=>{this.token=Fn.token,this.sendTokenAmount=Fn.sendTokenAmount,this.receiverAddress=Fn.receiverAddress,this.gasPriceInUSD=Fn.gasPriceInUSD,this.receiverProfileName=Fn.receiverProfileName,this.loading=Fn.loading}))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){return this.getMessage(),x$5` <wui-flex flexDirection="column" .padding=${["0","l","l","l"]}>
<wui-flex class="inputContainer" gap="xs" flexDirection="column">
<w3m-input-token
.token=${this.token}
.sendTokenAmount=${this.sendTokenAmount}
.gasPriceInUSD=${this.gasPriceInUSD}
.gasPrice=${this.gasPrice}
></w3m-input-token>
<wui-icon-box
size="inherit"
backgroundColor="fg-300"
iconSize="lg"
iconColor="fg-250"
background="opaque"
icon="arrowBottom"
></wui-icon-box>
<w3m-input-address
.value=${this.receiverProfileName?this.receiverProfileName:this.receiverAddress}
></w3m-input-address>
</wui-flex>
<wui-flex .margin=${["l","0","0","0"]}>
<wui-button
@click=${this.onButtonClick.bind(this)}
?disabled=${!this.message.startsWith("Preview Send")}
size="lg"
variant="main"
?loading=${this.loading}
fullWidth
>
${this.message}
</wui-button>
</wui-flex>
</wui-flex>`}async fetchNetworkPrice(){await SwapController.getNetworkTokenPrice();const Fn=await SwapController.getInitialGasPrice();Fn!=null&&Fn.gasPrice&&(Fn!=null&&Fn.gasPriceInUSD)&&(SendController.setGasPrice(Fn.gasPrice),SendController.setGasPriceInUsd(Fn.gasPriceInUSD))}onButtonClick(){RouterController.push("WalletSendPreview")}getMessage(){var Fn;this.message="Preview Send",this.receiverAddress&&!CoreHelperUtil.isAddress(this.receiverAddress,ChainController.state.activeChain)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.sendTokenAmount&&((Fn=this.token)!=null&&Fn.price)&&(this.sendTokenAmount*this.token.price||(this.message="Incorrect Value")),this.token||(this.message="Select Token")}};W3mWalletSendView.styles=styles$D;__decorate$Y([r$4()],W3mWalletSendView.prototype,"token",void 0);__decorate$Y([r$4()],W3mWalletSendView.prototype,"sendTokenAmount",void 0);__decorate$Y([r$4()],W3mWalletSendView.prototype,"receiverAddress",void 0);__decorate$Y([r$4()],W3mWalletSendView.prototype,"receiverProfileName",void 0);__decorate$Y([r$4()],W3mWalletSendView.prototype,"loading",void 0);__decorate$Y([r$4()],W3mWalletSendView.prototype,"gasPriceInUSD",void 0);__decorate$Y([r$4()],W3mWalletSendView.prototype,"gasPrice",void 0);__decorate$Y([r$4()],W3mWalletSendView.prototype,"message",void 0);W3mWalletSendView=__decorate$Y([customElement("w3m-wallet-send-view")],W3mWalletSendView);const styles$C=i$6`
.contentContainer {
height: 440px;
overflow: scroll;
scrollbar-width: none;
}
.contentContainer::-webkit-scrollbar {
display: none;
}
wui-icon-box {
width: 40px;
height: 40px;
border-radius: var(--wui-border-radius-xxs);
}
`;var __decorate$X=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mSendSelectTokenView=class extends r$6{constructor(){super(),this.unsubscribe=[],this.tokenBalance=AccountController.state.tokenBalance,this.search="",this.onDebouncedSearch=CoreHelperUtil.debounce(Fn=>{this.search=Fn}),this.unsubscribe.push(AccountController.subscribe(Fn=>{this.tokenBalance=Fn.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){return x$5`
<wui-flex flexDirection="column">
${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
</wui-flex>
`}templateSearchInput(){return x$5`
<wui-flex gap="xs" padding="s">
<wui-input-text
@inputChange=${this.onInputChange.bind(this)}
class="network-search-input"
size="sm"
placeholder="Search token"
icon="search"
></wui-input-text>
</wui-flex>
`}templateTokens(){var Fn,io;return this.tokens=(Fn=this.tokenBalance)==null?void 0:Fn.filter(fo=>{var $o;return fo.chainId===(($o=NetworkController.state.caipNetwork)==null?void 0:$o.id)}),this.search?this.filteredTokens=(io=this.tokenBalance)==null?void 0:io.filter(fo=>fo.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,x$5`
<wui-flex
class="contentContainer"
flexDirection="column"
.padding=${["0","s","0","s"]}
>
<wui-flex justifyContent="flex-start" .padding=${["m","s","s","s"]}>
<wui-text variant="paragraph-500" color="fg-200">Your tokens</wui-text>
</wui-flex>
<wui-flex flexDirection="column" gap="xs">
${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(fo=>x$5`<wui-list-token
@click=${this.handleTokenClick.bind(this,fo)}
?clickable=${!0}
tokenName=${fo.name}
tokenImageUrl=${fo.iconUrl}
tokenAmount=${fo.quantity.numeric}
tokenValue=${fo.value}
tokenCurrency=${fo.symbol}
></wui-list-token>`):x$5`<wui-flex
.padding=${["4xl","0","0","0"]}
alignItems="center"
flexDirection="column"
gap="l"
>
<wui-icon-box
icon="coinPlaceholder"
size="inherit"
iconColor="fg-200"
backgroundColor="fg-200"
iconSize="lg"
></wui-icon-box>
<wui-flex
class="textContent"
gap="xs"
flexDirection="column"
justifyContent="center"
flexDirection="column"
>
<wui-text variant="paragraph-500" align="center" color="fg-100"
>No tokens found</wui-text
>
<wui-text variant="small-400" align="center" color="fg-200"
>Your tokens will appear here</wui-text
>
</wui-flex>
<wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
</wui-flex>`}
</wui-flex>
</wui-flex>
`}onBuyClick(){RouterController.push("OnRampProviders")}onInputChange(Fn){this.onDebouncedSearch(Fn.detail)}handleTokenClick(Fn){SendController.setToken(Fn),SendController.setTokenAmount(void 0),RouterController.goBack()}};W3mSendSelectTokenView.styles=styles$C;__decorate$X([r$4()],W3mSendSelectTokenView.prototype,"tokenBalance",void 0);__decorate$X([r$4()],W3mSendSelectTokenView.prototype,"tokens",void 0);__decorate$X([r$4()],W3mSendSelectTokenView.prototype,"filteredTokens",void 0);__decorate$X([r$4()],W3mSendSelectTokenView.prototype,"search",void 0);W3mSendSelectTokenView=__decorate$X([customElement("w3m-wallet-send-select-token-view")],W3mSendSelectTokenView);const styles$B=i$6`
wui-avatar,
wui-image {
display: ruby;
width: 32px;
height: 32px;
border-radius: var(--wui-border-radius-3xl);
}
.sendButton {
width: 70%;
--local-width: 100% !important;
--local-border-radius: var(--wui-border-radius-xs) !important;
}
.cancelButton {
width: 30%;
--local-width: 100% !important;
--local-border-radius: var(--wui-border-radius-xs) !important;
}
`;var __decorate$W=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mWalletSendPreviewView=class extends r$6{constructor(){super(),this.unsubscribe=[],this.token=SendController.state.token,this.sendTokenAmount=SendController.state.sendTokenAmount,this.receiverAddress=SendController.state.receiverAddress,this.receiverProfileName=SendController.state.receiverProfileName,this.receiverProfileImageUrl=SendController.state.receiverProfileImageUrl,this.gasPriceInUSD=SendController.state.gasPriceInUSD,this.caipNetwork=NetworkController.state.caipNetwork,this.unsubscribe.push(SendController.subscribe(Fn=>{this.token=Fn.token,this.sendTokenAmount=Fn.sendTokenAmount,this.receiverAddress=Fn.receiverAddress,this.gasPriceInUSD=Fn.gasPriceInUSD,this.receiverProfileName=Fn.receiverProfileName,this.receiverProfileImageUrl=Fn.receiverProfileImageUrl}),NetworkController.subscribeKey("caipNetwork",Fn=>this.caipNetwork=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){var Fn,io;return x$5` <wui-flex flexDirection="column" .padding=${["0","l","l","l"]}>
<wui-flex gap="xs" flexDirection="column" .padding=${["0","xs","0","xs"]}>
<wui-flex alignItems="center" justifyContent="space-between">
<wui-flex flexDirection="column" gap="4xs">
<wui-text variant="small-400" color="fg-150">Send</wui-text>
${this.sendValueTemplate()}
</wui-flex>
<wui-preview-item
text="${this.sendTokenAmount?UiHelperUtil.roundNumber(this.sendTokenAmount,6,5):"unknown"} ${(Fn=this.token)==null?void 0:Fn.symbol}"
.imageSrc=${(io=this.token)==null?void 0:io.iconUrl}
></wui-preview-item>
</wui-flex>
<wui-flex>
<wui-icon color="fg-200" size="md" name="arrowBottom"></wui-icon>
</wui-flex>
<wui-flex alignItems="center" justifyContent="space-between">
<wui-text variant="small-400" color="fg-150">To</wui-text>
<wui-preview-item
text="${this.receiverProfileName?UiHelperUtil.getTruncateString({string:this.receiverProfileName,charsStart:20,charsEnd:0,truncate:"end"}):UiHelperUtil.getTruncateString({string:this.receiverAddress?this.receiverAddress:"",charsStart:4,charsEnd:4,truncate:"middle"})}"
address=${this.receiverAddress??""}
.imageSrc=${this.receiverProfileImageUrl??void 0}
.isAddress=${!0}
></wui-preview-item>
</wui-flex>
</wui-flex>
<wui-flex flexDirection="column" .padding=${["xxl","0","0","0"]}>
<w3m-wallet-send-details
.caipNetwork=${this.caipNetwork}
.receiverAddress=${this.receiverAddress}
.networkFee=${this.gasPriceInUSD}
></w3m-wallet-send-details>
<wui-flex justifyContent="center" gap="xxs" .padding=${["s","0","0","0"]}>
<wui-icon size="sm" color="fg-200" name="warningCircle"></wui-icon>
<wui-text variant="small-400" color="fg-200">Review transaction carefully</wui-text>
</wui-flex>
<wui-flex justifyContent="center" gap="s" .padding=${["l","0","0","0"]}>
<wui-button
class="cancelButton"
@click=${this.onCancelClick.bind(this)}
size="lg"
variant="neutral"
>
Cancel
</wui-button>
<wui-button
class="sendButton"
@click=${this.onSendClick.bind(this)}
size="lg"
variant="main"
>
Send
</wui-button>
</wui-flex>
</wui-flex></wui-flex
>`}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const io=this.token.price*this.sendTokenAmount;return x$5`<wui-text variant="paragraph-400" color="fg-100"
>$${io.toFixed(2)}</wui-text
>`}return null}onSendClick(){SendController.sendToken()}onCancelClick(){RouterController.goBack()}};W3mWalletSendPreviewView.styles=styles$B;__decorate$W([r$4()],W3mWalletSendPreviewView.prototype,"token",void 0);__decorate$W([r$4()],W3mWalletSendPreviewView.prototype,"sendTokenAmount",void 0);__decorate$W([r$4()],W3mWalletSendPreviewView.prototype,"receiverAddress",void 0);__decorate$W([r$4()],W3mWalletSendPreviewView.prototype,"receiverProfileName",void 0);__decorate$W([r$4()],W3mWalletSendPreviewView.prototype,"receiverProfileImageUrl",void 0);__decorate$W([r$4()],W3mWalletSendPreviewView.prototype,"gasPriceInUSD",void 0);__decorate$W([r$4()],W3mWalletSendPreviewView.prototype,"caipNetwork",void 0);W3mWalletSendPreviewView=__decorate$W([customElement("w3m-wallet-send-preview-view")],W3mWalletSendPreviewView);const styles$A=i$6`
wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
}
wui-flex::-webkit-scrollbar {
display: none;
}
`;var __decorate$V=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectWalletsView=class extends r$6{render(){return x$5`
<wui-flex flexDirection="column" padding="s" gap="xs">
<w3m-wallet-login-list></w3m-wallet-login-list>
</wui-flex>
<w3m-legal-footer></w3m-legal-footer>
`}};W3mConnectWalletsView.styles=styles$A;W3mConnectWalletsView=__decorate$V([customElement("w3m-connect-wallets-view")],W3mConnectWalletsView);const styles$z=i$6`
wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
}
wui-flex::-webkit-scrollbar {
display: none;
}
`;var __decorate$U=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectSocialsView=class extends r$6{render(){return x$5`
<wui-flex flexDirection="column" padding="s" gap="xs">
<w3m-social-login-list></w3m-social-login-list>
</wui-flex>
<w3m-legal-footer></w3m-legal-footer>
`}};W3mConnectSocialsView.styles=styles$z;W3mConnectSocialsView=__decorate$U([customElement("w3m-connect-socials-view")],W3mConnectSocialsView);const styles$y=i$6`
wui-logo {
width: 80px;
height: 80px;
border-radius: var(--wui-border-radius-m);
}
@keyframes shake {
0% {
transform: translateX(0);
}
25% {
transform: translateX(3px);
}
50% {
transform: translateX(-3px);
}
75% {
transform: translateX(3px);
}
100% {
transform: translateX(0);
}
}
wui-flex:first-child:not(:only-child) {
position: relative;
}
wui-loading-thumbnail {
position: absolute;
}
wui-icon-box {
position: absolute;
right: calc(var(--wui-spacing-3xs) * -1);
bottom: calc(var(--wui-spacing-3xs) * -1);
opacity: 0;
transform: scale(0.5);
transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
}
wui-text[align='center'] {
width: 100%;
padding: 0px var(--wui-spacing-l);
}
[data-error='true'] wui-icon-box {
opacity: 1;
transform: scale(1);
}
[data-error='true'] > wui-flex:first-child {
animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
.capitalize {
text-transform: capitalize;
}
`;var __decorate$T=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectingSocialView=class extends r$6{constructor(){super(),this.unsubscribe=[],this.socialProvider=AccountController.state.socialProvider,this.socialWindow=AccountController.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.authConnector=ConnectorController.getAuthConnector(),this.handleSocialConnection=async Fn=>{var io;if((io=Fn.data)!=null&&io.resultUri)if(Fn.origin===ConstantsUtil.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),AccountController.setSocialWindow(void 0,ChainController.state.activeChain)),this.connecting=!0,this.updateMessage();const fo=Fn.data.resultUri;await this.authConnector.provider.connectSocial(fo),this.socialProvider&&(StorageUtil.setConnectedSocialProvider(this.socialProvider),await ConnectionController.connectExternal(this.authConnector,this.authConnector.chain),EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}))}}catch{this.error=!0,this.updateMessage(),this.socialProvider&&EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}}else RouterController.goBack(),SnackController.showError("Untrusted Origin"),this.socialProvider&&EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})},this.unsubscribe.push(AccountController.subscribe(Fn=>{Fn.socialProvider&&(this.socialProvider=Fn.socialProvider),Fn.socialWindow&&(this.socialWindow=Fn.socialWindow),Fn.address&&ModalController.state.open&&ModalController.close()})),this.authConnector&&this.connectSocial()}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn()),window.removeEventListener("message",this.handleSocialConnection,!1)}render(){return x$5`
<wui-flex
data-error=${o$4(this.error)}
flexDirection="column"
alignItems="center"
.padding=${["3xl","xl","xl","xl"]}
gap="xl"
>
<wui-flex justifyContent="center" alignItems="center">
<wui-logo logo=${o$4(this.socialProvider)}></wui-logo>
${this.error?null:this.loaderTemplate()}
<wui-icon-box
backgroundColor="error-100"
background="opaque"
iconColor="error-100"
icon="close"
size="sm"
border
borderColor="wui-color-bg-125"
></wui-icon-box>
</wui-flex>
<wui-flex flexDirection="column" alignItems="center" gap="xs">
<wui-text align="center" variant="paragraph-500" color="fg-100"
>Log in with
<span class="capitalize">${this.socialProvider??"Social"}</span></wui-text
>
<wui-text align="center" variant="small-400" color=${this.error?"error-100":"fg-200"}
>${this.message}</wui-text
></wui-flex
>
</wui-flex>
`}loaderTemplate(){const Fn=ThemeController.state.themeVariables["--w3m-border-radius-master"],io=Fn?parseInt(Fn.replace("px",""),10):4;return x$5`<wui-loading-thumbnail radius=${io*9}></wui-loading-thumbnail>`}connectSocial(){const Fn=setInterval(()=>{var io;(io=this.socialWindow)!=null&&io.closed&&(!this.connecting&&RouterController.state.view==="ConnectingSocial"&&RouterController.goBack(),clearInterval(Fn))},1e3);window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};W3mConnectingSocialView.styles=styles$y;__decorate$T([r$4()],W3mConnectingSocialView.prototype,"socialProvider",void 0);__decorate$T([r$4()],W3mConnectingSocialView.prototype,"socialWindow",void 0);__decorate$T([r$4()],W3mConnectingSocialView.prototype,"error",void 0);__decorate$T([r$4()],W3mConnectingSocialView.prototype,"connecting",void 0);__decorate$T([r$4()],W3mConnectingSocialView.prototype,"message",void 0);W3mConnectingSocialView=__decorate$T([customElement("w3m-connecting-social-view")],W3mConnectingSocialView);const styles$x=i$6`
wui-flex {
width: 100%;
}
wui-icon-link {
margin-right: calc(var(--wui-icon-box-size-md) * -1);
}
.account-links {
display: flex;
justify-content: space-between;
align-items: center;
}
.account-links wui-flex {
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
background: red;
align-items: center;
justify-content: center;
height: 48px;
padding: 10px;
flex: 1 0 0;
border-radius: var(--XS, 16px);
border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: background-color;
}
.account-links wui-flex:hover {
background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
}
.account-links wui-flex wui-icon {
width: var(--S, 20px);
height: var(--S, 20px);
}
.account-links wui-flex wui-icon svg path {
stroke: #47a1ff;
}
.account-settings-button {
padding: calc(var(--wui-spacing-m) - 1px) var(--wui-spacing-2l);
height: 40px;
border-radius: var(--wui-border-radius-xxs);
border: 1px solid var(--wui-color-gray-glass-002);
background: var(--wui-color-gray-glass-002);
cursor: pointer;
}
.account-settings-button:hover {
background: var(--wui-color-gray-glass-005);
}
`;var __decorate$S=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mProfileView=class extends r$6{constructor(){super(),this.usubscribe=[],this.address=AccountController.state.address,this.profileImage=AccountController.state.profileImage,this.profileName=AccountController.state.profileName,this.accounts=AccountController.state.allAccounts,this.usubscribe.push(AccountController.subscribeKey("address",Fn=>{Fn?this.address=Fn:ModalController.close()})),this.usubscribe.push(AccountController.subscribeKey("profileImage",Fn=>{this.profileImage=Fn})),this.usubscribe.push(AccountController.subscribeKey("profileName",Fn=>{this.profileName=Fn}))}disconnectedCallback(){this.usubscribe.forEach(Fn=>Fn())}render(){var io;if(!this.address)throw new Error("w3m-profile-view: No account provided");const Fn=(io=this.profileName)==null?void 0:io.split(".")[0];return x$5`
<wui-flex flexDirection="column" gap="l" .padding=${["0","xl","m","xl"]}>
<wui-flex flexDirection="column" alignItems="center" gap="l">
<wui-avatar
alt=${this.address}
address=${this.address}
imageSrc=${o$4(this.profileImage)}
size="2lg"
></wui-avatar>
<wui-flex flexDirection="column" alignItems="center">
<wui-flex gap="3xs" alignItems="center" justifyContent="center">
<wui-text variant="title-6-600" color="fg-100" data-testid="account-settings-address">
${Fn?UiHelperUtil.getTruncateString({string:Fn,charsStart:20,charsEnd:0,truncate:"end"}):UiHelperUtil.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
</wui-text>
<wui-icon-link
size="md"
icon="copy"
iconColor="fg-200"
@click=${this.onCopyAddress}
></wui-icon-link>
</wui-flex>
</wui-flex>
</wui-flex>
<wui-flex
data-testid="account-settings-button"
justifyContent="center"
alignItems="center"
class="account-settings-button"
@click=${()=>RouterController.push("AccountSettings")}
>
<wui-text variant="paragraph-500" color="fg-100">Account Settings</wui-text>
</wui-flex>
${this.accountsTemplate()}
</wui-flex>
`}accountsTemplate(){return x$5`<wui-flex flexDirection="column">
<wui-flex .padding=${["3xs","m","s","s"]}>
<wui-text color="fg-200" variant="paragraph-400">Your accounts</wui-text>
</wui-flex>
<wui-flex flexDirection="column" gap="xxs">
${this.accounts.map(Fn=>this.accountTemplate(Fn))}
</wui-flex>
</wui-flex>`}async onSwitchAccount(Fn){AccountController.setShouldUpdateToAddress(Fn.address,ChainController.state.activeChain);const io=ConnectorController.getAuthConnector();io&&(await io.provider.setPreferredAccount(Fn.type),await io.provider.connect())}accountTemplate(Fn){return x$5`<wui-list-account accountAddress=${Fn.address} accountType=${Fn.type}>
${Fn.address===this.address?"":x$5`<wui-button
slot="action"
textVariant="small-600"
size="sm"
variant="accent"
@click=${()=>this.onSwitchAccount(Fn)}
>Switch</wui-button
>`}
</wui-list-account>`}onCopyAddress(){try{this.profileName?(CoreHelperUtil.copyToClopboard(this.profileName),SnackController.showSuccess("Name copied")):this.address&&(CoreHelperUtil.copyToClopboard(this.address),SnackController.showSuccess("Address copied"))}catch{SnackController.showError("Failed to copy")}}};W3mProfileView.styles=styles$x;__decorate$S([r$4()],W3mProfileView.prototype,"address",void 0);__decorate$S([r$4()],W3mProfileView.prototype,"profileImage",void 0);__decorate$S([r$4()],W3mProfileView.prototype,"profileName",void 0);__decorate$S([r$4()],W3mProfileView.prototype,"accounts",void 0);W3mProfileView=__decorate$S([customElement("w3m-profile-view")],W3mProfileView);const styles$w=i$6`
input[type='checkbox'] {
all: revert;
width: var(--wui-spacing-xl);
height: var(--wui-spacing-xl);
accent-color: var(--wui-color-accent-100);
}
`;var __decorate$R=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mSelectAddressesView=class extends r$6{constructor(){super(),this.metadata=OptionsController.state.metadata,this.allAccounts=AccountController.state.allAccounts,this.selectedAccounts=AccountController.state.allAccounts,this.selectAll=!0,this.approved=!1,this.isApproving=!1,this.getAddressTemplate=Fn=>{const io=this.selectedAccounts.some(fo=>fo.address===Fn.address);return x$5`<wui-list-account accountAddress="${Fn.address}" accountType="${Fn.type}">
<input
id="${Fn.address}"
slot="action"
type="checkbox"
.checked="${io}"
@change="${this.handleClick(Fn)}"
/>
</wui-list-account>`},this.onSelectAll=Fn=>{const io=Fn.target.checked;this.selectAll=this.selectedAccounts.length===this.allAccounts.length,this.allAccounts.forEach(fo=>{this.onSelect(fo,io)})},this.onSelect=(Fn,io)=>{io?this.selectedAccounts.push(Fn):this.selectedAccounts=this.selectedAccounts.filter(fo=>fo.address!==Fn.address),this.selectedAccounts.length>0&&(this.selectAll=this.selectedAccounts.length===this.allAccounts.length)},AccountController.subscribeKey("allAccounts",Fn=>{this.allAccounts=Fn})}render(){var Fn,io;return x$5`
<wui-flex justifyContent="center" .padding=${["xl","0","xl","0"]}>
<wui-banner-img imageSrc="${o$4((Fn=this.metadata)==null?void 0:Fn.icons[0])}" text="${o$4((io=this.metadata)==null?void 0:io.url)}" size="sm"></wui-banner>
</wui-flex>
<wui-flex .padding=${["0","xl","0","xl"]} flexDirection="row" justifyContent="space-between">
<wui-text variant="paragraph-400" color="fg-200">Select all</wui-text>
<input type="checkbox" .checked=${this.selectAll} @click=${this.onSelectAll.bind(this)} />
</wui-flex>
<wui-flex flexDirection="column" .padding=${["l","xl","xl","xl"]}>
${this.allAccounts.map(fo=>this.getAddressTemplate(fo))}
</wui-flex>
<wui-flex .padding=${["l","xl","xl","xl"]} gap="s" justifyContent="space-between">
<wui-button
size="md"
?fullwidth=${!0}
variant="neutral"
@click=${this.onCancel.bind(this)}
data-testid="w3m-connecting-siwe-cancel"
>
Cancel
</wui-button>
<wui-button
size="md"
?fullwidth=${!0}
variant="main"
.disabled=${this.selectedAccounts.length===0}
@click=${this.onContinue.bind(this)}
?loading=${this.isApproving}
>
${this.isApproving?"Signing...":"Continue"}
</wui-button>
</wui-flex>
`}handleClick(Fn){return io=>{var $o;const fo=io.target;($o=this.onSelect)==null||$o.call(this,{...Fn},fo==null?void 0:fo.checked)}}onContinue(){var Fn;this.selectedAccounts.length>0?(this.isApproving=!0,AccountController.setAllAccounts(this.selectedAccounts,ChainController.state.activeChain),AccountController.setShouldUpdateToAddress(((Fn=this.selectedAccounts[0])==null?void 0:Fn.address)??"",ChainController.state.activeChain),this.approved=!0,this.isApproving=!1,ModalController.close()):this.onCancel()}async onCancel(){const{isConnected:Fn}=AccountController.state;Fn?(await ConnectionController.disconnect(),ModalController.close()):RouterController.push("Connect")}disconnectedCallback(){super.disconnectedCallback(),this.approved||this.onCancel()}};W3mSelectAddressesView.styles=styles$w;__decorate$R([r$4()],W3mSelectAddressesView.prototype,"allAccounts",void 0);__decorate$R([r$4()],W3mSelectAddressesView.prototype,"selectedAccounts",void 0);__decorate$R([r$4()],W3mSelectAddressesView.prototype,"selectAll",void 0);__decorate$R([r$4()],W3mSelectAddressesView.prototype,"approved",void 0);__decorate$R([r$4()],W3mSelectAddressesView.prototype,"isApproving",void 0);W3mSelectAddressesView=__decorate$R([customElement("w3m-select-addresses-view")],W3mSelectAddressesView);const styles$v=i$6`
wui-avatar {
width: var(--wui-spacing-3xl);
height: var(--wui-spacing-3xl);
box-shadow: 0 0 0 0;
}
wui-icon-box {
position: relative;
right: 15px;
top: 15px;
border: 2px solid var(--wui-color-bg-150);
background-color: var(--wui-color-bg-125);
}
`;var __decorate$Q=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mSwitchAddressView=class extends r$6{constructor(){super(),this.metadata=OptionsController.state.metadata,this.allAccounts=AccountController.state.allAccounts||[],this.balances={},this.labels=AccountController.state.addressLabels,this.currentAddress=AccountController.state.address||"",this.connectedConnector=StorageUtil.getConnectedConnector(),this.shouldShowIcon=this.connectedConnector==="AUTH",this.caipNetwork=NetworkController.state.caipNetwork,AccountController.subscribeKey("allAccounts",Fn=>{this.allAccounts=Fn})}connectedCallback(){super.connectedCallback(),this.allAccounts.forEach(Fn=>{var io;BlockchainApiController.getBalance(Fn.address,(io=this.caipNetwork)==null?void 0:io.id).then(fo=>{let $o=this.balances[Fn.address]||0;fo.balances.length>0&&($o=fo.balances.reduce((mo,Ao)=>mo+((Ao==null?void 0:Ao.value)||0),0)),this.balances[Fn.address]=$o,this.requestUpdate()})})}getAddressIcon(Fn){return Fn==="smartAccount"?"lightbulb":"mail"}render(){var Fn,io;return x$5`
<wui-flex justifyContent="center" .padding=${["xl","0","xl","0"]}>
<wui-banner-img
imageSrc=${o$4((Fn=this.metadata)==null?void 0:Fn.icons[0])}
text=${o$4((io=this.metadata)==null?void 0:io.url)}
size="sm"
></wui-banner-img>
</wui-flex>
<wui-flex flexDirection="column" gap="xxl" .padding=${["l","xl","xl","xl"]}>
${this.allAccounts.map((fo,$o)=>this.getAddressTemplate(fo,$o))}
</wui-flex>
`}getAddressTemplate(Fn,io){var $o,mo,Ao,jo;const fo=($o=this.labels)==null?void 0:$o.get(Fn.address);return x$5`
<wui-flex
flexDirection="row"
justifyContent="space-between"
data-testid="switch-address-item"
>
<wui-flex alignItems="center">
<wui-avatar address=${Fn.address}></wui-avatar>
${this.shouldShowIcon?x$5`<wui-icon-box
size="sm"
iconcolor="fg-200"
backgroundcolor="glass-002"
background="gray"
icon="${this.getAddressIcon(Fn.type)}"
?border=${!0}
></wui-icon-box>`:x$5`<wui-flex .padding="${["0","0","0","s"]}"></wui-flex>`}
<wui-flex flexDirection="column">
<wui-text class="address" variant="paragraph-500" color="fg-100"
>${fo||UiHelperUtil.getTruncateString({string:Fn.address,charsStart:4,charsEnd:6,truncate:"middle"})}</wui-text
>
<wui-text class="address-description" variant="small-400">
${typeof this.balances[Fn.address]=="number"?`$${(mo=this.balances[Fn.address])==null?void 0:mo.toFixed(2)}`:x$5`<wui-loading-spinner size="sm" color="accent-100"></wui-loading-spinner>`}
</wui-text>
</wui-flex>
</wui-flex>
<wui-flex gap="s" alignItems="center">
${((Ao=Fn.address)==null?void 0:Ao.toLowerCase())===((jo=this.currentAddress)==null?void 0:jo.toLowerCase())?"":x$5`
<wui-button
data-testid=${`w3m-switch-address-button-${io}`}
textVariant="small-600"
size="md"
variant="accent"
@click=${()=>this.onSwitchAddress(Fn.address)}
>Switch to</wui-button
>
`}
</wui-flex>
</wui-flex>
`}onSwitchAddress(Fn){AccountController.setShouldUpdateToAddress(Fn,ChainController.state.activeChain),ModalController.close()}};W3mSwitchAddressView.styles=styles$v;__decorate$Q([r$4()],W3mSwitchAddressView.prototype,"allAccounts",void 0);__decorate$Q([r$4()],W3mSwitchAddressView.prototype,"balances",void 0);W3mSwitchAddressView=__decorate$Q([customElement("w3m-switch-address-view")],W3mSwitchAddressView);const styles$u=i$6`
@keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
wui-shimmer {
width: 100%;
aspect-ratio: 1 / 1;
border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
}
wui-qr-code {
opacity: 0;
animation-duration: 200ms;
animation-timing-function: ease;
animation-name: fadein;
animation-fill-mode: forwards;
}
wui-logo {
width: 80px;
height: 80px;
border-radius: var(--wui-border-radius-m);
}
wui-flex:first-child:not(:only-child) {
position: relative;
}
wui-loading-thumbnail {
position: absolute;
}
wui-icon-box {
position: absolute;
right: calc(var(--wui-spacing-3xs) * -1);
bottom: calc(var(--wui-spacing-3xs) * -1);
opacity: 0;
transform: scale(0.5);
transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
}
`;var __decorate$P=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectingFarcasterView=class extends r$6{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=AccountController.state.socialProvider,this.uri=AccountController.state.farcasterUrl,this.ready=!1,this.loading=!1,this.authConnector=ConnectorController.getAuthConnector(),this.forceUpdate=()=>{this.requestUpdate()},this.unsubscribe.push(AccountController.subscribeKey("farcasterUrl",Fn=>{Fn&&(this.uri=Fn,this.connectFarcaster())}),AccountController.subscribeKey("socialProvider",Fn=>{Fn&&(this.socialProvider=Fn)})),window.addEventListener("resize",this.forceUpdate)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.timeout),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),x$5`${this.platformTemplate()}`}platformTemplate(){return CoreHelperUtil.isMobile()?x$5`${this.mobileTemplate()}`:x$5`${this.desktopTemplate()}`}desktopTemplate(){return this.loading?x$5`${this.loadingTemplate()}`:x$5`${this.qrTemplate()}`}qrTemplate(){return x$5` <wui-flex
flexDirection="column"
alignItems="center"
.padding=${["0","xl","xl","xl"]}
gap="xl"
>
<wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
<wui-text variant="paragraph-500" color="fg-100">
Scan this QR Code with your phone
</wui-text>
${this.copyTemplate()}
</wui-flex>`}loadingTemplate(){return x$5`
<wui-flex
flexDirection="column"
alignItems="center"
.padding=${["xl","xl","xl","xl"]}
gap="xl"
>
<wui-flex justifyContent="center" alignItems="center">
<wui-logo logo="farcaster"></wui-logo>
${this.loaderTemplate()}
<wui-icon-box
backgroundColor="error-100"
background="opaque"
iconColor="error-100"
icon="close"
size="sm"
border
borderColor="wui-color-bg-125"
></wui-icon-box>
</wui-flex>
<wui-flex flexDirection="column" alignItems="center" gap="xs">
<wui-text align="center" variant="paragraph-500" color="fg-100">
Loading user data
</wui-text>
<wui-text align="center" variant="small-400" color="fg-200">
Please wait a moment while we load your data.
</wui-text>
</wui-flex>
</wui-flex>
`}mobileTemplate(){return x$5` <wui-flex
flexDirection="column"
alignItems="center"
.padding=${["3xl","xl","xl","xl"]}
gap="xl"
>
<wui-flex justifyContent="center" alignItems="center">
<wui-logo logo="farcaster"></wui-logo>
${this.loaderTemplate()}
<wui-icon-box
backgroundColor="error-100"
background="opaque"
iconColor="error-100"
icon="close"
size="sm"
border
borderColor="wui-color-bg-125"
></wui-icon-box>
</wui-flex>
<wui-flex flexDirection="column" alignItems="center" gap="xs">
<wui-text align="center" variant="paragraph-500" color="fg-100"
>Continue in Farcaster</span></wui-text
>
<wui-text align="center" variant="small-400" color="fg-200"
>Accept connection request in the app</wui-text
></wui-flex
>
${this.mobileLinkTemplate()}
</wui-flex>`}loaderTemplate(){const Fn=ThemeController.state.themeVariables["--w3m-border-radius-master"],io=Fn?parseInt(Fn.replace("px",""),10):4;return x$5`<wui-loading-thumbnail radius=${io*9}></wui-loading-thumbnail>`}async connectFarcaster(){var Fn;if(this.authConnector)try{await((Fn=this.authConnector)==null?void 0:Fn.provider.connectFarcaster()),this.socialProvider&&StorageUtil.setConnectedSocialProvider(this.socialProvider),this.loading=!0,await ConnectionController.connectExternal(this.authConnector,this.authConnector.chain),this.loading=!1,ModalController.close()}catch(io){RouterController.goBack(),SnackController.showError(io)}}mobileLinkTemplate(){return x$5`<wui-button
size="md"
?loading=${this.loading}
?disabled=${!this.uri||this.loading}
@click=${()=>{this.uri&&CoreHelperUtil.openHref(this.uri,"_blank")}}
>
Open farcaster</wui-button
>`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},0))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const Fn=this.getBoundingClientRect().width-40;return x$5` <wui-qr-code
size=${Fn}
theme=${ThemeController.state.themeMode}
uri=${this.uri}
?farcaster=${!0}
data-testid="wui-qr-code"
></wui-qr-code>`}copyTemplate(){const Fn=!this.uri||!this.ready;return x$5`<wui-link
.disabled=${Fn}
@click=${this.onCopyUri}
color="fg-200"
data-testid="copy-wc2-uri"
>
<wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
Copy link
</wui-link>`}onCopyUri(){try{this.uri&&(CoreHelperUtil.copyToClopboard(this.uri),SnackController.showSuccess("Link copied"))}catch{SnackController.showError("Failed to copy")}}};W3mConnectingFarcasterView.styles=styles$u;__decorate$P([r$4()],W3mConnectingFarcasterView.prototype,"socialProvider",void 0);__decorate$P([r$4()],W3mConnectingFarcasterView.prototype,"uri",void 0);__decorate$P([r$4()],W3mConnectingFarcasterView.prototype,"ready",void 0);__decorate$P([r$4()],W3mConnectingFarcasterView.prototype,"loading",void 0);W3mConnectingFarcasterView=__decorate$P([customElement("w3m-connecting-farcaster-view")],W3mConnectingFarcasterView);const styles$t=i$6`
wui-grid {
max-height: clamp(360px, 400px, 80vh);
overflow: scroll;
scrollbar-width: none;
grid-auto-rows: min-content;
grid-template-columns: repeat(auto-fill, 76px);
}
@media (max-width: 435px) {
wui-grid {
grid-template-columns: repeat(auto-fill, 77px);
}
}
wui-grid[data-scroll='false'] {
overflow: hidden;
}
wui-grid::-webkit-scrollbar {
display: none;
}
wui-loading-spinner {
padding-top: var(--wui-spacing-l);
padding-bottom: var(--wui-spacing-l);
justify-content: center;
grid-column: 1 / span 4;
}
`;function markWalletsAsInstalled(Mn){const{connectors:Fn}=ConnectorController.state,io=Fn.filter(mo=>mo.type==="ANNOUNCED").reduce((mo,Ao)=>{var jo;return(jo=Ao.info)!=null&&jo.rdns&&(mo[Ao.info.rdns]=!0),mo},{});return Mn.map(mo=>({...mo,installed:!!mo.rdns&&!!io[mo.rdns??""]})).sort((mo,Ao)=>Number(Ao.installed)-Number(mo.installed))}var __decorate$O=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};const PAGINATOR_ID$1="local-paginator";let W3mAllWalletsList=class extends r$6{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.initial=!ApiController.state.wallets.length,this.wallets=ApiController.state.wallets,this.recommended=ApiController.state.recommended,this.featured=ApiController.state.featured,this.unsubscribe.push(ApiController.subscribeKey("wallets",Fn=>this.wallets=Fn),ApiController.subscribeKey("recommended",Fn=>this.recommended=Fn),ApiController.subscribeKey("featured",Fn=>this.featured=Fn))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var Fn;this.unsubscribe.forEach(io=>io()),(Fn=this.paginationObserver)==null||Fn.disconnect()}render(){return x$5`
<wui-grid
data-scroll=${!this.initial}
.padding=${["0","s","s","s"]}
columnGap="xxs"
rowGap="l"
justifyContent="space-between"
>
${this.initial?this.shimmerTemplate(16):this.walletsTemplate()}
${this.paginationLoaderTemplate()}
</wui-grid>
`}async initialFetch(){var io;const Fn=(io=this.shadowRoot)==null?void 0:io.querySelector("wui-grid");this.initial&&Fn&&(await ApiController.fetchWallets({page:1}),await Fn.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.initial=!1,Fn.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(Fn,io){return[...Array(Fn)].map(()=>x$5`
<wui-card-select-loader type="wallet" id=${o$4(io)}></wui-card-select-loader>
`)}walletsTemplate(){const Fn=[...this.featured,...this.recommended,...this.wallets];return markWalletsAsInstalled(Fn).map(fo=>x$5`
<w3m-all-wallets-list-item
@click=${()=>this.onConnectWallet(fo)}
.wallet=${fo}
></w3m-all-wallets-list-item>
`)}paginationLoaderTemplate(){const{wallets:Fn,recommended:io,featured:fo,count:$o}=ApiController.state,mo=window.innerWidth<352?3:4,Ao=Fn.length+io.length;let Lo=Math.ceil(Ao/mo)*mo-Ao+mo;return Lo-=Fn.length?fo.length%mo:0,$o===0&&fo.length>0?null:$o===0||[...fo,...Fn,...io].length<$o?this.shimmerTemplate(Lo,PAGINATOR_ID$1):null}createPaginationObserver(){var io;const Fn=(io=this.shadowRoot)==null?void 0:io.querySelector(`#${PAGINATOR_ID$1}`);Fn&&(this.paginationObserver=new IntersectionObserver(([fo])=>{if(fo!=null&&fo.isIntersecting&&!this.initial){const{page:$o,count:mo,wallets:Ao}=ApiController.state;Ao.length<mo&&ApiController.fetchWallets({page:$o+1})}}),this.paginationObserver.observe(Fn))}onConnectWallet(Fn){const io=ConnectorController.getConnector(Fn.id,Fn.rdns);io?RouterController.push("ConnectingExternal",{connector:io}):RouterController.push("ConnectingWalletConnect",{wallet:Fn})}};W3mAllWalletsList.styles=styles$t;__decorate$O([r$4()],W3mAllWalletsList.prototype,"initial",void 0);__decorate$O([r$4()],W3mAllWalletsList.prototype,"wallets",void 0);__decorate$O([r$4()],W3mAllWalletsList.prototype,"recommended",void 0);__decorate$O([r$4()],W3mAllWalletsList.prototype,"featured",void 0);W3mAllWalletsList=__decorate$O([customElement("w3m-all-wallets-list")],W3mAllWalletsList);const styles$s=i$6`
button {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 76px;
row-gap: var(--wui-spacing-xs);
padding: var(--wui-spacing-xs) var(--wui-spacing-0);
background-color: var(--wui-color-gray-glass-002);
border-radius: clamp(0px, var(--wui-border-radius-xs), 20px);
will-change: background-color, color;
outline: none;
border: none;
}
button > wui-text {
color: var(--wui-color-fg-100);
max-width: var(--wui-icon-box-size-xl);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
justify-content: center;
}
button:hover:enabled {
background-color: var(--wui-color-gray-glass-005);
}
button:disabled > wui-text {
color: var(--wui-color-gray-glass-015);
}
[data-selected='true'] {
background-color: var(--wui-color-accent-glass-020);
}
@media (hover: hover) and (pointer: fine) {
[data-selected='true']:hover:enabled {
background-color: var(--wui-color-accent-glass-015);
}
}
[data-selected='true']:active:enabled {
background-color: var(--wui-color-accent-glass-010);
}
`;var __decorate$N=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mAllWalletsListItem=class extends r$6{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(Fn=>{Fn.forEach(io=>{io.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var Fn;return x$5`
<button ontouchstart>
${this.imageTemplate()}
<wui-text variant="tiny-500" color="inherit">${(Fn=this.wallet)==null?void 0:Fn.name}</wui-text>
</button>
`}imageTemplate(){var Fn,io;return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():x$5`
<wui-wallet-image
size="md"
imageSrc=${o$4(this.imageSrc)}
name=${(Fn=this.wallet)==null?void 0:Fn.name}
.installed=${(io=this.wallet)==null?void 0:io.installed}
badgeSize="sm"
>
</wui-wallet-image>
`}shimmerTemplate(){return x$5`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=AssetUtil.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await AssetUtil.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};W3mAllWalletsListItem.styles=styles$s;__decorate$N([r$4()],W3mAllWalletsListItem.prototype,"visible",void 0);__decorate$N([r$4()],W3mAllWalletsListItem.prototype,"imageSrc",void 0);__decorate$N([r$4()],W3mAllWalletsListItem.prototype,"imageLoading",void 0);__decorate$N([n$7()],W3mAllWalletsListItem.prototype,"wallet",void 0);W3mAllWalletsListItem=__decorate$N([customElement("w3m-all-wallets-list-item")],W3mAllWalletsListItem);const styles$r=i$6`
wui-grid,
wui-loading-spinner,
wui-flex {
height: 360px;
}
wui-grid {
overflow: scroll;
scrollbar-width: none;
grid-auto-rows: min-content;
}
wui-grid[data-scroll='false'] {
overflow: hidden;
}
wui-grid::-webkit-scrollbar {
display: none;
}
wui-loading-spinner {
justify-content: center;
align-items: center;
}
`;var __decorate$M=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mAllWalletsSearch=class extends r$6{constructor(){super(...arguments),this.prevQuery="",this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?x$5`<wui-loading-spinner color="accent-100"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){this.query.trim()!==this.prevQuery.trim()&&(this.prevQuery=this.query,this.loading=!0,await ApiController.searchWallet({search:this.query}),this.loading=!1)}walletsTemplate(){const{search:Fn}=ApiController.state,io=markWalletsAsInstalled(Fn);return Fn.length?x$5`
<wui-grid
.padding=${["0","s","s","s"]}
gridTemplateColumns="repeat(4, 1fr)"
rowGap="l"
columnGap="xs"
>
${io.map(fo=>x$5`
<w3m-all-wallets-list-item
@click=${()=>this.onConnectWallet(fo)}
.wallet=${fo}
></w3m-all-wallets-list-item>
`)}
</wui-grid>
`:x$5`
<wui-flex justifyContent="center" alignItems="center" gap="s" flexDirection="column">
<wui-icon-box
size="lg"
iconColor="fg-200"
backgroundColor="fg-300"
icon="wallet"
background="transparent"
></wui-icon-box>
<wui-text color="fg-200" variant="paragraph-500">No Wallet found</wui-text>
</wui-flex>
`}onConnectWallet(Fn){const io=ConnectorController.getConnector(Fn.id,Fn.rdns);io?RouterController.push("ConnectingExternal",{connector:io}):RouterController.push("ConnectingWalletConnect",{wallet:Fn})}};W3mAllWalletsSearch.styles=styles$r;__decorate$M([r$4()],W3mAllWalletsSearch.prototype,"loading",void 0);__decorate$M([n$7()],W3mAllWalletsSearch.prototype,"query",void 0);W3mAllWalletsSearch=__decorate$M([customElement("w3m-all-wallets-search")],W3mAllWalletsSearch);var __decorate$L=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectingHeader=class extends r$6{constructor(){super(),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0,this.buffering=!1,this.unsubscribe.push(ConnectionController.subscribeKey("buffering",Fn=>this.buffering=Fn))}disconnectCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){const Fn=this.generateTabs();return x$5`
<wui-flex justifyContent="center" .padding=${["0","0","l","0"]}>
<wui-tabs
?disabled=${this.buffering}
.tabs=${Fn}
.onTabChange=${this.onTabChange.bind(this)}
></wui-tabs>
</wui-flex>
`}generateTabs(){const Fn=this.platforms.map(io=>io==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:io==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:io==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:io==="web"?{label:"Webapp",icon:"browser",platform:"web"}:io==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=Fn.map(({platform:io})=>io),Fn}onTabChange(Fn){var fo;const io=this.platformTabs[Fn];io&&((fo=this.onSelectPlatfrom)==null||fo.call(this,io))}};__decorate$L([n$7({type:Array})],W3mConnectingHeader.prototype,"platforms",void 0);__decorate$L([n$7()],W3mConnectingHeader.prototype,"onSelectPlatfrom",void 0);__decorate$L([r$4()],W3mConnectingHeader.prototype,"buffering",void 0);W3mConnectingHeader=__decorate$L([customElement("w3m-connecting-header")],W3mConnectingHeader);var __decorate$K=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectingWcBrowser=class extends W3mConnectingWidget{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){var Fn;try{this.error=!1;const{connectors:io}=ConnectorController.state,fo=io.find($o=>{var mo,Ao,jo;return $o.type==="ANNOUNCED"&&((mo=$o.info)==null?void 0:mo.rdns)===((Ao=this.wallet)==null?void 0:Ao.rdns)||$o.type==="INJECTED"||$o.name===((jo=this.wallet)==null?void 0:jo.name)});if(fo)await ConnectionController.connectExternal(fo,fo.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");ModalController.close(),EventsController.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((Fn=this.wallet)==null?void 0:Fn.name)||"Unknown"}})}catch(io){EventsController.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(io==null?void 0:io.message)??"Unknown"}}),this.error=!0}}};W3mConnectingWcBrowser=__decorate$K([customElement("w3m-connecting-wc-browser")],W3mConnectingWcBrowser);var __decorate$J=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectingWcDesktop=class extends W3mConnectingWidget{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){var Fn;!this.ready&&this.uri&&(this.ready=!0,(Fn=this.onConnect)==null||Fn.call(this))}onConnectProxy(){var Fn;if((Fn=this.wallet)!=null&&Fn.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:io,name:fo}=this.wallet,{redirect:$o,href:mo}=CoreHelperUtil.formatNativeUrl(io,this.uri);ConnectionController.setWcLinking({name:fo,href:mo}),ConnectionController.setRecentWallet(this.wallet),CoreHelperUtil.openHref($o,"_blank")}catch{this.error=!0}}};W3mConnectingWcDesktop=__decorate$J([customElement("w3m-connecting-wc-desktop")],W3mConnectingWcDesktop);var __decorate$I=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectingWcMobile=class extends W3mConnectingWidget{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),document.addEventListener("visibilitychange",this.onBuffering.bind(this)),EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("visibilitychange",this.onBuffering.bind(this))}onRenderProxy(){var Fn;!this.ready&&this.uri&&(this.ready=!0,(Fn=this.onConnect)==null||Fn.call(this))}onConnectProxy(){var Fn;if((Fn=this.wallet)!=null&&Fn.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:io,name:fo}=this.wallet,{redirect:$o,href:mo}=CoreHelperUtil.formatNativeUrl(io,this.uri);ConnectionController.setWcLinking({name:fo,href:mo}),ConnectionController.setRecentWallet(this.wallet),CoreHelperUtil.openHref($o,"_self")}catch{this.error=!0}}onBuffering(){const Fn=CoreHelperUtil.isIos();(document==null?void 0:document.visibilityState)==="visible"&&!this.error&&Fn&&(ConnectionController.setBuffering(!0),setTimeout(()=>{ConnectionController.setBuffering(!1)},5e3))}};W3mConnectingWcMobile=__decorate$I([customElement("w3m-connecting-wc-mobile")],W3mConnectingWcMobile);const styles$q=i$6`
@keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
wui-shimmer {
width: 100%;
aspect-ratio: 1 / 1;
border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
}
wui-qr-code {
opacity: 0;
animation-duration: 200ms;
animation-timing-function: ease;
animation-name: fadein;
animation-fill-mode: forwards;
}
`;var __decorate$H=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectingWcQrcode=class extends W3mConnectingWidget{constructor(){var Fn;super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((Fn=this.wallet)==null?void 0:Fn.name)??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),x$5`
<wui-flex
flexDirection="column"
alignItems="center"
.padding=${["0","xl","xl","xl"]}
gap="xl"
>
<wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
<wui-text variant="paragraph-500" color="fg-100">
Scan this QR Code with your phone
</wui-text>
${this.copyTemplate()}
</wui-flex>
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},0))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const Fn=this.getBoundingClientRect().width-40,io=this.wallet?this.wallet.name:void 0;return ConnectionController.setWcLinking(void 0),ConnectionController.setRecentWallet(this.wallet),x$5` <wui-qr-code
size=${Fn}
theme=${ThemeController.state.themeMode}
uri=${this.uri}
imageSrc=${o$4(AssetUtil.getWalletImage(this.wallet))}
alt=${o$4(io)}
data-testid="wui-qr-code"
></wui-qr-code>`}copyTemplate(){const Fn=!this.uri||!this.ready;return x$5`<wui-link
.disabled=${Fn}
@click=${this.onCopyUri}
color="fg-200"
data-testid="copy-wc2-uri"
>
<wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
Copy link
</wui-link>`}};W3mConnectingWcQrcode.styles=styles$q;W3mConnectingWcQrcode=__decorate$H([customElement("w3m-connecting-wc-qrcode")],W3mConnectingWcQrcode);var __decorate$G=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectingWcUnsupported=class extends r$6{constructor(){var Fn;if(super(),this.wallet=(Fn=RouterController.state.data)==null?void 0:Fn.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return x$5`
<wui-flex
flexDirection="column"
alignItems="center"
.padding=${["3xl","xl","xl","xl"]}
gap="xl"
>
<wui-wallet-image
size="lg"
imageSrc=${o$4(AssetUtil.getWalletImage(this.wallet))}
></wui-wallet-image>
<wui-text variant="paragraph-500" color="fg-100">Not Detected</wui-text>
</wui-flex>
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
`}};W3mConnectingWcUnsupported=__decorate$G([customElement("w3m-connecting-wc-unsupported")],W3mConnectingWcUnsupported);var __decorate$F=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectingWcWeb=class extends W3mConnectingWidget{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel="Open and continue in a new browser tab",this.secondaryBtnIcon="externalLink",EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}onConnectProxy(){var Fn;if((Fn=this.wallet)!=null&&Fn.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:io,name:fo}=this.wallet,{redirect:$o,href:mo}=CoreHelperUtil.formatUniversalUrl(io,this.uri);ConnectionController.setWcLinking({name:fo,href:mo}),ConnectionController.setRecentWallet(this.wallet),CoreHelperUtil.openHref($o,"_blank")}catch{this.error=!0}}};W3mConnectingWcWeb=__decorate$F([customElement("w3m-connecting-wc-web")],W3mConnectingWcWeb);const styles$p=i$6`
:host {
width: 100%;
}
.details-container > wui-flex {
background: var(--wui-color-gray-glass-002);
border-radius: var(--wui-border-radius-xxs);
width: 100%;
}
.details-container > wui-flex > button {
border: none;
background: none;
padding: var(--wui-spacing-s);
border-radius: var(--wui-border-radius-xxs);
cursor: pointer;
}
.details-content-container {
padding: var(--wui-spacing-1xs);
padding-top: 0px;
display: flex;
align-items: center;
justify-content: center;
}
.details-content-container > wui-flex {
width: 100%;
}
.details-row {
width: 100%;
padding: var(--wui-spacing-s);
padding-left: var(--wui-spacing-s);
padding-right: var(--wui-spacing-1xs);
border-radius: calc(var(--wui-border-radius-5xs) + var(--wui-border-radius-4xs));
background: var(--wui-color-gray-glass-002);
}
.details-row-title {
white-space: nowrap;
}
.details-row.provider-free-row {
padding-right: var(--wui-spacing-xs);
}
`;var __decorate$E=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};const slippageRate=ConstantsUtil$1.CONVERT_SLIPPAGE_TOLERANCE;let WuiSwapDetails=class extends r$6{constructor(){var Fn;super(),this.unsubscribe=[],this.networkName=(Fn=NetworkController.state.caipNetwork)==null?void 0:Fn.name,this.detailsOpen=!1,this.sourceToken=SwapController.state.sourceToken,this.toToken=SwapController.state.toToken,this.toTokenAmount=SwapController.state.toTokenAmount,this.sourceTokenPriceInUSD=SwapController.state.sourceTokenPriceInUSD,this.toTokenPriceInUSD=SwapController.state.toTokenPriceInUSD,this.gasPriceInUSD=SwapController.state.gasPriceInUSD,this.priceImpact=SwapController.state.priceImpact,this.maxSlippage=SwapController.state.maxSlippage,this.networkTokenSymbol=SwapController.state.networkTokenSymbol,this.inputError=SwapController.state.inputError,this.unsubscribe.push(SwapController.subscribe(io=>{this.sourceToken=io.sourceToken,this.toToken=io.toToken,this.toTokenAmount=io.toTokenAmount,this.gasPriceInUSD=io.gasPriceInUSD,this.priceImpact=io.priceImpact,this.maxSlippage=io.maxSlippage,this.sourceTokenPriceInUSD=io.sourceTokenPriceInUSD,this.toTokenPriceInUSD=io.toTokenPriceInUSD,this.inputError=io.inputError}))}render(){const Fn=this.toTokenAmount&&this.maxSlippage?NumberUtil.bigNumber(this.toTokenAmount).minus(this.maxSlippage).toString():null;if(!this.sourceToken||!this.toToken||this.inputError)return null;const io=this.sourceTokenPriceInUSD&&this.toTokenPriceInUSD?1/this.toTokenPriceInUSD*this.sourceTokenPriceInUSD:0;return x$5`
<wui-flex flexDirection="column" alignItems="center" gap="1xs" class="details-container">
<wui-flex flexDirection="column">
<button @click=${this.toggleDetails.bind(this)}>
<wui-flex justifyContent="space-between" .padding=${["0","xs","0","xs"]}>
<wui-flex justifyContent="flex-start" flexGrow="1" gap="xs">
<wui-text variant="small-400" color="fg-100">
1 ${this.sourceToken.symbol} =
${UiHelperUtil.formatNumberToLocalString(io,3)}
${this.toToken.symbol}
</wui-text>
<wui-text variant="small-400" color="fg-200">
$${UiHelperUtil.formatNumberToLocalString(this.sourceTokenPriceInUSD)}
</wui-text>
</wui-flex>
<wui-icon name="chevronBottom"></wui-icon>
</wui-flex>
</button>
${this.detailsOpen?x$5`
<wui-flex flexDirection="column" gap="xs" class="details-content-container">
<wui-flex flexDirection="column" gap="xs">
<wui-flex
justifyContent="space-between"
alignItems="center"
class="details-row"
>
<wui-flex alignItems="center" gap="xs">
<wui-text class="details-row-title" variant="small-400" color="fg-150">
Network cost
</wui-text>
<w3m-tooltip-trigger
text=${`Network cost is paid in ${this.networkTokenSymbol} on the ${this.networkName} network in order to execute transaction.`}
>
<wui-icon size="xs" color="fg-250" name="infoCircle"></wui-icon>
</w3m-tooltip-trigger>
</wui-flex>
<wui-text variant="small-400" color="fg-100">
$${UiHelperUtil.formatNumberToLocalString(this.gasPriceInUSD,3)}
</wui-text>
</wui-flex>
</wui-flex>
${this.priceImpact?x$5` <wui-flex flexDirection="column" gap="xs">
<wui-flex
justifyContent="space-between"
alignItems="center"
class="details-row"
>
<wui-flex alignItems="center" gap="xs">
<wui-text class="details-row-title" variant="small-400" color="fg-150">
Price impact
</wui-text>
<w3m-tooltip-trigger
text="Price impact reflects the change in market price due to your trade"
>
<wui-icon size="xs" color="fg-250" name="infoCircle"></wui-icon>
</w3m-tooltip-trigger>
</wui-flex>
<wui-flex>
<wui-text variant="small-400" color="fg-200">
${UiHelperUtil.formatNumberToLocalString(this.priceImpact,3)}%
</wui-text>
</wui-flex>
</wui-flex>
</wui-flex>`:null}
${this.maxSlippage&&this.sourceToken.symbol?x$5`<wui-flex flexDirection="column" gap="xs">
<wui-flex
justifyContent="space-between"
alignItems="center"
class="details-row"
>
<wui-flex alignItems="center" gap="xs">
<wui-text class="details-row-title" variant="small-400" color="fg-150">
Max. slippage
</wui-text>
<w3m-tooltip-trigger
text=${`Max slippage sets the minimum amount you must receive for the transaction to proceed. ${Fn?`Transaction will be reversed if you receive less than ${UiHelperUtil.formatNumberToLocalString(Fn,6)} ${this.toToken.symbol} due to price changes.`:""}`}
>
<wui-icon size="xs" color="fg-250" name="infoCircle"></wui-icon>
</w3m-tooltip-trigger>
</wui-flex>
<wui-flex>
<wui-text variant="small-400" color="fg-200">
${UiHelperUtil.formatNumberToLocalString(this.maxSlippage,6)}
${this.toToken.symbol} ${slippageRate}%
</wui-text>
</wui-flex>
</wui-flex>
</wui-flex>`:null}
<wui-flex flexDirection="column" gap="xs">
<wui-flex
justifyContent="space-between"
alignItems="center"
class="details-row provider-free-row"
>
<wui-flex alignItems="center" gap="xs">
<wui-text class="details-row-title" variant="small-400" color="fg-150">
Provider fee
</wui-text>
</wui-flex>
<wui-flex>
<wui-text variant="small-400" color="fg-200">0.85%</wui-text>
</wui-flex>
</wui-flex>
</wui-flex>
</wui-flex>
`:null}
</wui-flex>
</wui-flex>
`}toggleDetails(){this.detailsOpen=!this.detailsOpen}};WuiSwapDetails.styles=[styles$p];__decorate$E([r$4()],WuiSwapDetails.prototype,"networkName",void 0);__decorate$E([n$7()],WuiSwapDetails.prototype,"detailsOpen",void 0);__decorate$E([r$4()],WuiSwapDetails.prototype,"sourceToken",void 0);__decorate$E([r$4()],WuiSwapDetails.prototype,"toToken",void 0);__decorate$E([r$4()],WuiSwapDetails.prototype,"toTokenAmount",void 0);__decorate$E([r$4()],WuiSwapDetails.prototype,"sourceTokenPriceInUSD",void 0);__decorate$E([r$4()],WuiSwapDetails.prototype,"toTokenPriceInUSD",void 0);__decorate$E([r$4()],WuiSwapDetails.prototype,"gasPriceInUSD",void 0);__decorate$E([r$4()],WuiSwapDetails.prototype,"priceImpact",void 0);__decorate$E([r$4()],WuiSwapDetails.prototype,"maxSlippage",void 0);__decorate$E([r$4()],WuiSwapDetails.prototype,"networkTokenSymbol",void 0);__decorate$E([r$4()],WuiSwapDetails.prototype,"inputError",void 0);WuiSwapDetails=__decorate$E([customElement("w3m-swap-details")],WuiSwapDetails);const styles$o=i$6`
:host > wui-flex {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
border-radius: var(--wui-border-radius-s);
background-color: var(--wui-color-gray-glass-002);
padding: var(--wui-spacing-xl);
padding-right: var(--wui-spacing-s);
width: 100%;
height: 100px;
box-sizing: border-box;
box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002);
position: relative;
transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-lg);
will-change: background-color;
}
:host wui-flex.focus {
box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-005);
}
:host > wui-flex .swap-input,
:host > wui-flex .swap-token-button {
z-index: 10;
}
:host > wui-flex .swap-input {
-webkit-mask-image: linear-gradient(
270deg,
transparent 0px,
transparent 8px,
black 24px,
black 25px,
black 32px,
black 100%
);
mask-image: linear-gradient(
270deg,
transparent 0px,
transparent 8px,
black 24px,
black 25px,
black 32px,
black 100%
);
}
:host > wui-flex .swap-input input {
background: none;
border: none;
height: 42px;
width: 100%;
font-size: 32px;
font-style: normal;
font-weight: 400;
line-height: 130%;
letter-spacing: -1.28px;
outline: none;
caret-color: var(--wui-color-accent-100);
color: var(--wui-color-fg-100);
padding: 0px;
}
:host > wui-flex .swap-input input:focus-visible {
outline: none;
}
:host > wui-flex .swap-input input::-webkit-outer-spin-button,
:host > wui-flex .swap-input input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.max-value-button {
background-color: transparent;
border: none;
cursor: pointer;
color: var(--wui-color-gray-glass-020);
padding-left: 0px;
}
.market-value {
min-height: 18px;
}
`;var __decorate$D=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};const MINIMUM_USD_VALUE_TO_CONVERT=5e-5;let W3mSwapInput=class extends r$6{constructor(){super(...arguments),this.focused=!1,this.price=0,this.target="sourceToken",this.onSetAmount=null,this.onSetMaxValue=null}render(){const Fn=this.marketValue||"0",io=NumberUtil.bigNumber(Fn).isGreaterThan("0");return x$5`
<wui-flex class="${this.focused?"focus":""}" justifyContent="space-between">
<wui-flex
flex="1"
flexDirection="column"
alignItems="flex-start"
justifyContent="center"
class="swap-input"
>
<input
data-testid="swap-input-${this.target}"
@focusin=${()=>this.onFocusChange(!0)}
@focusout=${()=>this.onFocusChange(!1)}
?disabled=${this.disabled}
.value=${this.value}
@input=${this.dispatchInputChangeEvent}
@keydown=${this.handleKeydown}
placeholder="0"
type="text"
inputmode="decimal"
/>
<wui-text class="market-value" variant="small-400" color="fg-200">
${io?`$${UiHelperUtil.formatNumberToLocalString(this.marketValue,3)}`:null}
</wui-text>
</wui-flex>
${this.templateTokenSelectButton()}
</wui-flex>
`}handleKeydown(Fn){return InputUtil.numericInputKeyDown(Fn,this.value,io=>{var fo;return(fo=this.onSetAmount)==null?void 0:fo.call(this,this.target,io)})}dispatchInputChangeEvent(Fn){if(!this.onSetAmount)return;const io=Fn.target.value.replace(/[^0-9.]/gu,"");io===","||io==="."?this.onSetAmount(this.target,"0."):io.endsWith(",")?this.onSetAmount(this.target,io.replace(",",".")):this.onSetAmount(this.target,io)}setMaxValueToInput(){var Fn;(Fn=this.onSetMaxValue)==null||Fn.call(this,this.target,this.balance)}templateTokenSelectButton(){return this.token?x$5`
<wui-flex
class="swap-token-button"
flexDirection="column"
alignItems="flex-end"
justifyContent="center"
gap="xxs"
>
<wui-token-button
data-testid="swap-input-token-${this.target}"
text=${this.token.symbol}
imageSrc=${this.token.logoUri}
@click=${this.onSelectToken.bind(this)}
>
</wui-token-button>
<wui-flex alignItems="center" gap="xxs"> ${this.tokenBalanceTemplate()} </wui-flex>
</wui-flex>
`:x$5` <wui-button
data-testid="swap-select-token-button-${this.target}"
class="swap-token-button"
size="md"
variant="accent"
@click=${this.onSelectToken.bind(this)}
>
Select token
</wui-button>`}tokenBalanceTemplate(){const Fn=NumberUtil.multiply(this.balance,this.price),io=Fn?Fn==null?void 0:Fn.isGreaterThan(MINIMUM_USD_VALUE_TO_CONVERT):!1;return x$5`
${io?x$5`<wui-text variant="small-400" color="fg-200">
${UiHelperUtil.formatNumberToLocalString(this.balance,3)}
</wui-text>`:null}
${this.target==="sourceToken"?this.tokenActionButtonTemplate(io):null}
`}tokenActionButtonTemplate(Fn){return Fn?x$5` <button class="max-value-button" @click=${this.setMaxValueToInput.bind(this)}>
<wui-text color="accent-100" variant="small-600">Max</wui-text>
</button>`:x$5` <button class="max-value-button" @click=${this.onBuyToken.bind(this)}>
<wui-text color="accent-100" variant="small-600">Buy</wui-text>
</button>`}onFocusChange(Fn){this.focused=Fn}onSelectToken(){EventsController.sendEvent({type:"track",event:"CLICK_SELECT_TOKEN_TO_SWAP"}),RouterController.push("SwapSelectToken",{target:this.target})}onBuyToken(){RouterController.push("OnRampProviders")}};W3mSwapInput.styles=[styles$o];__decorate$D([n$7()],W3mSwapInput.prototype,"focused",void 0);__decorate$D([n$7()],W3mSwapInput.prototype,"balance",void 0);__decorate$D([n$7()],W3mSwapInput.prototype,"value",void 0);__decorate$D([n$7()],W3mSwapInput.prototype,"price",void 0);__decorate$D([n$7()],W3mSwapInput.prototype,"marketValue",void 0);__decorate$D([n$7()],W3mSwapInput.prototype,"disabled",void 0);__decorate$D([n$7()],W3mSwapInput.prototype,"target",void 0);__decorate$D([n$7()],W3mSwapInput.prototype,"token",void 0);__decorate$D([n$7()],W3mSwapInput.prototype,"onSetAmount",void 0);__decorate$D([n$7()],W3mSwapInput.prototype,"onSetMaxValue",void 0);W3mSwapInput=__decorate$D([customElement("w3m-swap-input")],W3mSwapInput);const styles$n=i$6`
:host {
width: 100%;
}
:host > wui-flex {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
border-radius: var(--wui-border-radius-s);
padding: var(--wui-spacing-xl);
padding-right: var(--wui-spacing-s);
background-color: var(--wui-color-gray-glass-002);
box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002);
width: 100%;
height: 100px;
box-sizing: border-box;
position: relative;
}
wui-shimmer.market-value {
opacity: 0;
}
:host > wui-flex > svg.input_mask {
position: absolute;
inset: 0;
z-index: 5;
}
:host wui-flex .input_mask__border,
:host wui-flex .input_mask__background {
transition: fill var(--wui-duration-md) var(--wui-ease-out-power-1);
will-change: fill;
}
:host wui-flex .input_mask__border {
fill: var(--wui-color-gray-glass-020);
}
:host wui-flex .input_mask__background {
fill: var(--wui-color-gray-glass-002);
}
`;var __decorate$C=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mSwapInputSkeleton=class extends r$6{constructor(){super(...arguments),this.target="sourceToken"}render(){return x$5`
<wui-flex class justifyContent="space-between">
<wui-flex
flex="1"
flexDirection="column"
alignItems="flex-start"
justifyContent="center"
class="swap-input"
gap="xxs"
>
<wui-shimmer width="80px" height="40px" borderRadius="xxs" variant="light"></wui-shimmer>
</wui-flex>
${this.templateTokenSelectButton()}
</wui-flex>
`}templateTokenSelectButton(){return x$5`
<wui-flex
class="swap-token-button"
flexDirection="column"
alignItems="flex-end"
justifyContent="center"
gap="xxs"
>
<wui-shimmer width="80px" height="40px" borderRadius="3xl" variant="light"></wui-shimmer>
</wui-flex>
`}};W3mSwapInputSkeleton.styles=[styles$n];__decorate$C([n$7()],W3mSwapInputSkeleton.prototype,"target",void 0);W3mSwapInputSkeleton=__decorate$C([customElement("w3m-swap-input-skeleton")],W3mSwapInputSkeleton);const styles$m=i$6`
:host {
height: 64px;
}
wui-text {
text-transform: capitalize;
}
wui-flex.w3m-header-title {
transform: translateY(0);
opacity: 1;
}
wui-flex.w3m-header-title[view-direction='prev'] {
animation:
slide-down-out 120ms forwards var(--wui-ease-out-power-2),
slide-down-in 120ms forwards var(--wui-ease-out-power-2);
animation-delay: 0ms, 200ms;
}
wui-flex.w3m-header-title[view-direction='next'] {
animation:
slide-up-out 120ms forwards var(--wui-ease-out-power-2),
slide-up-in 120ms forwards var(--wui-ease-out-power-2);
animation-delay: 0ms, 200ms;
}
wui-icon-link[data-hidden='true'] {
opacity: 0 !important;
pointer-events: none;
}
@keyframes slide-up-out {
from {
transform: translateY(0px);
opacity: 1;
}
to {
transform: translateY(3px);
opacity: 0;
}
}
@keyframes slide-up-in {
from {
transform: translateY(-3px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes slide-down-out {
from {
transform: translateY(0px);
opacity: 1;
}
to {
transform: translateY(-3px);
opacity: 0;
}
}
@keyframes slide-down-in {
from {
transform: translateY(3px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
`;var __decorate$B=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};const BETA_SCREENS=["Swap","SwapSelectToken","SwapPreview"];function headings(){var Ao,jo,Lo,Ho,zo,Go,Vo;const Mn=(jo=(Ao=RouterController.state.data)==null?void 0:Ao.connector)==null?void 0:jo.name,Fn=(Ho=(Lo=RouterController.state.data)==null?void 0:Lo.wallet)==null?void 0:Ho.name,io=(Go=(zo=RouterController.state.data)==null?void 0:zo.network)==null?void 0:Go.name,fo=Fn??Mn,$o=ConnectorController.getConnectors();return{Connect:`Connect ${$o.length===1&&((Vo=$o[0])==null?void 0:Vo.id)==="w3m-email"?"Email":""} Wallet`,ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExternal:fo??"Connect Wallet",ConnectingWalletConnect:fo??"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview convert",Downloads:fo?`Get ${fo}`:"Downloads",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Profile:void 0,SelectAddresses:"Select accounts",SwitchNetwork:io??"Switch Network",SwitchAddress:"Switch Address",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade your Wallet",UpgradeToSmartAccount:void 0,UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select token",SwapPreview:"Preview swap",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",ConnectWallets:"Connect wallet",ConnectSocials:"All socials",ConnectingSocial:AccountController.state.socialProvider?AccountController.state.socialProvider:"Connect Social",ConnectingMultiChain:"Select chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch chain"}}let W3mHeader=class extends r$6{constructor(){super(),this.unsubscribe=[],this.heading=headings()[RouterController.state.view],this.network=NetworkController.state.caipNetwork,this.buffering=!1,this.showBack=!1,this.isSiweEnabled=OptionsController.state.isSiweEnabled,this.prevHistoryLength=1,this.view=RouterController.state.view,this.viewDirection="",this.headerText=headings()[RouterController.state.view],this.unsubscribe.push(RouterController.subscribeKey("view",Fn=>{setTimeout(()=>{this.view=Fn,this.headerText=headings()[Fn]},ConstantsUtil.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),ConnectionController.subscribeKey("buffering",Fn=>this.buffering=Fn),NetworkController.subscribeKey("caipNetwork",Fn=>this.network=Fn))}disconnectCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){return x$5`
<wui-flex .padding=${this.getPadding()} justifyContent="space-between" alignItems="center">
${this.dynamicButtonTemplate()} ${this.titleTemplate()} ${this.closeButtonTemplate()}
</wui-flex>
`}onWalletHelp(){EventsController.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),RouterController.push("WhatIsAWallet")}async onClose(){if(this.isSiweEnabled){const{SIWEController:Fn}=await __vitePreload(async()=>{const{SIWEController:$o}=await import("./index-DA6tPBIL.js");return{SIWEController:$o}},[]),io=RouterController.state.view==="ApproveTransaction";Fn.state.status!=="success"&&io?RouterController.popTransactionStack(!0):ModalController.close()}else ModalController.close()}closeButtonTemplate(){const Fn=RouterController.state.view==="ConnectingSiwe";return this.isSiweEnabled&&Fn?x$5`<div style="width:40px" />`:x$5`
<wui-icon-link
?disabled=${this.buffering}
icon="close"
@click=${this.onClose.bind(this)}
data-testid="w3m-header-close"
></wui-icon-link>
`}titleTemplate(){const Fn=BETA_SCREENS.includes(this.view);return x$5`
<wui-flex
view-direction="${this.viewDirection}"
class="w3m-header-title"
alignItems="center"
gap="xs"
>
<wui-text variant="paragraph-700" color="fg-100">${this.headerText}</wui-text>
${Fn?x$5`<wui-tag variant="main">Beta</wui-tag>`:null}
</wui-flex>
`}dynamicButtonTemplate(){var Lo;const{view:Fn}=RouterController.state,io=Fn==="Connect",fo=Fn==="ApproveTransaction",$o=Fn==="UpgradeToSmartAccount",mo=Fn==="ConnectingSiwe",Ao=Fn==="Account",jo=fo||$o||mo;return Ao?x$5`<wui-select
id="dynamic"
data-testid="w3m-account-select-network"
active-network=${(Lo=this.network)==null?void 0:Lo.name}
@click=${this.onNetworks.bind(this)}
imageSrc=${o$4(AssetUtil.getNetworkImage(this.network))}
></wui-select>`:this.showBack&&!jo?x$5`<wui-icon-link
id="dynamic"
icon="chevronLeft"
?disabled=${this.buffering}
@click=${this.onGoBack.bind(this)}
></wui-icon-link>`:x$5`<wui-icon-link
data-hidden=${!io}
id="dynamic"
icon="helpCircle"
@click=${this.onWalletHelp.bind(this)}
></wui-icon-link>`}onNetworks(){this.isAllowedNetworkSwitch()&&(EventsController.sendEvent({type:"track",event:"CLICK_NETWORKS"}),RouterController.push("Networks"))}isAllowedNetworkSwitch(){const Fn=NetworkController.getRequestedCaipNetworks(),io=Fn?Fn.length>1:!1,fo=Fn==null?void 0:Fn.find(({id:$o})=>{var mo;return $o===((mo=this.network)==null?void 0:mo.id)});return io||!fo}getPadding(){return this.heading?["l","2l","l","2l"]:["0","2l","0","2l"]}onViewChange(){const{history:Fn}=RouterController.state;let io=ConstantsUtil.VIEW_DIRECTION.Next;Fn.length<this.prevHistoryLength&&(io=ConstantsUtil.VIEW_DIRECTION.Prev),this.prevHistoryLength=Fn.length,this.viewDirection=io}async onHistoryChange(){var fo;const{history:Fn}=RouterController.state,io=(fo=this.shadowRoot)==null?void 0:fo.querySelector("#dynamic");Fn.length>1&&!this.showBack&&io?(await io.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,io.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):Fn.length<=1&&this.showBack&&io&&(await io.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,io.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){RouterController.goBack()}};W3mHeader.styles=styles$m;__decorate$B([r$4()],W3mHeader.prototype,"heading",void 0);__decorate$B([r$4()],W3mHeader.prototype,"network",void 0);__decorate$B([r$4()],W3mHeader.prototype,"buffering",void 0);__decorate$B([r$4()],W3mHeader.prototype,"showBack",void 0);__decorate$B([r$4()],W3mHeader.prototype,"isSiweEnabled",void 0);__decorate$B([r$4()],W3mHeader.prototype,"prevHistoryLength",void 0);__decorate$B([r$4()],W3mHeader.prototype,"view",void 0);__decorate$B([r$4()],W3mHeader.prototype,"viewDirection",void 0);__decorate$B([r$4()],W3mHeader.prototype,"headerText",void 0);W3mHeader=__decorate$B([customElement("w3m-header")],W3mHeader);var __decorate$A=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mHelpWidget=class extends r$6{constructor(){super(...arguments),this.data=[]}render(){return x$5`
<wui-flex flexDirection="column" alignItems="center" gap="l">
${this.data.map(Fn=>x$5`
<wui-flex flexDirection="column" alignItems="center" gap="xl">
<wui-flex flexDirection="row" justifyContent="center" gap="1xs">
${Fn.images.map(io=>x$5`<wui-visual name=${io}></wui-visual>`)}
</wui-flex>
</wui-flex>
<wui-flex flexDirection="column" alignItems="center" gap="xxs">
<wui-text variant="paragraph-500" color="fg-100" align="center">
${Fn.title}
</wui-text>
<wui-text variant="small-500" color="fg-200" align="center">${Fn.text}</wui-text>
</wui-flex>
`)}
</wui-flex>
`}};__decorate$A([n$7({type:Array})],W3mHelpWidget.prototype,"data",void 0);W3mHelpWidget=__decorate$A([customElement("w3m-help-widget")],W3mHelpWidget);const styles$l=i$6`
:host {
width: 100%;
}
:host > wui-flex {
width: 100%;
padding: var(--wui-spacing-s);
border-radius: var(--wui-border-radius-xs);
width: 100%;
display: flex;
align-items: center;
justify-content: flex-start;
gap: var(--wui-spacing-s);
}
:host > wui-flex:hover {
background-color: var(--wui-color-gray-glass-002);
}
.purchase-image-container {
display: flex;
justify-content: center;
align-items: center;
position: relative;
width: var(--wui-icon-box-size-lg);
height: var(--wui-icon-box-size-lg);
}
.purchase-image-container wui-image {
width: 100%;
height: 100%;
position: relative;
border-radius: calc(var(--wui-icon-box-size-lg) / 2);
}
.purchase-image-container wui-image::after {
content: '';
display: block;
width: 100%;
height: 100%;
position: absolute;
inset: 0;
border-radius: calc(var(--wui-icon-box-size-lg) / 2);
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
}
.purchase-image-container wui-icon-box {
position: absolute;
right: 0;
bottom: 0;
transform: translate(20%, 20%);
}
`;var __decorate$z=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mOnRampActivityItem=class extends r$6{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="Bought",this.purchaseValue="",this.purchaseCurrency="",this.date="",this.completed=!1,this.inProgress=!1,this.failed=!1,this.onClick=null,this.symbol=""}firstUpdated(){this.icon||this.fetchTokenImage()}render(){return x$5`
<wui-flex>
${this.imageTemplate()}
<wui-flex flexDirection="column" gap="4xs" flexGrow="1">
<wui-flex gap="xxs" alignItems="center" justifyContent="flex-start">
${this.statusIconTemplate()}
<wui-text variant="paragraph-500" color="fg-100"> ${this.label}</wui-text>
</wui-flex>
<wui-text variant="small-400" color="fg-200">
+ ${this.purchaseValue} ${this.purchaseCurrency}
</wui-text>
</wui-flex>
${this.inProgress?x$5`<wui-loading-spinner color="fg-200" size="md"></wui-loading-spinner>`:x$5`<wui-text variant="micro-700" color="fg-300"><span>${this.date}</span></wui-text>`}
</wui-flex>
`}async fetchTokenImage(){await ApiController._fetchTokenImage(this.purchaseCurrency)}statusIconTemplate(){return this.inProgress?null:this.completed?this.boughtIconTemplate():this.errorIconTemplate()}errorIconTemplate(){return x$5`<wui-icon-box
size="xxs"
iconColor="error-100"
backgroundColor="error-100"
background="opaque"
icon="close"
borderColor="wui-color-bg-125"
></wui-icon-box>`}imageTemplate(){const Fn=this.icon||`https://avatar.vercel.sh/andrew.svg?size=50&text=${this.symbol}`;return x$5`<wui-flex class="purchase-image-container">
<wui-image src=${Fn}></wui-image>
</wui-flex>`}boughtIconTemplate(){return x$5`<wui-icon-box
size="xxs"
iconColor="success-100"
backgroundColor="success-100"
background="opaque"
icon="arrowBottom"
borderColor="wui-color-bg-125"
></wui-icon-box>`}};W3mOnRampActivityItem.styles=[styles$l];__decorate$z([n$7({type:Boolean})],W3mOnRampActivityItem.prototype,"disabled",void 0);__decorate$z([n$7()],W3mOnRampActivityItem.prototype,"color",void 0);__decorate$z([n$7()],W3mOnRampActivityItem.prototype,"label",void 0);__decorate$z([n$7()],W3mOnRampActivityItem.prototype,"purchaseValue",void 0);__decorate$z([n$7()],W3mOnRampActivityItem.prototype,"purchaseCurrency",void 0);__decorate$z([n$7()],W3mOnRampActivityItem.prototype,"date",void 0);__decorate$z([n$7({type:Boolean})],W3mOnRampActivityItem.prototype,"completed",void 0);__decorate$z([n$7({type:Boolean})],W3mOnRampActivityItem.prototype,"inProgress",void 0);__decorate$z([n$7({type:Boolean})],W3mOnRampActivityItem.prototype,"failed",void 0);__decorate$z([n$7()],W3mOnRampActivityItem.prototype,"onClick",void 0);__decorate$z([n$7()],W3mOnRampActivityItem.prototype,"symbol",void 0);__decorate$z([n$7()],W3mOnRampActivityItem.prototype,"icon",void 0);W3mOnRampActivityItem=__decorate$z([customElement("w3m-onramp-activity-item")],W3mOnRampActivityItem);const styles$k=i$6`
:host {
width: 100%;
}
wui-loading-spinner {
position: absolute;
top: 50%;
right: 20px;
transform: translateY(-50%);
}
.currency-container {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: var(--wui-spacing-1xs);
height: 40px;
padding: var(--wui-spacing-xs) var(--wui-spacing-1xs) var(--wui-spacing-xs)
var(--wui-spacing-xs);
min-width: 95px;
border-radius: var(--FULL, 1000px);
border: 1px solid var(--wui-color-gray-glass-002);
background: var(--wui-color-gray-glass-002);
cursor: pointer;
}
.currency-container > wui-image {
height: 24px;
width: 24px;
border-radius: 50%;
}
`;var __decorate$y=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mInputCurrency=class extends r$6{constructor(){var Fn;super(),this.unsubscribe=[],this.type="Token",this.value=0,this.currencies=[],this.selectedCurrency=(Fn=this.currencies)==null?void 0:Fn[0],this.currencyImages=AssetController.state.currencyImages,this.tokenImages=AssetController.state.tokenImages,this.unsubscribe.push(OnRampController.subscribeKey("purchaseCurrency",io=>{!io||this.type==="Fiat"||(this.selectedCurrency=this.formatPurchaseCurrency(io))}),OnRampController.subscribeKey("paymentCurrency",io=>{!io||this.type==="Token"||(this.selectedCurrency=this.formatPaymentCurrency(io))}),OnRampController.subscribe(io=>{this.type==="Fiat"?this.currencies=io.purchaseCurrencies.map(this.formatPurchaseCurrency):this.currencies=io.paymentCurrencies.map(this.formatPaymentCurrency)}),AssetController.subscribe(io=>{this.currencyImages={...io.currencyImages},this.tokenImages={...io.tokenImages}}))}firstUpdated(){OnRampController.getAvailableCurrencies()}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){var fo;const Fn=((fo=this.selectedCurrency)==null?void 0:fo.symbol)||"",io=this.currencyImages[Fn]||this.tokenImages[Fn];return x$5`<wui-input-text type="number" size="lg" value=${this.value}>
${this.selectedCurrency?x$5` <wui-flex
class="currency-container"
justifyContent="space-between"
alignItems="center"
gap="xxs"
@click=${()=>ModalController.open({view:`OnRamp${this.type}Select`})}
>
<wui-image src=${o$4(io)}></wui-image>
<wui-text color="fg-100">${this.selectedCurrency.symbol}</wui-text>
</wui-flex>`:x$5`<wui-loading-spinner></wui-loading-spinner>`}
</wui-input-text>`}formatPaymentCurrency(Fn){return{name:Fn.id,symbol:Fn.id}}formatPurchaseCurrency(Fn){return{name:Fn.name,symbol:Fn.symbol}}};W3mInputCurrency.styles=styles$k;__decorate$y([n$7({type:String})],W3mInputCurrency.prototype,"type",void 0);__decorate$y([n$7({type:Number})],W3mInputCurrency.prototype,"value",void 0);__decorate$y([r$4()],W3mInputCurrency.prototype,"currencies",void 0);__decorate$y([r$4()],W3mInputCurrency.prototype,"selectedCurrency",void 0);__decorate$y([r$4()],W3mInputCurrency.prototype,"currencyImages",void 0);__decorate$y([r$4()],W3mInputCurrency.prototype,"tokenImages",void 0);W3mInputCurrency=__decorate$y([customElement("w3m-onramp-input")],W3mInputCurrency);const styles$j=i$6`
button {
padding: var(--wui-spacing-s);
border-radius: var(--wui-border-radius-xs);
border: none;
outline: none;
background-color: var(--wui-color-gray-glass-002);
width: 100%;
display: flex;
align-items: center;
justify-content: flex-start;
gap: var(--wui-spacing-s);
transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: background-color;
}
button:hover {
background-color: var(--wui-color-gray-glass-005);
}
.provider-image {
width: var(--wui-spacing-3xl);
min-width: var(--wui-spacing-3xl);
height: var(--wui-spacing-3xl);
border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2));
position: relative;
overflow: hidden;
}
.provider-image::after {
content: '';
display: block;
width: 100%;
height: 100%;
position: absolute;
inset: 0;
border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2));
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
}
.network-icon {
width: var(--wui-spacing-m);
height: var(--wui-spacing-m);
border-radius: calc(var(--wui-spacing-m) / 2);
overflow: hidden;
box-shadow:
0 0 0 3px var(--wui-color-gray-glass-002),
0 0 0 3px var(--wui-color-modal-bg);
transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: box-shadow;
}
button:hover .network-icon {
box-shadow:
0 0 0 3px var(--wui-color-gray-glass-005),
0 0 0 3px var(--wui-color-modal-bg);
}
`;var __decorate$x=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mOnRampProviderItem=class extends r$6{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="",this.feeRange="",this.loading=!1,this.onClick=null}render(){return x$5`
<button ?disabled=${this.disabled} ontouchstart>
<wui-visual name=${o$4(this.name)} class="provider-image"></wui-visual>
<wui-flex flexDirection="column" gap="4xs">
<wui-text variant="paragraph-500" color="fg-100">${this.label}</wui-text>
<wui-flex alignItems="center" justifyContent="flex-start" gap="l">
<wui-text variant="tiny-500" color="fg-100">
<wui-text variant="tiny-400" color="fg-200">Fees</wui-text>
${this.feeRange}
</wui-text>
<wui-flex gap="xxs">
<wui-icon name="bank" size="xs" color="fg-150"></wui-icon>
<wui-icon name="card" size="xs" color="fg-150"></wui-icon>
</wui-flex>
${this.networksTemplate()}
</wui-flex>
</wui-flex>
${this.loading?x$5`<wui-loading-spinner color="fg-200" size="md"></wui-loading-spinner>`:x$5`<wui-icon name="chevronRight" color="fg-200" size="sm"></wui-icon>`}
</button>
`}networksTemplate(){var fo;const Fn=NetworkController.getRequestedCaipNetworks(),io=(fo=Fn==null?void 0:Fn.filter($o=>$o==null?void 0:$o.imageId))==null?void 0:fo.slice(0,5);return x$5`
<wui-flex class="networks">
${io==null?void 0:io.map($o=>x$5`
<wui-flex class="network-icon">
<wui-image src=${o$4(AssetUtil.getNetworkImage($o))}></wui-image>
</wui-flex>
`)}
</wui-flex>
`}};W3mOnRampProviderItem.styles=[styles$j];__decorate$x([n$7({type:Boolean})],W3mOnRampProviderItem.prototype,"disabled",void 0);__decorate$x([n$7()],W3mOnRampProviderItem.prototype,"color",void 0);__decorate$x([n$7()],W3mOnRampProviderItem.prototype,"name",void 0);__decorate$x([n$7()],W3mOnRampProviderItem.prototype,"label",void 0);__decorate$x([n$7()],W3mOnRampProviderItem.prototype,"feeRange",void 0);__decorate$x([n$7({type:Boolean})],W3mOnRampProviderItem.prototype,"loading",void 0);__decorate$x([n$7()],W3mOnRampProviderItem.prototype,"onClick",void 0);W3mOnRampProviderItem=__decorate$x([customElement("w3m-onramp-provider-item")],W3mOnRampProviderItem);const styles$i=i$6`
wui-flex {
background-color: var(--wui-color-gray-glass-005);
}
a {
text-decoration: none;
color: var(--wui-color-fg-175);
font-weight: 500;
}
`;var __decorate$w=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mLegalFooter=class extends r$6{render(){const{termsConditionsUrl:Fn,privacyPolicyUrl:io}=OptionsController.state;return!Fn&&!io?null:x$5`
<wui-flex .padding=${["m","s","s","s"]} justifyContent="center">
<wui-text color="fg-250" variant="small-400" align="center">
By connecting your wallet, you agree to our <br />
${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
</wui-text>
</wui-flex>
`}andTemplate(){const{termsConditionsUrl:Fn,privacyPolicyUrl:io}=OptionsController.state;return Fn&&io?"and":""}termsTemplate(){const{termsConditionsUrl:Fn}=OptionsController.state;return Fn?x$5`<a href=${Fn}>Terms of Service</a>`:null}privacyTemplate(){const{privacyPolicyUrl:Fn}=OptionsController.state;return Fn?x$5`<a href=${Fn}>Privacy Policy</a>`:null}};W3mLegalFooter.styles=[styles$i];W3mLegalFooter=__decorate$w([customElement("w3m-legal-footer")],W3mLegalFooter);const styles$h=i$6`
:host {
display: block;
padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl);
}
`;var __decorate$v=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mMobileDownloadLinks=class extends r$6{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:Fn,app_store:io,play_store:fo,chrome_store:$o,homepage:mo}=this.wallet,Ao=CoreHelperUtil.isMobile(),jo=CoreHelperUtil.isIos(),Lo=CoreHelperUtil.isAndroid(),Ho=[io,fo,mo,$o].filter(Boolean).length>1,zo=UiHelperUtil.getTruncateString({string:Fn,charsStart:12,charsEnd:0,truncate:"end"});return Ho&&!Ao?x$5`
<wui-cta-button
label=${`Don't have ${zo}?`}
buttonLabel="Get"
@click=${()=>RouterController.push("Downloads",{wallet:this.wallet})}
></wui-cta-button>
`:!Ho&&mo?x$5`
<wui-cta-button
label=${`Don't have ${zo}?`}
buttonLabel="Get"
@click=${this.onHomePage.bind(this)}
></wui-cta-button>
`:io&&jo?x$5`
<wui-cta-button
label=${`Don't have ${zo}?`}
buttonLabel="Get"
@click=${this.onAppStore.bind(this)}
></wui-cta-button>
`:fo&&Lo?x$5`
<wui-cta-button
label=${`Don't have ${zo}?`}
buttonLabel="Get"
@click=${this.onPlayStore.bind(this)}
></wui-cta-button>
`:(this.style.display="none",null)}onAppStore(){var Fn;(Fn=this.wallet)!=null&&Fn.app_store&&CoreHelperUtil.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var Fn;(Fn=this.wallet)!=null&&Fn.play_store&&CoreHelperUtil.openHref(this.wallet.play_store,"_blank")}onHomePage(){var Fn;(Fn=this.wallet)!=null&&Fn.homepage&&CoreHelperUtil.openHref(this.wallet.homepage,"_blank")}};W3mMobileDownloadLinks.styles=[styles$h];__decorate$v([n$7({type:Object})],W3mMobileDownloadLinks.prototype,"wallet",void 0);W3mMobileDownloadLinks=__decorate$v([customElement("w3m-mobile-download-links")],W3mMobileDownloadLinks);const styles$g=i$6`
wui-flex {
border-top: 1px solid var(--wui-color-gray-glass-005);
}
a {
text-decoration: none;
color: var(--wui-color-fg-175);
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
gap: var(--wui-spacing-3xs);
}
`;var __decorate$u=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mOnRampProvidersFooter=class extends r$6{render(){const{termsConditionsUrl:Fn,privacyPolicyUrl:io}=OptionsController.state;return!Fn&&!io?null:x$5`
<wui-flex
.padding=${["m","s","s","s"]}
flexDirection="column"
alignItems="center"
justifyContent="center"
gap="s"
>
<wui-text color="fg-250" variant="small-400" align="center">
We work with the best providers to give you the lowest fees and best support. More options
coming soon!
</wui-text>
${this.howDoesItWorkTemplate()}
</wui-flex>
`}howDoesItWorkTemplate(){return x$5` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
<wui-icon size="xs" color="accent-100" slot="iconLeft" name="helpCircle"></wui-icon>
How does it work?
</wui-link>`}onWhatIsBuy(){EventsController.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("WhatIsABuy")}};W3mOnRampProvidersFooter.styles=[styles$g];W3mOnRampProvidersFooter=__decorate$u([customElement("w3m-onramp-providers-footer")],W3mOnRampProvidersFooter);const styles$f=i$6`
:host {
display: block;
position: absolute;
opacity: 0;
pointer-events: none;
top: 11px;
left: 50%;
width: max-content;
}
`;var __decorate$t=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};const presets={loading:void 0,success:{backgroundColor:"success-100",iconColor:"success-100",icon:"checkmark"},error:{backgroundColor:"error-100",iconColor:"error-100",icon:"close"}};let W3mSnackBar=class extends r$6{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=SnackController.state.open,this.unsubscribe.push(SnackController.subscribeKey("open",Fn=>{this.open=Fn,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(Fn=>Fn())}render(){const{message:Fn,variant:io}=SnackController.state,fo=presets[io];return x$5`
<wui-snackbar
message=${Fn}
backgroundColor=${fo==null?void 0:fo.backgroundColor}
iconColor=${fo==null?void 0:fo.iconColor}
icon=${fo==null?void 0:fo.icon}
.loading=${io==="loading"}
></wui-snackbar>
`}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout=setTimeout(()=>SnackController.hide(),2500)):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};W3mSnackBar.styles=styles$f;__decorate$t([r$4()],W3mSnackBar.prototype,"open",void 0);W3mSnackBar=__decorate$t([customElement("w3m-snackbar")],W3mSnackBar);const styles$e=i$6`
wui-separator {
margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1);
width: calc(100% + var(--wui-spacing-s) * 2);
}
wui-email-input {
width: 100%;
}
form {
width: 100%;
display: block;
position: relative;
}
wui-icon-link,
wui-loading-spinner {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
wui-icon-link {
right: var(--wui-spacing-xs);
}
wui-loading-spinner {
right: var(--wui-spacing-m);
}
`;var __decorate$s=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mEmailLoginWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.formRef=e$1(),this.connectors=ConnectorController.state.connectors,this.email="",this.loading=!1,this.error="",this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>this.connectors=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}firstUpdated(){var Fn;(Fn=this.formRef.value)==null||Fn.addEventListener("keydown",io=>{io.key==="Enter"&&this.onSubmitEmail(io)})}render(){const Fn=this.connectors.find(fo=>fo.type==="AUTH"),io=this.connectors.length>1;return Fn!=null&&Fn.email?x$5`
<form ${n$5(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
<wui-email-input
@focus=${this.onFocusEvent.bind(this)}
.disabled=${this.loading}
@inputChange=${this.onEmailInputChange.bind(this)}
.errorMessage=${this.error}
>
</wui-email-input>
${this.submitButtonTemplate()}${this.loadingTemplate()}
<input type="submit" hidden />
</form>
${Fn.socials||!io?null:x$5`<wui-flex .padding=${["xxs","0","0","0"]}>
<wui-separator text="or"></wui-separator>
</wui-flex>`}
`:null}submitButtonTemplate(){return!this.loading&&this.email.length>3?x$5`
<wui-icon-link
size="sm"
icon="chevronRight"
iconcolor="accent-100"
@click=${this.onSubmitEmail.bind(this)}
>
</wui-icon-link>
`:null}loadingTemplate(){return this.loading?x$5`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:null}onEmailInputChange(Fn){this.email=Fn.detail.trim(),this.error=""}async onSubmitEmail(Fn){if(![ConstantsUtil$2.CHAIN.EVM,ConstantsUtil$2.CHAIN.SOLANA].find($o=>$o===ChainController.state.activeChain)){RouterController.push("SwitchActiveChain",{switchToChain:ConstantsUtil$2.CHAIN.EVM});return}try{if(this.loading)return;this.loading=!0,Fn.preventDefault();const $o=ConnectorController.getAuthConnector();if(!$o)throw new Error("w3m-email-login-widget: Auth connector not found");const{action:mo}=await $o.provider.connectEmail({email:this.email});EventsController.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),mo==="VERIFY_OTP"?(EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),RouterController.push("EmailVerifyOtp",{email:this.email})):mo==="VERIFY_DEVICE"&&RouterController.push("EmailVerifyDevice",{email:this.email})}catch($o){const mo=CoreHelperUtil.parseError($o);mo!=null&&mo.includes("Invalid email")?this.error="Invalid email. Try again.":SnackController.showError($o)}finally{this.loading=!1}}onFocusEvent(){EventsController.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};W3mEmailLoginWidget.styles=styles$e;__decorate$s([r$4()],W3mEmailLoginWidget.prototype,"connectors",void 0);__decorate$s([r$4()],W3mEmailLoginWidget.prototype,"email",void 0);__decorate$s([r$4()],W3mEmailLoginWidget.prototype,"loading",void 0);__decorate$s([r$4()],W3mEmailLoginWidget.prototype,"error",void 0);W3mEmailLoginWidget=__decorate$s([customElement("w3m-email-login-widget")],W3mEmailLoginWidget);const styles$d=i$6`
wui-flex {
width: 100%;
}
:host > wui-flex:first-child {
transform: translateY(calc(var(--wui-spacing-xxs) * -1));
}
wui-icon-link {
margin-right: calc(var(--wui-icon-box-size-md) * -1);
}
wui-notice-card {
margin-bottom: var(--wui-spacing-3xs);
}
wui-list-item > wui-text {
flex: 1;
}
w3m-transactions-view {
max-height: 200px;
}
.tab-content-container {
height: 300px;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: none;
}
.tab-content-container::-webkit-scrollbar {
display: none;
}
.account-button {
width: auto;
border: none;
display: flex;
align-items: center;
justify-content: center;
gap: var(--wui-spacing-s);
height: 48px;
padding: var(--wui-spacing-xs);
padding-right: var(--wui-spacing-s);
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
background-color: var(--wui-color-gray-glass-002);
border-radius: 24px;
transition: background-color 0.2s linear;
}
.account-button:hover {
background-color: var(--wui-color-gray-glass-005);
}
.avatar-container {
position: relative;
}
wui-avatar.avatar {
width: 32px;
height: 32px;
box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
}
wui-avatar.network-avatar {
width: 16px;
height: 16px;
position: absolute;
left: 100%;
top: 100%;
transform: translate(-75%, -75%);
box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
}
.account-links {
display: flex;
justify-content: space-between;
align-items: center;
}
.account-links wui-flex {
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
background: red;
align-items: center;
justify-content: center;
height: 48px;
padding: 10px;
flex: 1 0 0;
border-radius: var(--XS, 16px);
border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
transition:
background-color var(--wui-ease-out-power-1) var(--wui-duration-md),
opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: background-color, opacity;
}
.account-links wui-flex:hover {
background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
}
.account-links wui-flex wui-icon {
width: var(--S, 20px);
height: var(--S, 20px);
}
.account-links wui-flex wui-icon svg path {
stroke: #667dff;
}
`;var __decorate$r=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mAccountDefaultWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.address=AccountController.state.address,this.profileImage=AccountController.state.profileImage,this.profileName=AccountController.state.profileName,this.disconnecting=!1,this.balance=AccountController.state.balance,this.balanceSymbol=AccountController.state.balanceSymbol,this.unsubscribe.push(AccountController.subscribe(Fn=>{Fn.address?(this.address=Fn.address,this.profileImage=Fn.profileImage,this.profileName=Fn.profileName,this.balance=Fn.balance,this.balanceSymbol=Fn.balanceSymbol):this.disconnecting||SnackController.showError("Account not found")}))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){if(!this.address)throw new Error("w3m-account-view: No account provided");return x$5`<wui-flex
flexDirection="column"
.padding=${["0","xl","m","xl"]}
alignItems="center"
gap="l"
>
${ChainController.state.activeChain===ConstantsUtil$2.CHAIN.EVM?this.multiAccountTemplate():this.singleAccountTemplate()}
<wui-flex flexDirection="column" alignItems="center">
<wui-text variant="paragraph-500" color="fg-200">
${CoreHelperUtil.formatBalance(this.balance,this.balanceSymbol)}
</wui-text>
</wui-flex>
${this.explorerBtnTemplate()}
</wui-flex>
<wui-flex flexDirection="column" gap="xs" .padding=${["0","s","s","s"]}>
${this.authCardTemplate()} <w3m-account-auth-button></w3m-account-auth-button>
${this.onrampTemplate()} ${this.swapsTemplate()} ${this.activityTemplate()}
<wui-list-item
variant="icon"
iconVariant="overlay"
icon="disconnect"
?chevron=${!1}
.loading=${this.disconnecting}
@click=${this.onDisconnect.bind(this)}
data-testid="disconnect-button"
>
<wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text>
</wui-list-item>
</wui-flex>`}onrampTemplate(){const{enableOnramp:Fn}=OptionsController.state;return Fn?x$5`
<wui-list-item
data-testid="w3m-account-default-onramp-button"
iconVariant="blue"
icon="card"
?chevron=${!0}
@click=${this.handleClickPay.bind(this)}
>
<wui-text variant="paragraph-500" color="fg-100">Buy crypto</wui-text>
</wui-list-item>
`:null}activityTemplate(){const Fn=ChainController.state.activeChain===ConstantsUtil$2.CHAIN.SOLANA;return x$5` <wui-list-item
iconVariant="blue"
icon="clock"
iconSize="sm"
?chevron=${!Fn}
?disabled=${Fn}
@click=${this.onTransactions.bind(this)}
>
<wui-text variant="paragraph-500" color="fg-100" ?disabled=${Fn}> Activity </wui-text>
${Fn?x$5`<wui-tag variant="main">Coming soon</wui-tag>`:""}
</wui-list-item>`}swapsTemplate(){const{enableSwaps:Fn}=OptionsController.state;return!Fn||ChainController.state.activeChain===ConstantsUtil$2.CHAIN.SOLANA?null:x$5`
<wui-list-item
iconVariant="blue"
icon="recycleHorizontal"
?chevron=${!0}
@click=${this.handleClickSwap.bind(this)}
>
<wui-text variant="paragraph-500" color="fg-100">Swap</wui-text>
</wui-list-item>
`}authCardTemplate(){const Fn=StorageUtil.getConnectedConnector(),io=ConnectorController.getAuthConnector(),{origin:fo}=location;return!io||Fn!=="AUTH"||fo.includes(ConstantsUtil$1.SECURE_SITE)?null:x$5`
<wui-notice-card
@click=${this.onGoToUpgradeView.bind(this)}
label="Upgrade your wallet"
description="Transition to a self-custodial wallet"
icon="wallet"
data-testid="w3m-wallet-upgrade-card"
></wui-notice-card>
`}handleSwitchAccountsView(){RouterController.push("SwitchAddress")}handleClickPay(){RouterController.push("OnRampProviders")}handleClickSwap(){RouterController.push("Swap")}explorerBtnTemplate(){return AccountController.state.addressExplorerUrl?x$5`
<wui-button size="md" variant="neutral" @click=${this.onExplorer.bind(this)}>
<wui-icon size="sm" color="inherit" slot="iconLeft" name="compass"></wui-icon>
Block Explorer
<wui-icon size="sm" color="inherit" slot="iconRight" name="externalLink"></wui-icon>
</wui-button>
`:null}singleAccountTemplate(){return x$5`
<wui-avatar
alt=${o$4(this.address)}
address=${o$4(this.address)}
imageSrc=${o$4(this.profileImage===null?void 0:this.profileImage)}
></wui-avatar>
<wui-flex flexDirection="column" alignItems="center">
<wui-flex gap="3xs" alignItems="center" justifyContent="center">
<wui-text variant="large-600" color="fg-100">
${this.profileName?UiHelperUtil.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):UiHelperUtil.getTruncateString({string:this.address?this.address:"",charsStart:4,charsEnd:4,truncate:"middle"})}
</wui-text>
<wui-icon-link
size="md"
icon="copy"
iconColor="fg-200"
@click=${this.onCopyAddress}
></wui-icon-link> </wui-flex
></wui-flex>
`}multiAccountTemplate(){var fo;if(!this.address)throw new Error("w3m-account-view: No account provided");const Fn=(fo=AccountController.state.allAccounts)==null?void 0:fo.find($o=>$o.address===this.address),io=AccountController.state.addressLabels.get(this.address);return x$5`
<wui-profile-button-v2
.onProfileClick=${this.handleSwitchAccountsView.bind(this)}
address=${o$4(this.address)}
icon="${(Fn==null?void 0:Fn.type)===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT&&ChainController.state.activeChain===ConstantsUtil$2.CHAIN.EVM?"lightbulb":"mail"}"
avatarSrc=${o$4(this.profileImage?this.profileImage:void 0)}
profileName=${o$4(io||this.profileName)}
.onCopyClick=${this.onCopyAddress.bind(this)}
></wui-profile-button-v2>
`}onCopyAddress(){try{this.address&&(CoreHelperUtil.copyToClopboard(this.address),SnackController.showSuccess("Address copied"))}catch{SnackController.showError("Failed to copy")}}onTransactions(){EventsController.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0,await ConnectionController.disconnect(),EventsController.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),ModalController.close()}catch{EventsController.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),SnackController.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){const Fn=AccountController.state.addressExplorerUrl;Fn&&CoreHelperUtil.openHref(Fn,"_blank")}onGoToUpgradeView(){EventsController.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),RouterController.push("UpgradeEmailWallet")}};W3mAccountDefaultWidget.styles=styles$d;__decorate$r([r$4()],W3mAccountDefaultWidget.prototype,"address",void 0);__decorate$r([r$4()],W3mAccountDefaultWidget.prototype,"profileImage",void 0);__decorate$r([r$4()],W3mAccountDefaultWidget.prototype,"profileName",void 0);__decorate$r([r$4()],W3mAccountDefaultWidget.prototype,"disconnecting",void 0);__decorate$r([r$4()],W3mAccountDefaultWidget.prototype,"balance",void 0);__decorate$r([r$4()],W3mAccountDefaultWidget.prototype,"balanceSymbol",void 0);W3mAccountDefaultWidget=__decorate$r([customElement("w3m-account-default-widget")],W3mAccountDefaultWidget);const styles$c=i$6`
wui-flex {
width: 100%;
}
wui-promo {
position: absolute;
top: -32px;
}
wui-profile-button {
margin-top: calc(-1 * var(--wui-spacing-2l));
}
wui-promo + wui-profile-button {
margin-top: var(--wui-spacing-2l);
}
wui-tabs {
width: 100%;
}
.contentContainer {
height: 280px;
}
.contentContainer > wui-icon-box {
width: 40px;
height: 40px;
border-radius: var(--wui-border-radius-xxs);
}
.contentContainer > .textContent {
width: 65%;
}
`;var __decorate$q=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};const TABS=3,TABS_PADDING=48,MODAL_MOBILE_VIEW_PX=430;let W3mAccountWalletFeaturesWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.address=AccountController.state.address,this.profileImage=AccountController.state.profileImage,this.profileName=AccountController.state.profileName,this.smartAccountDeployed=AccountController.state.smartAccountDeployed,this.network=NetworkController.state.caipNetwork,this.currentTab=AccountController.state.currentTab,this.tokenBalance=AccountController.state.tokenBalance,this.preferredAccountType=AccountController.state.preferredAccountType,this.unsubscribe.push(AccountController.subscribe(Fn=>{Fn.address?(this.address=Fn.address,this.profileImage=Fn.profileImage,this.profileName=Fn.profileName,this.currentTab=Fn.currentTab,this.tokenBalance=Fn.tokenBalance,this.smartAccountDeployed=Fn.smartAccountDeployed,this.preferredAccountType=Fn.preferredAccountType):ModalController.close()}),NetworkController.subscribeKey("caipNetwork",Fn=>{this.network=Fn})),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn()),clearInterval(this.watchTokenBalance)}firstUpdated(){AccountController.fetchTokenBalance()}render(){if(!this.address)throw new Error("w3m-account-view: No account provided");const Fn=AssetUtil.getNetworkImage(this.network);return x$5`<wui-flex
flexDirection="column"
.padding=${["0","xl","m","xl"]}
alignItems="center"
gap="m"
>
${this.network&&x$5`<wui-network-icon .network=${this.network}></wui-network-icon>`}
${this.activateAccountTemplate()}
<wui-profile-button
@click=${this.onProfileButtonClick.bind(this)}
address=${o$4(this.address)}
networkSrc=${o$4(Fn)}
icon="chevronBottom"
avatarSrc=${o$4(this.profileImage?this.profileImage:void 0)}
profileName=${this.profileName}
data-testid="w3m-profile-button"
></wui-profile-button>
${this.tokenBalanceTemplate()}
<wui-flex gap="s">
<w3m-tooltip-trigger text="Buy">
<wui-icon-button
data-testid="wallet-features-onramp-button"
@click=${this.onBuyClick.bind(this)}
icon="card"
></wui-icon-button>
</w3m-tooltip-trigger>
${this.swapsTemplate()}
<w3m-tooltip-trigger text="Receive">
<wui-icon-button
data-testid="wallet-features-receive-button"
@click=${this.onReceiveClick.bind(this)}
icon="arrowBottomCircle"
>
</wui-icon-button>
</w3m-tooltip-trigger>
<w3m-tooltip-trigger text="Send">
<wui-icon-button
data-testid="wallet-features-send-button"
@click=${this.onSendClick.bind(this)}
icon="send"
></wui-icon-button>
</w3m-tooltip-trigger>
</wui-flex>
<wui-tabs
.onTabChange=${this.onTabChange.bind(this)}
.activeTab=${this.currentTab}
localTabWidth=${CoreHelperUtil.isMobile()&&window.innerWidth<MODAL_MOBILE_VIEW_PX?`${(window.innerWidth-TABS_PADDING)/TABS}px`:"104px"}
.tabs=${ConstantsUtil.ACCOUNT_TABS}
></wui-tabs>
${this.listContentTemplate()}
</wui-flex>`}swapsTemplate(){const{enableSwaps:Fn}=OptionsController.state;return Fn?x$5`
<w3m-tooltip-trigger text="Swap">
<wui-icon-button
data-testid="wallet-features-swap-button"
@click=${this.onSwapClick.bind(this)}
icon="recycleHorizontal"
>
</wui-icon-button>
</w3m-tooltip-trigger>
`:null}watchSwapValues(){this.watchTokenBalance=setInterval(()=>AccountController.fetchTokenBalance(),1e4)}listContentTemplate(){return this.currentTab===0?x$5`<w3m-account-tokens-widget></w3m-account-tokens-widget>`:this.currentTab===1?x$5`<w3m-account-nfts-widget></w3m-account-nfts-widget>`:this.currentTab===2?x$5`<w3m-account-activity-widget></w3m-account-activity-widget>`:x$5`<w3m-account-tokens-widget></w3m-account-tokens-widget>`}tokenBalanceTemplate(){var Fn;if(this.tokenBalance&&((Fn=this.tokenBalance)==null?void 0:Fn.length)>=0){const io=CoreHelperUtil.calculateBalance(this.tokenBalance),{dollars:fo="0",pennies:$o="00"}=CoreHelperUtil.formatTokenBalance(io);return x$5`<wui-balance dollars=${fo} pennies=${$o}></wui-balance>`}return x$5`<wui-balance dollars="0" pennies="00"></wui-balance>`}activateAccountTemplate(){return!NetworkController.checkIfSmartAccountEnabled()||this.preferredAccountType!==W3mFrameRpcConstants.ACCOUNT_TYPES.EOA||this.smartAccountDeployed?null:x$5` <wui-promo
text=${"Activate your account"}
@click=${this.onUpdateToSmartAccount.bind(this)}
data-testid="activate-smart-account-promo"
></wui-promo>`}onTabChange(Fn){AccountController.setCurrentTab(Fn)}onProfileButtonClick(){RouterController.push("Profile")}onBuyClick(){RouterController.push("OnRampProviders")}onSwapClick(){var Fn,io,fo;(Fn=this.network)!=null&&Fn.id&&!ConstantsUtil$1.SWAP_SUPPORTED_NETWORKS.includes((io=this.network)==null?void 0:io.id)?RouterController.push("UnsupportedChain",{swapUnsupportedChain:!0}):(EventsController.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:((fo=this.network)==null?void 0:fo.id)||"",isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("Swap"))}onReceiveClick(){RouterController.push("WalletReceive")}onSendClick(){var Fn;EventsController.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:((Fn=this.network)==null?void 0:Fn.id)||"",isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("WalletSend")}onUpdateToSmartAccount(){RouterController.push("UpgradeToSmartAccount")}};W3mAccountWalletFeaturesWidget.styles=styles$c;__decorate$q([r$4()],W3mAccountWalletFeaturesWidget.prototype,"watchTokenBalance",void 0);__decorate$q([r$4()],W3mAccountWalletFeaturesWidget.prototype,"address",void 0);__decorate$q([r$4()],W3mAccountWalletFeaturesWidget.prototype,"profileImage",void 0);__decorate$q([r$4()],W3mAccountWalletFeaturesWidget.prototype,"profileName",void 0);__decorate$q([r$4()],W3mAccountWalletFeaturesWidget.prototype,"smartAccountDeployed",void 0);__decorate$q([r$4()],W3mAccountWalletFeaturesWidget.prototype,"network",void 0);__decorate$q([r$4()],W3mAccountWalletFeaturesWidget.prototype,"currentTab",void 0);__decorate$q([r$4()],W3mAccountWalletFeaturesWidget.prototype,"tokenBalance",void 0);__decorate$q([r$4()],W3mAccountWalletFeaturesWidget.prototype,"preferredAccountType",void 0);W3mAccountWalletFeaturesWidget=__decorate$q([customElement("w3m-account-wallet-features-widget")],W3mAccountWalletFeaturesWidget);const styles$b=i$6`
:host {
width: 100%;
max-height: 280px;
overflow: scroll;
scrollbar-width: none;
}
:host::-webkit-scrollbar {
display: none;
}
`;var __decorate$p=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mAccountActivityWidget=class extends r$6{render(){return x$5`<w3m-activity-list page="account"></w3m-activity-list>`}};W3mAccountActivityWidget.styles=styles$b;W3mAccountActivityWidget=__decorate$p([customElement("w3m-account-activity-widget")],W3mAccountActivityWidget);const styles$a=i$6`
.contentContainer {
height: 280px;
}
.contentContainer > wui-icon-box {
width: 40px;
height: 40px;
border-radius: var(--wui-border-radius-xxs);
}
.contentContainer > .textContent {
width: 65%;
}
`;var __decorate$o=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mAccountNftsWidget=class extends r$6{render(){return x$5`${this.nftTemplate()}`}nftTemplate(){return x$5` <wui-flex
class="contentContainer"
alignItems="center"
justifyContent="center"
flexDirection="column"
gap="l"
>
<wui-icon-box
icon="wallet"
size="inherit"
iconColor="fg-200"
backgroundColor="fg-200"
iconSize="lg"
></wui-icon-box>
<wui-flex
class="textContent"
gap="xs"
flexDirection="column"
justifyContent="center"
flexDirection="column"
>
<wui-text variant="paragraph-500" align="center" color="fg-100">Coming soon</wui-text>
<wui-text variant="small-400" align="center" color="fg-200"
>Stay tuned for our upcoming NFT feature</wui-text
>
</wui-flex>
<wui-link @click=${this.onReceiveClick.bind(this)}>Receive funds</wui-link>
</wui-flex>`}onReceiveClick(){RouterController.push("WalletReceive")}};W3mAccountNftsWidget.styles=styles$a;W3mAccountNftsWidget=__decorate$o([customElement("w3m-account-nfts-widget")],W3mAccountNftsWidget);const styles$9=i$6`
:host {
width: 100%;
}
wui-flex {
width: 100%;
}
.contentContainer {
max-height: 280px;
overflow: scroll;
scrollbar-width: none;
}
.contentContainer::-webkit-scrollbar {
display: none;
}
`;var __decorate$n=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mAccountTokensWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.tokenBalance=AccountController.state.tokenBalance,this.unsubscribe.push(AccountController.subscribe(Fn=>{this.tokenBalance=Fn.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){return x$5`${this.tokenTemplate()}`}tokenTemplate(){var Fn;return this.tokenBalance&&((Fn=this.tokenBalance)==null?void 0:Fn.length)>0?x$5`<wui-flex class="contentContainer" flexDirection="column" gap="xs">
${this.tokenItemTemplate()}
</wui-flex>`:x$5` <wui-flex flexDirection="column" gap="xs"
><wui-list-description
@click=${this.onBuyClick.bind(this)}
text="Buy Crypto"
description="Easy with card or bank account"
icon="card"
iconColor="success-100"
iconBackgroundColor="success-100"
tag="popular"
></wui-list-description
><wui-list-description
@click=${this.onReceiveClick.bind(this)}
text="Receive funds"
description="Transfer tokens on your wallet"
icon="arrowBottomCircle"
iconColor="fg-200"
iconBackgroundColor="fg-200"
></wui-list-description
></wui-flex>`}tokenItemTemplate(){var Fn;return(Fn=this.tokenBalance)==null?void 0:Fn.map(io=>x$5`<wui-list-token
tokenName=${io.name}
tokenImageUrl=${io.iconUrl}
tokenAmount=${io.quantity.numeric}
tokenValue=${io.value}
tokenCurrency=${io.symbol}
></wui-list-token>`)}onReceiveClick(){RouterController.push("WalletReceive")}onBuyClick(){EventsController.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("OnRampProviders")}};W3mAccountTokensWidget.styles=styles$9;__decorate$n([r$4()],W3mAccountTokensWidget.prototype,"tokenBalance",void 0);W3mAccountTokensWidget=__decorate$n([customElement("w3m-account-tokens-widget")],W3mAccountTokensWidget);const styles$8=i$6`
:host {
min-height: 100%;
}
.group-container[last-group='true'] {
padding-bottom: var(--wui-spacing-m);
}
.contentContainer {
height: 280px;
}
.contentContainer > wui-icon-box {
width: 40px;
height: 40px;
border-radius: var(--wui-border-radius-xxs);
}
.contentContainer > .textContent {
width: 65%;
}
.emptyContainer {
height: 100%;
}
`;var __decorate$m=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};const PAGINATOR_ID="last-transaction",LOADING_ITEM_COUNT=7;let W3mActivityList=class extends r$6{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.address=AccountController.state.address,this.transactionsByYear=TransactionsController.state.transactionsByYear,this.loading=TransactionsController.state.loading,this.empty=TransactionsController.state.empty,this.next=TransactionsController.state.next,TransactionsController.clearCursor(),this.unsubscribe.push(AccountController.subscribe(Fn=>{Fn.isConnected&&this.address!==Fn.address&&(this.address=Fn.address,TransactionsController.resetTransactions(),TransactionsController.fetchTransactions(Fn.address))}),NetworkController.subscribeKey("caipNetwork",()=>{this.updateTransactionView()}),TransactionsController.subscribe(Fn=>{this.transactionsByYear=Fn.transactionsByYear,this.loading=Fn.loading,this.empty=Fn.empty,this.next=Fn.next}))}firstUpdated(){this.updateTransactionView(),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){return x$5` ${this.empty?null:this.templateTransactionsByYear()}
${this.loading?this.templateLoading():null}
${!this.loading&&this.empty?this.templateEmpty():null}`}updateTransactionView(){var fo;const Fn=(fo=NetworkController.state.caipNetwork)==null?void 0:fo.id;TransactionsController.state.lastNetworkInView!==Fn&&(TransactionsController.resetTransactions(),TransactionsController.fetchTransactions(this.address)),TransactionsController.setLastNetworkInView(Fn)}templateTransactionsByYear(){return Object.keys(this.transactionsByYear).sort().reverse().map(io=>{const fo=parseInt(io,10),$o=new Array(12).fill(null).map((mo,Ao)=>{var Ho;const jo=TransactionUtil.getTransactionGroupTitle(fo,Ao),Lo=(Ho=this.transactionsByYear[fo])==null?void 0:Ho[Ao];return{groupTitle:jo,transactions:Lo}}).filter(({transactions:mo})=>mo).reverse();return $o.map(({groupTitle:mo,transactions:Ao},jo)=>{const Lo=jo===$o.length-1;return Ao?x$5`
<wui-flex
flexDirection="column"
class="group-container"
last-group="${Lo?"true":"false"}"
>
<wui-flex
alignItems="center"
flexDirection="row"
.padding=${["xs","s","s","s"]}
>
<wui-text variant="paragraph-500" color="fg-200">${mo}</wui-text>
</wui-flex>
<wui-flex flexDirection="column" gap="xs">
${this.templateTransactions(Ao,Lo)}
</wui-flex>
</wui-flex>
`:null})})}templateRenderTransaction(Fn,io){const{date:fo,descriptions:$o,direction:mo,isAllNFT:Ao,images:jo,status:Lo,transfers:Ho,type:zo}=this.getTransactionListItemProps(Fn),Go=(Ho==null?void 0:Ho.length)>1;return(Ho==null?void 0:Ho.length)===2&&!Ao?x$5`
<wui-transaction-list-item
date=${fo}
.direction=${mo}
id=${io&&this.next?PAGINATOR_ID:""}
status=${Lo}
type=${zo}
.images=${jo}
.descriptions=${$o}
></wui-transaction-list-item>
`:Go?Ho.map((Yo,Xo)=>{const is=TransactionUtil.getTransferDescription(Yo),yl=io&&Xo===Ho.length-1;return x$5` <wui-transaction-list-item
date=${fo}
direction=${Yo.direction}
id=${yl&&this.next?PAGINATOR_ID:""}
status=${Lo}
type=${zo}
.onlyDirectionIcon=${!0}
.images=${[jo[Xo]]}
.descriptions=${[is]}
></wui-transaction-list-item>`}):x$5`
<wui-transaction-list-item
date=${fo}
.direction=${mo}
id=${io&&this.next?PAGINATOR_ID:""}
status=${Lo}
type=${zo}
.images=${jo}
.descriptions=${$o}
></wui-transaction-list-item>
`}templateTransactions(Fn,io){return Fn.map((fo,$o)=>{const mo=io&&$o===Fn.length-1;return x$5`${this.templateRenderTransaction(fo,mo)}`})}emptyStateActivity(){return x$5`<wui-flex
class="emptyContainer"
flexGrow="1"
flexDirection="column"
justifyContent="center"
alignItems="center"
.padding=${["3xl","xl","3xl","xl"]}
gap="xl"
>
<wui-icon-box
backgroundColor="gray-glass-005"
background="gray"
iconColor="fg-200"
icon="wallet"
size="lg"
?border=${!0}
borderColor="wui-color-bg-125"
></wui-icon-box>
<wui-flex flexDirection="column" alignItems="center" gap="xs">
<wui-text align="center" variant="paragraph-500" color="fg-100"
>No Transactions yet</wui-text
>
<wui-text align="center" variant="small-500" color="fg-200"
>Start trading on dApps <br />
to grow your wallet!</wui-text
>
</wui-flex>
</wui-flex>`}emptyStateAccount(){return x$5`<wui-flex
class="contentContainer"
alignItems="center"
justifyContent="center"
flexDirection="column"
gap="l"
>
<wui-icon-box
icon="swapHorizontal"
size="inherit"
iconColor="fg-200"
backgroundColor="fg-200"
iconSize="lg"
></wui-icon-box>
<wui-flex
class="textContent"
gap="xs"
flexDirection="column"
justifyContent="center"
flexDirection="column"
>
<wui-text variant="paragraph-500" align="center" color="fg-100">No activity yet</wui-text>
<wui-text variant="small-400" align="center" color="fg-200"
>Your next transactions will appear here</wui-text
>
</wui-flex>
<wui-link @click=${this.onReceiveClick.bind(this)}>Trade</wui-link>
</wui-flex>`}templateEmpty(){return this.page==="account"?x$5`${this.emptyStateAccount()}`:x$5`${this.emptyStateActivity()}`}templateLoading(){return this.page==="activity"?Array(LOADING_ITEM_COUNT).fill(x$5` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map(Fn=>Fn):null}onReceiveClick(){RouterController.push("WalletReceive")}createPaginationObserver(){const{projectId:Fn}=OptionsController.state;this.paginationObserver=new IntersectionObserver(([io])=>{io!=null&&io.isIntersecting&&!this.loading&&(TransactionsController.fetchTransactions(this.address),EventsController.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:this.address,projectId:Fn,cursor:this.next,isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}))},{}),this.setPaginationObserver()}setPaginationObserver(){var io,fo,$o;(io=this.paginationObserver)==null||io.disconnect();const Fn=(fo=this.shadowRoot)==null?void 0:fo.querySelector(`#${PAGINATOR_ID}`);Fn&&(($o=this.paginationObserver)==null||$o.observe(Fn))}getTransactionListItemProps(Fn){var Lo,Ho,zo,Go,Vo;const io=DateUtil.formatDate((Lo=Fn==null?void 0:Fn.metadata)==null?void 0:Lo.minedAt),fo=TransactionUtil.getTransactionDescriptions(Fn),$o=Fn==null?void 0:Fn.transfers,mo=(Ho=Fn==null?void 0:Fn.transfers)==null?void 0:Ho[0],Ao=!!mo&&((zo=Fn==null?void 0:Fn.transfers)==null?void 0:zo.every(Yo=>!!Yo.nft_info)),jo=TransactionUtil.getTransactionImages($o);return{date:io,direction:mo==null?void 0:mo.direction,descriptions:fo,isAllNFT:Ao,images:jo,status:(Go=Fn.metadata)==null?void 0:Go.status,transfers:$o,type:(Vo=Fn.metadata)==null?void 0:Vo.operationType}}};W3mActivityList.styles=styles$8;__decorate$m([n$7()],W3mActivityList.prototype,"page",void 0);__decorate$m([r$4()],W3mActivityList.prototype,"address",void 0);__decorate$m([r$4()],W3mActivityList.prototype,"transactionsByYear",void 0);__decorate$m([r$4()],W3mActivityList.prototype,"loading",void 0);__decorate$m([r$4()],W3mActivityList.prototype,"empty",void 0);__decorate$m([r$4()],W3mActivityList.prototype,"next",void 0);W3mActivityList=__decorate$m([customElement("w3m-activity-list")],W3mActivityList);const styles$7=i$6`
:host {
width: 100%;
height: 100px;
border-radius: var(--wui-border-radius-s);
border: 1px solid var(--wui-color-gray-glass-002);
background-color: var(--wui-color-gray-glass-002);
transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
will-change: background-color;
}
:host(:hover) {
background-color: var(--wui-color-gray-glass-005);
}
wui-flex {
width: 100%;
height: fit-content;
}
wui-button {
width: 100%;
display: flex;
justify-content: flex-end;
}
wui-input-amount {
mask-image: linear-gradient(
270deg,
transparent 0px,
transparent 8px,
black 24px,
black 25px,
black 32px,
black 100%
);
}
.totalValue {
width: 100%;
}
`;var __decorate$l=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mInputToken=class extends r$6{render(){return x$5` <wui-flex
flexDirection="column"
gap="4xs"
.padding=${["xl","s","l","l"]}
>
<wui-flex alignItems="center">
<wui-input-amount
@inputChange=${this.onInputChange.bind(this)}
?disabled=${!this.token&&!0}
.value=${this.sendTokenAmount?String(this.sendTokenAmount):""}
></wui-input-amount>
${this.buttonTemplate()}
</wui-flex>
<wui-flex alignItems="center" justifyContent="space-between">
${this.sendValueTemplate()}
<wui-flex alignItems="center" gap="4xs" justifyContent="flex-end">
${this.maxAmountTemplate()} ${this.actionTemplate()}
</wui-flex>
</wui-flex>
</wui-flex>`}buttonTemplate(){return this.token?x$5`<wui-token-button
text=${this.token.symbol}
imageSrc=${this.token.iconUrl}
@click=${this.handleSelectButtonClick.bind(this)}
>
</wui-token-button>`:x$5`<wui-button
size="md"
variant="accent"
@click=${this.handleSelectButtonClick.bind(this)}
>Select token</wui-button
>`}handleSelectButtonClick(){RouterController.push("WalletSendSelectToken")}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const io=this.token.price*this.sendTokenAmount;return x$5`<wui-text class="totalValue" variant="small-400" color="fg-200"
>${io?`$${UiHelperUtil.formatNumberToLocalString(io,2)}`:"Incorrect value"}</wui-text
>`}return null}maxAmountTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?x$5` <wui-text variant="small-400" color="error-100">
${UiHelperUtil.roundNumber(Number(this.token.quantity.numeric),6,5)}
</wui-text>`:x$5` <wui-text variant="small-400" color="fg-200">
${UiHelperUtil.roundNumber(Number(this.token.quantity.numeric),6,5)}
</wui-text>`:null}actionTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?x$5`<wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>`:x$5`<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>`:null}onInputChange(Fn){SendController.setTokenAmount(Fn.detail)}onMaxClick(){if(this.token&&typeof this.gasPrice<"u"){const Fn=this.token.address===void 0||Object.values(ConstantsUtil$1.NATIVE_TOKEN_ADDRESS).some($o=>{var mo;return((mo=this.token)==null?void 0:mo.address)===$o}),io=NumberUtil.bigNumber(this.gasPrice).shiftedBy(-this.token.quantity.decimals),fo=Fn?NumberUtil.bigNumber(this.token.quantity.numeric).minus(io):NumberUtil.bigNumber(this.token.quantity.numeric);SendController.setTokenAmount(Number(fo.toFixed(20)))}}onBuyClick(){RouterController.push("OnRampProviders")}};W3mInputToken.styles=styles$7;__decorate$l([n$7({type:Object})],W3mInputToken.prototype,"token",void 0);__decorate$l([n$7({type:Number})],W3mInputToken.prototype,"sendTokenAmount",void 0);__decorate$l([n$7({type:Number})],W3mInputToken.prototype,"gasPriceInUSD",void 0);__decorate$l([n$7({type:Number})],W3mInputToken.prototype,"gasPrice",void 0);W3mInputToken=__decorate$l([customElement("w3m-input-token")],W3mInputToken);const styles$6=i$6`
:host {
width: 100%;
height: 100px;
border-radius: var(--wui-border-radius-s);
border: 1px solid var(--wui-color-gray-glass-002);
background-color: var(--wui-color-gray-glass-002);
transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
will-change: background-color;
position: relative;
}
:host(:hover) {
background-color: var(--wui-color-gray-glass-005);
}
wui-flex {
width: 100%;
height: fit-content;
}
wui-button {
display: ruby;
color: var(--wui-color-fg-100);
margin: 0 var(--wui-spacing-xs);
}
.instruction {
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 2;
}
.paste {
display: inline-flex;
}
textarea {
background: transparent;
width: 100%;
font-family: var(--w3m-font-family);
font-size: var(--wui-font-size-medium);
font-style: normal;
font-weight: var(--wui-font-weight-light);
line-height: 130%;
letter-spacing: var(--wui-letter-spacing-medium);
color: var(--wui-color-fg-100);
caret-color: var(--wui-color-accent-100);
box-sizing: border-box;
-webkit-appearance: none;
-moz-appearance: textfield;
padding: 0px;
border: none;
outline: none;
appearance: none;
resize: none;
overflow: hidden;
}
`;var __decorate$k=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mInputAddress=class extends r$6{constructor(){super(...arguments),this.inputElementRef=e$1(),this.instructionElementRef=e$1(),this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=CoreHelperUtil.debounce(async Fn=>{const io=await ConnectionController.getEnsAddress(Fn);if(SendController.setLoading(!1),io){SendController.setReceiverProfileName(Fn),SendController.setReceiverAddress(io);const fo=await ConnectionController.getEnsAvatar(Fn);fo&&SendController.setReceiverProfileImageUrl(fo)}else SendController.setReceiverAddress(Fn),SendController.setReceiverProfileName(void 0),SendController.setReceiverProfileImageUrl(void 0)})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return x$5` <wui-flex
@click=${this.onBoxClick.bind(this)}
flexDirection="column"
justifyContent="center"
gap="4xs"
.padding=${["2xl","l","xl","l"]}
>
<wui-text
${n$5(this.instructionElementRef)}
class="instruction"
color="fg-300"
variant="medium-400"
>
Type or
<wui-button
class="paste"
size="md"
variant="neutral"
iconLeft="copy"
@click=${this.onPasteClick.bind(this)}
>
<wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon>
Paste
</wui-button>
address
</wui-text>
<textarea
spellcheck="false"
?disabled=${!this.instructionHidden}
${n$5(this.inputElementRef)}
@input=${this.onInputChange.bind(this)}
@blur=${this.onBlur.bind(this)}
.value=${this.value??""}
autocomplete="off"
>
${this.value??""}</textarea
>
</wui-flex>`}async focusInput(){var Fn;this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",(Fn=this.inputElementRef.value)==null||Fn.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){var Fn;this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",(Fn=this.inputElementRef.value)==null||Fn.blur())}async toggleInstructionFocus(Fn){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:Fn?0:1},{opacity:Fn?1:0}],{duration:100,easing:"ease",fill:"forwards"}).finished}onBoxClick(){!this.value&&!this.instructionHidden&&this.focusInput()}onBlur(){!this.value&&this.instructionHidden&&!this.pasting&&this.focusInstruction()}checkHidden(){this.instructionHidden&&this.focusInput()}async onPasteClick(){this.pasting=!0;const Fn=await navigator.clipboard.readText();SendController.setReceiverAddress(Fn),this.focusInput()}onInputChange(Fn){this.pasting=!1;const io=Fn.target;io.value&&!this.instructionHidden&&this.focusInput(),SendController.setLoading(!0),this.onDebouncedSearch(io.value)}};W3mInputAddress.styles=styles$6;__decorate$k([n$7()],W3mInputAddress.prototype,"value",void 0);__decorate$k([r$4()],W3mInputAddress.prototype,"instructionHidden",void 0);__decorate$k([r$4()],W3mInputAddress.prototype,"pasting",void 0);W3mInputAddress=__decorate$k([customElement("w3m-input-address")],W3mInputAddress);const styles$5=i$6`
:host {
display: flex;
width: auto;
flex-direction: column;
gap: var(--wui-border-radius-1xs);
border-radius: var(--wui-border-radius-s);
background: var(--wui-color-gray-glass-002);
padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs)
var(--wui-spacing-1xs);
}
wui-text {
padding: 0 var(--wui-spacing-1xs);
}
wui-flex {
margin-top: var(--wui-spacing-1xs);
}
.network {
cursor: pointer;
transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
will-change: background-color;
}
.network:focus-visible {
border: 1px solid var(--wui-color-accent-100);
background-color: var(--wui-color-gray-glass-005);
-webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
-moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
}
.network:hover {
background-color: var(--wui-color-gray-glass-005);
}
.network:active {
background-color: var(--wui-color-gray-glass-010);
}
`;var __decorate$j=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mWalletSendDetails=class extends r$6{render(){return x$5` <wui-text variant="small-400" color="fg-200">Details</wui-text>
<wui-flex flexDirection="column" gap="xxs">
<wui-list-content textTitle="Network cost" textValue="$${o$4(UiHelperUtil.formatNumberToLocalString(this.networkFee,2))}"></wui-list-content></wui-list-content>
<wui-list-content
textTitle="Address"
textValue=${UiHelperUtil.getTruncateString({string:this.receiverAddress??"",charsStart:4,charsEnd:4,truncate:"middle"})}
>
</wui-list-content>
${this.networkTemplate()}
</wui-flex>`}networkTemplate(){var Fn;return(Fn=this.caipNetwork)!=null&&Fn.name?x$5` <wui-list-content
@click=${()=>this.onNetworkClick(this.caipNetwork)}
class="network"
textTitle="Network"
imageSrc=${o$4(AssetUtil.getNetworkImage(this.caipNetwork))}
></wui-list-content>`:null}onNetworkClick(Fn){Fn&&RouterController.push("Networks",{network:Fn})}};W3mWalletSendDetails.styles=styles$5;__decorate$j([n$7()],W3mWalletSendDetails.prototype,"receiverAddress",void 0);__decorate$j([n$7({type:Object})],W3mWalletSendDetails.prototype,"caipNetwork",void 0);__decorate$j([n$7({type:Number})],W3mWalletSendDetails.prototype,"networkFee",void 0);W3mWalletSendDetails=__decorate$j([customElement("w3m-wallet-send-details")],W3mWalletSendDetails);const styles$4=i$6`
:host {
pointer-events: none;
}
:host > wui-flex {
display: var(--w3m-tooltip-display);
opacity: var(--w3m-tooltip-opacity);
padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s);
border-radius: var(--wui-border-radius-xxs);
color: var(--wui-color-bg-100);
position: fixed;
top: var(--w3m-tooltip-top);
left: var(--w3m-tooltip-left);
transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
max-width: calc(var(--w3m-modal-width) - var(--wui-spacing-xl));
transition: opacity 0.2s var(--wui-ease-out-power-2);
will-change: opacity;
}
:host([data-variant='shade']) > wui-flex {
background-color: var(--wui-color-bg-150);
border: 1px solid var(--wui-color-gray-glass-005);
}
:host([data-variant='shade']) > wui-flex > wui-text {
color: var(--wui-color-fg-150);
}
:host([data-variant='fill']) > wui-flex {
background-color: var(--wui-color-fg-100);
border: none;
}
wui-icon {
position: absolute;
width: 12px !important;
height: 4px !important;
color: var(--wui-color-bg-150);
}
wui-icon[data-placement='top'] {
bottom: 0px;
left: 50%;
transform: translate(-50%, 95%);
}
wui-icon[data-placement='bottom'] {
top: 0;
left: 50%;
transform: translate(-50%, -95%) rotate(180deg);
}
wui-icon[data-placement='right'] {
top: 50%;
left: 0;
transform: translate(-65%, -50%) rotate(90deg);
}
wui-icon[data-placement='left'] {
top: 50%;
right: 0%;
transform: translate(65%, -50%) rotate(270deg);
}
`;var __decorate$i=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mTooltip=class extends r$6{constructor(){super(),this.unsubscribe=[],this.open=TooltipController.state.open,this.message=TooltipController.state.message,this.triggerRect=TooltipController.state.triggerRect,this.variant=TooltipController.state.variant,this.unsubscribe.push(TooltipController.subscribe(Fn=>{this.open=Fn.open,this.message=Fn.message,this.triggerRect=Fn.triggerRect,this.variant=Fn.variant}))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){this.dataset.variant=this.variant;const Fn=this.triggerRect.top,io=this.triggerRect.left;return this.style.cssText=`
--w3m-tooltip-top: ${Fn}px;
--w3m-tooltip-left: ${io}px;
--w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;
--w3m-tooltip-display: ${this.open?"flex":"none"};
--w3m-tooltip-opacity: ${this.open?1:0};
`,x$5`<wui-flex>
<wui-icon data-placement="top" color="fg-100" size="inherit" name="cursor"></wui-icon>
<wui-text color="inherit" variant="small-500">${this.message}</wui-text>
</wui-flex>`}};W3mTooltip.styles=[styles$4];__decorate$i([r$4()],W3mTooltip.prototype,"open",void 0);__decorate$i([r$4()],W3mTooltip.prototype,"message",void 0);__decorate$i([r$4()],W3mTooltip.prototype,"triggerRect",void 0);__decorate$i([r$4()],W3mTooltip.prototype,"variant",void 0);W3mTooltip=__decorate$i([customElement("w3m-tooltip")],W3mTooltip);const styles$3=i$6`
:host {
width: 100%;
display: block;
}
`;var __decorate$h=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let WuiTooltipTrigger=class extends r$6{constructor(){super(),this.unsubscribe=[],this.text="",this.open=TooltipController.state.open,this.unsubscribe.push(RouterController.subscribeKey("view",()=>{TooltipController.hide()}),ModalController.subscribeKey("open",Fn=>{Fn||TooltipController.hide()}),TooltipController.subscribeKey("open",Fn=>{this.open=Fn}))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn()),TooltipController.hide()}render(){return x$5`
<div
@pointermove=${this.onMouseEnter.bind(this)}
@pointerleave=${this.onMouseLeave.bind(this)}
>
${this.renderChildren()}
</div>
`}renderChildren(){return x$5`<slot></slot> `}onMouseEnter(){const Fn=this.getBoundingClientRect();this.open||TooltipController.showTooltip({message:this.text,triggerRect:{width:Fn.width,height:Fn.height,left:Fn.left,top:Fn.top},variant:"shade"})}onMouseLeave(Fn){this.contains(Fn.relatedTarget)||TooltipController.hide()}};WuiTooltipTrigger.styles=[styles$3];__decorate$h([n$7()],WuiTooltipTrigger.prototype,"text",void 0);__decorate$h([r$4()],WuiTooltipTrigger.prototype,"open",void 0);WuiTooltipTrigger=__decorate$h([customElement("w3m-tooltip-trigger")],WuiTooltipTrigger);const styles$2=i$6`
:host > wui-flex:first-child {
margin-top: var(--wui-spacing-s);
}
wui-separator {
margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-m)
calc(var(--wui-spacing-m) * -1);
width: calc(100% + var(--wui-spacing-s) * 2);
}
`;var __decorate$g=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};const MAX_TOP_VIEW=2,MAXIMUM_LENGTH=6;let W3mSocialLoginWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.connector=this.connectors.find(Fn=>Fn.type==="AUTH"),this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>{this.connectors=Fn,this.connector=this.connectors.find(io=>io.type==="AUTH")}))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){return this.connector?x$5`
<wui-flex
class="container"
flexDirection="column"
gap="xs"
.padding=${["0","0","xs","0"]}
data-testid="w3m-social-login-widget"
>
${this.topViewTemplate()}${this.bottomViewTemplate()}
</wui-flex>
${this.separatorTemplate()}
`:null}topViewTemplate(){var Fn,io,fo,$o;return(io=(Fn=this.connector)==null?void 0:Fn.socials)!=null&&io.length?this.connector.socials.length===2?x$5` <wui-flex gap="xs">
${this.connector.socials.slice(0,MAX_TOP_VIEW).map(mo=>x$5`<wui-logo-select
data-testid=${`social-selector-${mo}`}
@click=${()=>{this.onSocialClick(mo)}}
logo=${mo}
></wui-logo-select>`)}
</wui-flex>`:x$5` <wui-list-social
data-testid=${`social-selector-${($o=(fo=this.connector)==null?void 0:fo.socials)==null?void 0:$o[0]}`}
@click=${()=>{var mo,Ao;this.onSocialClick((Ao=(mo=this.connector)==null?void 0:mo.socials)==null?void 0:Ao[0])}}
logo=${o$4(this.connector.socials[0])}
align="center"
name=${`Continue with ${this.connector.socials[0]}`}
></wui-list-social>`:null}bottomViewTemplate(){var Fn,io,fo,$o;return!((io=(Fn=this.connector)==null?void 0:Fn.socials)!=null&&io.length)||((fo=this.connector)==null?void 0:fo.socials.length)<=MAX_TOP_VIEW?null:(($o=this.connector)==null?void 0:$o.socials.length)>MAXIMUM_LENGTH?x$5`<wui-flex gap="xs">
${this.connector.socials.slice(1,MAXIMUM_LENGTH-1).map(mo=>x$5`<wui-logo-select
data-testid=${`social-selector-${mo}`}
@click=${()=>{this.onSocialClick(mo)}}
logo=${mo}
></wui-logo-select>`)}
<wui-logo-select logo="more" @click=${this.onMoreSocialsClick.bind(this)}></wui-logo-select>
</wui-flex>`:x$5`<wui-flex gap="xs">
${this.connector.socials.slice(1,this.connector.socials.length).map(mo=>x$5`<wui-logo-select
data-testid=${`social-selector-${mo}`}
@click=${()=>{this.onSocialClick(mo)}}
logo=${mo}
></wui-logo-select>`)}
</wui-flex>`}separatorTemplate(){return this.connectors.find(io=>io.type==="WALLET_CONNECT")?x$5`<wui-separator text="or"></wui-separator>`:null}onMoreSocialsClick(){RouterController.push("ConnectSocials")}async onSocialClick(Fn){var io,fo;if(Fn&&(AccountController.setSocialProvider(Fn,ChainController.state.activeChain),EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:Fn}})),Fn===SocialProviderEnum.Farcaster){RouterController.push("ConnectingFarcaster");const $o=ConnectorController.getAuthConnector();if($o&&!AccountController.state.farcasterUrl)try{const{url:mo}=await $o.provider.getFarcasterUri();AccountController.setFarcasterUrl(mo,ChainController.state.activeChain)}catch(mo){RouterController.goBack(),SnackController.showError(mo)}}else{RouterController.push("ConnectingSocial");const $o=ConnectorController.getAuthConnector();this.popupWindow=CoreHelperUtil.returnOpenHref("","popupWindow","width=600,height=800,scrollbars=yes");try{if($o&&Fn){const{uri:mo}=await $o.provider.getSocialRedirectUri({provider:Fn});if(this.popupWindow&&mo)AccountController.setSocialWindow(this.popupWindow,ChainController.state.activeChain),this.popupWindow.location.href=mo;else throw(io=this.popupWindow)==null||io.close(),new Error("Something went wrong")}}catch{(fo=this.popupWindow)==null||fo.close(),SnackController.showError("Something went wrong")}}}};W3mSocialLoginWidget.styles=styles$2;__decorate$g([r$4()],W3mSocialLoginWidget.prototype,"connectors",void 0);W3mSocialLoginWidget=__decorate$g([customElement("w3m-social-login-widget")],W3mSocialLoginWidget);var __decorate$f=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mWalletLoginList=class extends r$6{render(){return x$5`
<wui-flex flexDirection="column" gap="xs">
<w3m-connector-list></w3m-connector-list>
<w3m-all-wallets-widget></w3m-all-wallets-widget>
</wui-flex>
`}};W3mWalletLoginList=__decorate$f([customElement("w3m-wallet-login-list")],W3mWalletLoginList);const styles$1=i$6`
:host {
margin-top: var(--wui-spacing-3xs);
}
wui-separator {
margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
calc(var(--wui-spacing-m) * -1);
width: calc(100% + var(--wui-spacing-s) * 2);
}
`;var __decorate$e=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mSocialLoginList=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.connector=this.connectors.find(Fn=>Fn.type==="AUTH"),this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>{this.connectors=Fn,this.connector=this.connectors.find(io=>io.type==="AUTH")}))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){var Fn;return(Fn=this.connector)!=null&&Fn.socials?x$5` <wui-flex flexDirection="column" gap="xs">
${this.connector.socials.map(io=>x$5`<wui-list-social
@click=${()=>{this.onSocialClick(io)}}
name=${io}
logo=${io}
></wui-list-social>`)}
</wui-flex>`:null}async onSocialClick(Fn){var io,fo;if(Fn&&(AccountController.setSocialProvider(Fn,ChainController.state.activeChain),EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:Fn}})),Fn===SocialProviderEnum.Farcaster){RouterController.push("ConnectingFarcaster");const $o=ConnectorController.getAuthConnector();if($o&&!AccountController.state.farcasterUrl)try{const{url:mo}=await $o.provider.getFarcasterUri();AccountController.setFarcasterUrl(mo,ChainController.state.activeChain)}catch(mo){RouterController.goBack(),SnackController.showError(mo)}}else{RouterController.push("ConnectingSocial");const $o=ConnectorController.getAuthConnector();this.popupWindow=CoreHelperUtil.returnOpenHref("","popupWindow","width=600,height=800,scrollbars=yes");try{if($o&&Fn){const{uri:mo}=await $o.provider.getSocialRedirectUri({provider:Fn});if(this.popupWindow&&mo)AccountController.setSocialWindow(this.popupWindow,ChainController.state.activeChain),this.popupWindow.location.href=mo;else throw(io=this.popupWindow)==null||io.close(),new Error("Something went wrong")}}catch{(fo=this.popupWindow)==null||fo.close(),SnackController.showError("Something went wrong")}}}};W3mSocialLoginList.styles=styles$1;__decorate$e([r$4()],W3mSocialLoginList.prototype,"connectors",void 0);W3mSocialLoginList=__decorate$e([customElement("w3m-social-login-list")],W3mSocialLoginList);var __decorate$d=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectAnnouncedWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>this.connectors=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){const Fn=this.connectors.filter(io=>io.type==="ANNOUNCED");return Fn!=null&&Fn.length?x$5`
<wui-flex flexDirection="column" gap="xs">
${Fn.map(io=>{var fo,$o;return(fo=io.info)!=null&&fo.rdns&&ApiController.state.excludedRDNS&&ApiController.state.excludedRDNS.includes(($o=io==null?void 0:io.info)==null?void 0:$o.rdns)?null:x$5`
<wui-list-wallet
imageSrc=${o$4(AssetUtil.getConnectorImage(io))}
name=${io.name??"Unknown"}
@click=${()=>this.onConnector(io)}
tagVariant="success"
tagLabel="installed"
data-testid=${`wallet-selector-${io.id}`}
.installed=${!0}
>
</wui-list-wallet>
`})}
</wui-flex>
`:(this.style.cssText="display: none",null)}onConnector(Fn){Fn.type==="WALLET_CONNECT"?CoreHelperUtil.isMobile()?RouterController.push("AllWallets"):RouterController.push("ConnectingWalletConnect"):RouterController.push("ConnectingExternal",{connector:Fn})}};__decorate$d([r$4()],W3mConnectAnnouncedWidget.prototype,"connectors",void 0);W3mConnectAnnouncedWidget=__decorate$d([customElement("w3m-connect-announced-widget")],W3mConnectAnnouncedWidget);var __decorate$c=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectCustomWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>this.connectors=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){const{customWallets:Fn}=OptionsController.state;if(!(Fn!=null&&Fn.length))return this.style.cssText="display: none",null;const io=this.filterOutDuplicateWallets(Fn);return x$5`<wui-flex flexDirection="column" gap="xs">
${io.map(fo=>x$5`
<wui-list-wallet
imageSrc=${o$4(AssetUtil.getWalletImage(fo))}
name=${fo.name??"Unknown"}
@click=${()=>this.onConnectWallet(fo)}
data-testid=${`wallet-selector-${fo.id}`}
>
</wui-list-wallet>
`)}
</wui-flex>`}filterOutDuplicateWallets(Fn){const io=StorageUtil.getRecentWallets(),fo=this.connectors.map(jo=>{var Lo;return(Lo=jo.info)==null?void 0:Lo.rdns}).filter(Boolean),$o=io.map(jo=>jo.rdns).filter(Boolean),mo=fo.concat($o);if(mo.includes("io.metamask.mobile")&&CoreHelperUtil.isMobile()){const jo=mo.indexOf("io.metamask.mobile");mo[jo]="io.metamask"}return Fn.filter(jo=>!mo.includes(String(jo==null?void 0:jo.rdns)))}onConnectWallet(Fn){RouterController.push("ConnectingWalletConnect",{wallet:Fn})}};__decorate$c([r$4()],W3mConnectCustomWidget.prototype,"connectors",void 0);W3mConnectCustomWidget=__decorate$c([customElement("w3m-connect-custom-widget")],W3mConnectCustomWidget);const WalletUtil={filterOutDuplicatesByRDNS(Mn){const Fn=OptionsController.state.enableEIP6963?ConnectorController.state.connectors:[],io=StorageUtil.getRecentWallets(),fo=Fn.map(jo=>{var Lo;return(Lo=jo.info)==null?void 0:Lo.rdns}).filter(Boolean),$o=io.map(jo=>jo.rdns).filter(Boolean),mo=fo.concat($o);if(mo.includes("io.metamask.mobile")&&CoreHelperUtil.isMobile()){const jo=mo.indexOf("io.metamask.mobile");mo[jo]="io.metamask"}return Mn.filter(jo=>!mo.includes(String(jo==null?void 0:jo.rdns)))},filterOutDuplicatesByIds(Mn){const Fn=ConnectorController.state.connectors.filter(jo=>jo.type==="ANNOUNCED"||jo.type==="INJECTED"),io=StorageUtil.getRecentWallets(),fo=Fn.map(jo=>jo.explorerId),$o=io.map(jo=>jo.id),mo=fo.concat($o);return Mn.filter(jo=>!mo.includes(jo==null?void 0:jo.id))},filterOutDuplicateWallets(Mn){const Fn=this.filterOutDuplicatesByRDNS(Mn);return this.filterOutDuplicatesByIds(Fn)}};var __decorate$b=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectFeaturedWidget=class extends r$6{constructor(){super(...arguments),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){const{featured:Fn}=ApiController.state;if(!Fn.length)return this.style.cssText="display: none",null;const io=WalletUtil.filterOutDuplicateWallets(Fn);return x$5`
<wui-flex flexDirection="column" gap="xs">
${io.map(fo=>x$5`
<wui-list-wallet
imageSrc=${o$4(AssetUtil.getWalletImage(fo))}
name=${fo.name??"Unknown"}
@click=${()=>this.onConnectWallet(fo)}
>
</wui-list-wallet>
`)}
</wui-flex>
`}onConnectWallet(Fn){const io=ConnectorController.getConnector(Fn.id,Fn.rdns);io?RouterController.push("ConnectingExternal",{connector:io}):RouterController.push("ConnectingWalletConnect",{wallet:Fn})}};W3mConnectFeaturedWidget=__decorate$b([customElement("w3m-connect-featured-widget")],W3mConnectFeaturedWidget);var __decorate$a=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectInjectedWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>this.connectors=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){var io;const Fn=this.connectors.filter(fo=>fo.type==="INJECTED");return!(Fn!=null&&Fn.length)||Fn.length===1&&((io=Fn[0])==null?void 0:io.name)==="Browser Wallet"&&!CoreHelperUtil.isMobile()?(this.style.cssText="display: none",null):x$5`
<wui-flex flexDirection="column" gap="xs">
${Fn.map(fo=>{var $o,mo;return!CoreHelperUtil.isMobile()&&fo.name==="Browser Wallet"?null:ConnectionController.checkInstalled(void 0,fo.chain)?($o=fo.info)!=null&&$o.rdns&&ApiController.state.excludedRDNS&&ApiController.state.excludedRDNS.includes((mo=fo==null?void 0:fo.info)==null?void 0:mo.rdns)?null:x$5`
<wui-list-wallet
imageSrc=${o$4(AssetUtil.getConnectorImage(fo))}
.installed=${!0}
name=${fo.name??"Unknown"}
tagVariant="success"
tagLabel="installed"
data-testid=${`wallet-selector-${fo.id}`}
@click=${()=>this.onConnector(fo)}
>
</wui-list-wallet>
`:(this.style.cssText="display: none",null)})}
</wui-flex>
`}onConnector(Fn){ChainController.setActiveConnector(Fn),RouterController.push("ConnectingExternal",{connector:Fn})}};__decorate$a([r$4()],W3mConnectInjectedWidget.prototype,"connectors",void 0);W3mConnectInjectedWidget=__decorate$a([customElement("w3m-connect-injected-widget")],W3mConnectInjectedWidget);var __decorate$9=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectMultiChainWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>this.connectors=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){const Fn=this.connectors.filter(io=>io.type==="MULTI_CHAIN"&&io.name!=="WalletConnect");return Fn!=null&&Fn.length?x$5`
<wui-flex flexDirection="column" gap="xs">
${Fn.map(io=>x$5`
<wui-list-wallet
imageSrc=${o$4(AssetUtil.getConnectorImage(io))}
.installed=${!0}
name=${io.name??"Unknown"}
tagVariant="shade"
tagLabel="multichain"
data-testid=${`wallet-selector-${io.id}`}
@click=${()=>this.onConnector(io)}
>
</wui-list-wallet>
`)}
</wui-flex>
`:(this.style.cssText="display: none",null)}onConnector(Fn){ChainController.setActiveConnector(Fn),RouterController.push("ConnectingMultiChain")}};__decorate$9([r$4()],W3mConnectMultiChainWidget.prototype,"connectors",void 0);W3mConnectMultiChainWidget=__decorate$9([customElement("w3m-connect-multi-chain-widget")],W3mConnectMultiChainWidget);var __decorate$8=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectExternalWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>this.connectors=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){const io=this.connectors.filter(fo=>fo.type==="EXTERNAL").filter(fo=>fo.id!=="coinbaseWalletSDK");return io!=null&&io.length?x$5`
<wui-flex flexDirection="column" gap="xs">
${io.map(fo=>x$5`
<wui-list-wallet
imageSrc=${o$4(AssetUtil.getConnectorImage(fo))}
.installed=${!0}
name=${fo.name??"Unknown"}
data-testid=${`wallet-selector-external-${fo.id}`}
@click=${()=>this.onConnector(fo)}
>
</wui-list-wallet>
`)}
</wui-flex>
`:(this.style.cssText="display: none",null)}onConnector(Fn){RouterController.push("ConnectingExternal",{connector:Fn})}};__decorate$8([r$4()],W3mConnectExternalWidget.prototype,"connectors",void 0);W3mConnectExternalWidget=__decorate$8([customElement("w3m-connect-external-widget")],W3mConnectExternalWidget);var __decorate$7=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectRecentWidget=class extends r$6{render(){const Fn=StorageUtil.getRecentWallets();return Fn!=null&&Fn.length?x$5`
<wui-flex flexDirection="column" gap="xs">
${Fn.map(io=>x$5`
<wui-list-wallet
imageSrc=${o$4(AssetUtil.getWalletImage(io))}
name=${io.name??"Unknown"}
@click=${()=>this.onConnectWallet(io)}
tagLabel="recent"
tagVariant="shade"
>
</wui-list-wallet>
`)}
</wui-flex>
`:(this.style.cssText="display: none",null)}onConnectWallet(Fn){RouterController.push("ConnectingWalletConnect",{wallet:Fn})}};W3mConnectRecentWidget=__decorate$7([customElement("w3m-connect-recent-widget")],W3mConnectRecentWidget);var __decorate$6=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectRecommendedWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>this.connectors=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){if(!this.connectors.find(Vo=>Vo.type==="WALLET_CONNECT"))return null;const{recommended:io}=ApiController.state,{customWallets:fo,featuredWalletIds:$o}=OptionsController.state,{connectors:mo}=ConnectorController.state,Ao=StorageUtil.getRecentWallets(),Lo=mo.filter(Vo=>Vo.type==="INJECTED"||Vo.type==="ANNOUNCED").filter(Vo=>Vo.name!=="Browser Wallet");if($o||fo||!io.length)return this.style.cssText="display: none",null;const Ho=Lo.length+Ao.length,zo=Math.max(0,2-Ho),Go=WalletUtil.filterOutDuplicateWallets(io).slice(0,zo);return Go.length?x$5`
<wui-flex flexDirection="column" gap="xs">
${Go.map(Vo=>x$5`
<wui-list-wallet
imageSrc=${o$4(AssetUtil.getWalletImage(Vo))}
name=${(Vo==null?void 0:Vo.name)??"Unknown"}
@click=${()=>this.onConnectWallet(Vo)}
>
</wui-list-wallet>
`)}
</wui-flex>
`:(this.style.cssText="display: none",null)}onConnectWallet(Fn){const io=ConnectorController.getConnector(Fn.id,Fn.rdns);io?RouterController.push("ConnectingExternal",{connector:io}):RouterController.push("ConnectingWalletConnect",{wallet:Fn})}};__decorate$6([r$4()],W3mConnectRecommendedWidget.prototype,"connectors",void 0);W3mConnectRecommendedWidget=__decorate$6([customElement("w3m-connect-recommended-widget")],W3mConnectRecommendedWidget);var __decorate$5=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectWalletConnectWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>this.connectors=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){if(CoreHelperUtil.isMobile())return this.style.cssText="display: none",null;const Fn=this.connectors.find(io=>io.type==="WALLET_CONNECT");return Fn?x$5`
<wui-list-wallet
imageSrc=${o$4(AssetUtil.getConnectorImage(Fn))}
name=${Fn.name??"Unknown"}
@click=${()=>this.onConnector(Fn)}
tagLabel="qr code"
tagVariant="main"
data-testid="wallet-selector-walletconnect"
>
</wui-list-wallet>
`:(this.style.cssText="display: none",null)}onConnector(Fn){Fn.type==="WALLET_CONNECT"?CoreHelperUtil.isMobile()?RouterController.push("AllWallets"):RouterController.push("ConnectingWalletConnect"):RouterController.push("ConnectingExternal",{connector:Fn})}};__decorate$5([r$4()],W3mConnectWalletConnectWidget.prototype,"connectors",void 0);W3mConnectWalletConnectWidget=__decorate$5([customElement("w3m-connect-walletconnect-widget")],W3mConnectWalletConnectWidget);const styles=i$6`
:host {
margin-top: var(--wui-spacing-3xs);
}
wui-separator {
margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
calc(var(--wui-spacing-m) * -1);
width: calc(100% + var(--wui-spacing-s) * 2);
}
`;var __decorate$4=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mConnectorList=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>this.connectors=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){const{custom:Fn,recent:io,announced:fo,injected:$o,multiChain:mo,recommended:Ao,featured:jo,external:Lo}=this.getConnectorsByType();return x$5`
<wui-flex flexDirection="column" gap="xs">
<w3m-connect-walletconnect-widget></w3m-connect-walletconnect-widget>
${io.length?x$5`<w3m-connect-recent-widget></w3m-connect-recent-widget>`:null}
${mo.length?x$5`<w3m-connect-multi-chain-widget></w3m-connect-multi-chain-widget>`:null}
${fo.length?x$5`<w3m-connect-announced-widget></w3m-connect-announced-widget>`:null}
${$o.length?x$5`<w3m-connect-injected-widget></w3m-connect-injected-widget>`:null}
${jo.length?x$5`<w3m-connect-featured-widget></w3m-connect-featured-widget>`:null}
${Fn!=null&&Fn.length?x$5`<w3m-connect-custom-widget></w3m-connect-custom-widget>`:null}
${Lo.length?x$5`<w3m-connect-external-widget></w3m-connect-external-widget>`:null}
${Ao.length?x$5`<w3m-connect-recommended-widget></w3m-connect-recommended-widget>`:null}
</wui-flex>
`}getConnectorsByType(){const{featured:Fn,recommended:io}=ApiController.state,{customWallets:fo}=OptionsController.state,$o=StorageUtil.getRecentWallets(),mo=WalletUtil.filterOutDuplicateWallets(io),Ao=WalletUtil.filterOutDuplicateWallets(Fn),jo=this.connectors.filter(Yo=>Yo.type==="MULTI_CHAIN"),Lo=this.connectors.filter(Yo=>Yo.type==="ANNOUNCED"),Ho=this.connectors.filter(Yo=>Yo.type==="INJECTED"),zo=this.connectors.filter(Yo=>Yo.type==="EXTERNAL"),Vo=ChainController.state.activeChain===ConstantsUtil$2.CHAIN.EVM?OptionsController.state.enableEIP6963:!0;return{custom:fo,recent:$o,external:zo,multiChain:jo,announced:Vo?Lo:[],injected:Vo?Ho:[],recommended:mo,featured:Ao}}};W3mConnectorList.styles=styles;__decorate$4([r$4()],W3mConnectorList.prototype,"connectors",void 0);W3mConnectorList=__decorate$4([customElement("w3m-connector-list")],W3mConnectorList);var __decorate$3=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mAllWalletsWidget=class extends r$6{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.count=ApiController.state.count,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Fn=>this.connectors=Fn),ApiController.subscribeKey("count",Fn=>this.count=Fn))}disconnectedCallback(){this.unsubscribe.forEach(Fn=>Fn())}render(){const Fn=this.connectors.find(jo=>jo.type==="WALLET_CONNECT"),{allWallets:io}=OptionsController.state;if(!Fn||io==="HIDE"||io==="ONLY_MOBILE"&&!CoreHelperUtil.isMobile())return null;const fo=ApiController.state.featured.length,$o=this.count+fo,mo=$o<10?$o:Math.floor($o/10)*10,Ao=mo<$o?`${mo}+`:`${mo}`;return x$5`
<wui-list-wallet
name="All Wallets"
walletIcon="allWallets"
showAllWallets
@click=${this.onAllWallets.bind(this)}
tagLabel=${Ao}
tagVariant="shade"
data-testid="all-wallets"
></wui-list-wallet>
`}onAllWallets(){EventsController.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),RouterController.push("AllWallets")}};__decorate$3([r$4()],W3mAllWalletsWidget.prototype,"connectors",void 0);__decorate$3([r$4()],W3mAllWalletsWidget.prototype,"count",void 0);W3mAllWalletsWidget=__decorate$3([customElement("w3m-all-wallets-widget")],W3mAllWalletsWidget);var __decorate$2=function(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo};let W3mAccountAuthButton=class extends r$6{constructor(){super(...arguments),this.socialProvider=StorageUtil.getConnectedSocialProvider(),this.socialUsername=StorageUtil.getConnectedSocialUsername()}render(){const Fn=StorageUtil.getConnectedConnector(),io=ConnectorController.getAuthConnector();if(!io||Fn!=="AUTH")return this.style.cssText="display: none",null;const fo=io.provider.getEmail()??"";return x$5`
<wui-list-item
variant="icon"
iconVariant="overlay"
icon=${this.socialProvider??"mail"}
iconSize=${this.socialProvider?"xxl":"sm"}
data-testid="w3m-account-email-update"
?chevron=${!this.socialProvider}
@click=${()=>{this.onGoToUpdateEmail(fo,this.socialProvider)}}
>
<wui-text variant="paragraph-500" color="fg-100">${this.getAuthName(fo)}</wui-text>
</wui-list-item>
`}onGoToUpdateEmail(Fn,io){io||RouterController.push("UpdateEmailWallet",{email:Fn})}getAuthName(Fn){return this.socialUsername?this.socialProvider==="discord"&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:Fn.length>30?`${Fn.slice(0,-3)}...`:Fn}};W3mAccountAuthButton=__decorate$2([customElement("w3m-account-auth-button")],W3mAccountAuthButton);var __spreadArray=function(Mn,Fn,io){if(io||arguments.length===2)for(var fo=0,$o=Fn.length,mo;fo<$o;fo++)(mo||!(fo in Fn))&&(mo||(mo=Array.prototype.slice.call(Fn,0,fo)),mo[fo]=Fn[fo]);return Mn.concat(mo||Array.prototype.slice.call(Fn))},BrowserInfo=function(){function Mn(Fn,io,fo){this.name=Fn,this.version=io,this.os=fo,this.type="browser"}return Mn}(),NodeInfo=function(){function Mn(Fn){this.version=Fn,this.type="node",this.name="node",this.os=process$1$7.platform}return Mn}(),SearchBotDeviceInfo=function(){function Mn(Fn,io,fo,$o){this.name=Fn,this.version=io,this.os=fo,this.bot=$o,this.type="bot-device"}return Mn}(),BotInfo=function(){function Mn(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return Mn}(),ReactNativeInfo=function(){function Mn(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return Mn}(),SEARCHBOX_UA_REGEX$1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,SEARCHBOT_OS_REGEX=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,REQUIRED_VERSION_PARTS=3,userAgentRules$1=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",SEARCHBOX_UA_REGEX$1]],operatingSystemRules=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function detect(Mn){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ReactNativeInfo:typeof navigator<"u"?parseUserAgent(navigator.userAgent):getNodeVersion()}function matchUserAgent$1(Mn){return Mn!==""&&userAgentRules$1.reduce(function(Fn,io){var fo=io[0],$o=io[1];if(Fn)return Fn;var mo=$o.exec(Mn);return!!mo&&[fo,mo]},!1)}function parseUserAgent(Mn){var Fn=matchUserAgent$1(Mn);if(!Fn)return null;var io=Fn[0],fo=Fn[1];if(io==="searchbot")return new BotInfo;var $o=fo[1]&&fo[1].split(".").join("_").split("_").slice(0,3);$o?$o.length<REQUIRED_VERSION_PARTS&&($o=__spreadArray(__spreadArray([],$o,!0),createVersionParts(REQUIRED_VERSION_PARTS-$o.length),!0)):$o=[];var mo=$o.join("."),Ao=detectOS(Mn),jo=SEARCHBOT_OS_REGEX.exec(Mn);return jo&&jo[1]?new SearchBotDeviceInfo(io,mo,Ao,jo[1]):new BrowserInfo(io,mo,Ao)}function detectOS(Mn){for(var Fn=0,io=operatingSystemRules.length;Fn<io;Fn++){var fo=operatingSystemRules[Fn],$o=fo[0],mo=fo[1],Ao=mo.exec(Mn);if(Ao)return $o}return null}function getNodeVersion(){var Mn=typeof process$1$7<"u"&&process$1$7.version;return Mn?new NodeInfo(process$1$7.version.slice(1)):null}function createVersionParts(Mn){for(var Fn=[],io=0;io<Mn;io++)Fn.push("0");return Fn}var cjs$4={};/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var extendStatics=function(Mn,Fn){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(io,fo){io.__proto__=fo}||function(io,fo){for(var $o in fo)fo.hasOwnProperty($o)&&(io[$o]=fo[$o])},extendStatics(Mn,Fn)};function __extends$1(Mn,Fn){extendStatics(Mn,Fn);function io(){this.constructor=Mn}Mn.prototype=Fn===null?Object.create(Fn):(io.prototype=Fn.prototype,new io)}var __assign=function(){return __assign=Object.assign||function(Fn){for(var io,fo=1,$o=arguments.length;fo<$o;fo++){io=arguments[fo];for(var mo in io)Object.prototype.hasOwnProperty.call(io,mo)&&(Fn[mo]=io[mo])}return Fn},__assign.apply(this,arguments)};function __rest$7(Mn,Fn){var io={};for(var fo in Mn)Object.prototype.hasOwnProperty.call(Mn,fo)&&Fn.indexOf(fo)<0&&(io[fo]=Mn[fo]);if(Mn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $o=0,fo=Object.getOwnPropertySymbols(Mn);$o<fo.length;$o++)Fn.indexOf(fo[$o])<0&&Object.prototype.propertyIsEnumerable.call(Mn,fo[$o])&&(io[fo[$o]]=Mn[fo[$o]]);return io}function __decorate$1(Mn,Fn,io,fo){var $o=arguments.length,mo=$o<3?Fn:fo===null?fo=Object.getOwnPropertyDescriptor(Fn,io):fo,Ao;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")mo=Reflect.decorate(Mn,Fn,io,fo);else for(var jo=Mn.length-1;jo>=0;jo--)(Ao=Mn[jo])&&(mo=($o<3?Ao(mo):$o>3?Ao(Fn,io,mo):Ao(Fn,io))||mo);return $o>3&&mo&&Object.defineProperty(Fn,io,mo),mo}function __param(Mn,Fn){return function(io,fo){Fn(io,fo,Mn)}}function __metadata(Mn,Fn){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(Mn,Fn)}function __awaiter$11(Mn,Fn,io,fo){function $o(mo){return mo instanceof io?mo:new io(function(Ao){Ao(mo)})}return new(io||(io=Promise))(function(mo,Ao){function jo(zo){try{Ho(fo.next(zo))}catch(Go){Ao(Go)}}function Lo(zo){try{Ho(fo.throw(zo))}catch(Go){Ao(Go)}}function Ho(zo){zo.done?mo(zo.value):$o(zo.value).then(jo,Lo)}Ho((fo=fo.apply(Mn,Fn||[])).next())})}function __generator(Mn,Fn){var io={label:0,sent:function(){if(mo[0]&1)throw mo[1];return mo[1]},trys:[],ops:[]},fo,$o,mo,Ao;return Ao={next:jo(0),throw:jo(1),return:jo(2)},typeof Symbol=="function"&&(Ao[Symbol.iterator]=function(){return this}),Ao;function jo(Ho){return function(zo){return Lo([Ho,zo])}}function Lo(Ho){if(fo)throw new TypeError("Generator is already executing.");for(;io;)try{if(fo=1,$o&&(mo=Ho[0]&2?$o.return:Ho[0]?$o.throw||((mo=$o.return)&&mo.call($o),0):$o.next)&&!(mo=mo.call($o,Ho[1])).done)return mo;switch($o=0,mo&&(Ho=[Ho[0]&2,mo.value]),Ho[0]){case 0:case 1:mo=Ho;break;case 4:return io.label++,{value:Ho[1],done:!1};case 5:io.label++,$o=Ho[1],Ho=[0];continue;case 7:Ho=io.ops.pop(),io.trys.pop();continue;default:if(mo=io.trys,!(mo=mo.length>0&&mo[mo.length-1])&&(Ho[0]===6||Ho[0]===2)){io=0;continue}if(Ho[0]===3&&(!mo||Ho[1]>mo[0]&&Ho[1]<mo[3])){io.label=Ho[1];break}if(Ho[0]===6&&io.label<mo[1]){io.label=mo[1],mo=Ho;break}if(mo&&io.label<mo[2]){io.label=mo[2],io.ops.push(Ho);break}mo[2]&&io.ops.pop(),io.trys.pop();continue}Ho=Fn.call(Mn,io)}catch(zo){Ho=[6,zo],$o=0}finally{fo=mo=0}if(Ho[0]&5)throw Ho[1];return{value:Ho[0]?Ho[1]:void 0,done:!0}}}function __createBinding$5(Mn,Fn,io,fo){fo===void 0&&(fo=io),Mn[fo]=Fn[io]}function __exportStar(Mn,Fn){for(var io in Mn)io!=="default"&&!Fn.hasOwnProperty(io)&&(Fn[io]=Mn[io])}function __values(Mn){var Fn=typeof Symbol=="function"&&Symbol.iterator,io=Fn&&Mn[Fn],fo=0;if(io)return io.call(Mn);if(Mn&&typeof Mn.length=="number")return{next:function(){return Mn&&fo>=Mn.length&&(Mn=void 0),{value:Mn&&Mn[fo++],done:!Mn}}};throw new TypeError(Fn?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(Mn,Fn){var io=typeof Symbol=="function"&&Mn[Symbol.iterator];if(!io)return Mn;var fo=io.call(Mn),$o,mo=[],Ao;try{for(;(Fn===void 0||Fn-- >0)&&!($o=fo.next()).done;)mo.push($o.value)}catch(jo){Ao={error:jo}}finally{try{$o&&!$o.done&&(io=fo.return)&&io.call(fo)}finally{if(Ao)throw Ao.error}}return mo}function __spread(){for(var Mn=[],Fn=0;Fn<arguments.length;Fn++)Mn=Mn.concat(__read(arguments[Fn]));return Mn}function __spreadArrays(){for(var Mn=0,Fn=0,io=arguments.length;Fn<io;Fn++)Mn+=arguments[Fn].length;for(var fo=Array(Mn),$o=0,Fn=0;Fn<io;Fn++)for(var mo=arguments[Fn],Ao=0,jo=mo.length;Ao<jo;Ao++,$o++)fo[$o]=mo[Ao];return fo}function __await(Mn){return this instanceof __await?(this.v=Mn,this):new __await(Mn)}function __asyncGenerator(Mn,Fn,io){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var fo=io.apply(Mn,Fn||[]),$o,mo=[];return $o={},Ao("next"),Ao("throw"),Ao("return"),$o[Symbol.asyncIterator]=function(){return this},$o;function Ao(Vo){fo[Vo]&&($o[Vo]=function(Yo){return new Promise(function(Xo,is){mo.push([Vo,Yo,Xo,is])>1||jo(Vo,Yo)})})}function jo(Vo,Yo){try{Lo(fo[Vo](Yo))}catch(Xo){Go(mo[0][3],Xo)}}function Lo(Vo){Vo.value instanceof __await?Promise.resolve(Vo.value.v).then(Ho,zo):Go(mo[0][2],Vo)}function Ho(Vo){jo("next",Vo)}function zo(Vo){jo("throw",Vo)}function Go(Vo,Yo){Vo(Yo),mo.shift(),mo.length&&jo(mo[0][0],mo[0][1])}}function __asyncDelegator(Mn){var Fn,io;return Fn={},fo("next"),fo("throw",function($o){throw $o}),fo("return"),Fn[Symbol.iterator]=function(){return this},Fn;function fo($o,mo){Fn[$o]=Mn[$o]?function(Ao){return(io=!io)?{value:__await(Mn[$o](Ao)),done:$o==="return"}:mo?mo(Ao):Ao}:mo}}function __asyncValues(Mn){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Fn=Mn[Symbol.asyncIterator],io;return Fn?Fn.call(Mn):(Mn=typeof __values=="function"?__values(Mn):Mn[Symbol.iterator](),io={},fo("next"),fo("throw"),fo("return"),io[Symbol.asyncIterator]=function(){return this},io);function fo(mo){io[mo]=Mn[mo]&&function(Ao){return new Promise(function(jo,Lo){Ao=Mn[mo](Ao),$o(jo,Lo,Ao.done,Ao.value)})}}function $o(mo,Ao,jo,Lo){Promise.resolve(Lo).then(function(Ho){mo({value:Ho,done:jo})},Ao)}}function __makeTemplateObject(Mn,Fn){return Object.defineProperty?Object.defineProperty(Mn,"raw",{value:Fn}):Mn.raw=Fn,Mn}function __importStar$5(Mn){if(Mn&&Mn.__esModule)return Mn;var Fn={};if(Mn!=null)for(var io in Mn)Object.hasOwnProperty.call(Mn,io)&&(Fn[io]=Mn[io]);return Fn.default=Mn,Fn}function __importDefault$o(Mn){return Mn&&Mn.__esModule?Mn:{default:Mn}}function __classPrivateFieldGet(Mn,Fn){if(!Fn.has(Mn))throw new TypeError("attempted to get private field on non-instance");return Fn.get(Mn)}function __classPrivateFieldSet(Mn,Fn,io){if(!Fn.has(Mn))throw new TypeError("attempted to set private field on non-instance");return Fn.set(Mn,io),io}const tslib_es6=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return __assign},__asyncDelegator,__asyncGenerator,__asyncValues,__await,__awaiter:__awaiter$11,__classPrivateFieldGet,__classPrivateFieldSet,__createBinding:__createBinding$5,__decorate:__decorate$1,__exportStar,__extends:__extends$1,__generator,__importDefault:__importDefault$o,__importStar:__importStar$5,__makeTemplateObject,__metadata,__param,__read,__rest:__rest$7,__spread,__spreadArrays,__values},Symbol.toStringTag,{value:"Module"})),require$$0$9=getAugmentedNamespace(tslib_es6);var utils$n={},delay$1={},hasRequiredDelay;function requireDelay(){if(hasRequiredDelay)return delay$1;hasRequiredDelay=1,Object.defineProperty(delay$1,"__esModule",{value:!0}),delay$1.delay=void 0;function Mn(Fn){return new Promise(io=>{setTimeout(()=>{io(!0)},Fn)})}return delay$1.delay=Mn,delay$1}var convert={},constants$a={},misc={},hasRequiredMisc;function requireMisc(){return hasRequiredMisc||(hasRequiredMisc=1,Object.defineProperty(misc,"__esModule",{value:!0}),misc.ONE_THOUSAND=misc.ONE_HUNDRED=void 0,misc.ONE_HUNDRED=100,misc.ONE_THOUSAND=1e3),misc}var time$1={},hasRequiredTime;function requireTime(){return hasRequiredTime||(hasRequiredTime=1,function(Mn){Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.ONE_YEAR=Mn.FOUR_WEEKS=Mn.THREE_WEEKS=Mn.TWO_WEEKS=Mn.ONE_WEEK=Mn.THIRTY_DAYS=Mn.SEVEN_DAYS=Mn.FIVE_DAYS=Mn.THREE_DAYS=Mn.ONE_DAY=Mn.TWENTY_FOUR_HOURS=Mn.TWELVE_HOURS=Mn.SIX_HOURS=Mn.THREE_HOURS=Mn.ONE_HOUR=Mn.SIXTY_MINUTES=Mn.THIRTY_MINUTES=Mn.TEN_MINUTES=Mn.FIVE_MINUTES=Mn.ONE_MINUTE=Mn.SIXTY_SECONDS=Mn.THIRTY_SECONDS=Mn.TEN_SECONDS=Mn.FIVE_SECONDS=Mn.ONE_SECOND=void 0,Mn.ONE_SECOND=1,Mn.FIVE_SECONDS=5,Mn.TEN_SECONDS=10,Mn.THIRTY_SECONDS=30,Mn.SIXTY_SECONDS=60,Mn.ONE_MINUTE=Mn.SIXTY_SECONDS,Mn.FIVE_MINUTES=Mn.ONE_MINUTE*5,Mn.TEN_MINUTES=Mn.ONE_MINUTE*10,Mn.THIRTY_MINUTES=Mn.ONE_MINUTE*30,Mn.SIXTY_MINUTES=Mn.ONE_MINUTE*60,Mn.ONE_HOUR=Mn.SIXTY_MINUTES,Mn.THREE_HOURS=Mn.ONE_HOUR*3,Mn.SIX_HOURS=Mn.ONE_HOUR*6,Mn.TWELVE_HOURS=Mn.ONE_HOUR*12,Mn.TWENTY_FOUR_HOURS=Mn.ONE_HOUR*24,Mn.ONE_DAY=Mn.TWENTY_FOUR_HOURS,Mn.THREE_DAYS=Mn.ONE_DAY*3,Mn.FIVE_DAYS=Mn.ONE_DAY*5,Mn.SEVEN_DAYS=Mn.ONE_DAY*7,Mn.THIRTY_DAYS=Mn.ONE_DAY*30,Mn.ONE_WEEK=Mn.SEVEN_DAYS,Mn.TWO_WEEKS=Mn.ONE_WEEK*2,Mn.THREE_WEEKS=Mn.ONE_WEEK*3,Mn.FOUR_WEEKS=Mn.ONE_WEEK*4,Mn.ONE_YEAR=Mn.ONE_DAY*365}(time$1)),time$1}var hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,function(Mn){Object.defineProperty(Mn,"__esModule",{value:!0});const Fn=require$$0$9;Fn.__exportStar(requireMisc(),Mn),Fn.__exportStar(requireTime(),Mn)}(constants$a)),constants$a}var hasRequiredConvert;function requireConvert(){if(hasRequiredConvert)return convert;hasRequiredConvert=1,Object.defineProperty(convert,"__esModule",{value:!0}),convert.fromMiliseconds=convert.toMiliseconds=void 0;const Mn=requireConstants();function Fn(fo){return fo*Mn.ONE_THOUSAND}convert.toMiliseconds=Fn;function io(fo){return Math.floor(fo/Mn.ONE_THOUSAND)}return convert.fromMiliseconds=io,convert}var hasRequiredUtils;function requireUtils(){return hasRequiredUtils||(hasRequiredUtils=1,function(Mn){Object.defineProperty(Mn,"__esModule",{value:!0});const Fn=require$$0$9;Fn.__exportStar(requireDelay(),Mn),Fn.__exportStar(requireConvert(),Mn)}(utils$n)),utils$n}var watch$2={},hasRequiredWatch$1;function requireWatch$1(){if(hasRequiredWatch$1)return watch$2;hasRequiredWatch$1=1,Object.defineProperty(watch$2,"__esModule",{value:!0}),watch$2.Watch=void 0;class Mn{constructor(){this.timestamps=new Map}start(io){if(this.timestamps.has(io))throw new Error(`Watch already started for label: ${io}`);this.timestamps.set(io,{started:Date.now()})}stop(io){const fo=this.get(io);if(typeof fo.elapsed<"u")throw new Error(`Watch already stopped for label: ${io}`);const $o=Date.now()-fo.started;this.timestamps.set(io,{started:fo.started,elapsed:$o})}get(io){const fo=this.timestamps.get(io);if(typeof fo>"u")throw new Error(`No timestamp found for label: ${io}`);return fo}elapsed(io){const fo=this.get(io);return fo.elapsed||Date.now()-fo.started}}return watch$2.Watch=Mn,watch$2.default=Mn,watch$2}var types$6={},watch$1={},hasRequiredWatch;function requireWatch(){if(hasRequiredWatch)return watch$1;hasRequiredWatch=1,Object.defineProperty(watch$1,"__esModule",{value:!0}),watch$1.IWatch=void 0;class Mn{}return watch$1.IWatch=Mn,watch$1}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(Mn){Object.defineProperty(Mn,"__esModule",{value:!0}),require$$0$9.__exportStar(requireWatch(),Mn)}(types$6)),types$6}(function(Mn){Object.defineProperty(Mn,"__esModule",{value:!0});const Fn=require$$0$9;Fn.__exportStar(requireUtils(),Mn),Fn.__exportStar(requireWatch$1(),Mn),Fn.__exportStar(requireTypes(),Mn),Fn.__exportStar(requireConstants(),Mn)})(cjs$4);var cjs$3={};Object.defineProperty(cjs$3,"__esModule",{value:!0});cjs$3.getLocalStorage=cjs$3.getLocalStorageOrThrow=cjs$3.getCrypto=cjs$3.getCryptoOrThrow=getLocation_1=cjs$3.getLocation=cjs$3.getLocationOrThrow=getNavigator_1=cjs$3.getNavigator=cjs$3.getNavigatorOrThrow=getDocument_1=cjs$3.getDocument=cjs$3.getDocumentOrThrow=cjs$3.getFromWindowOrThrow=cjs$3.getFromWindow=void 0;function getFromWindow(Mn){let Fn;return typeof window<"u"&&typeof window[Mn]<"u"&&(Fn=window[Mn]),Fn}cjs$3.getFromWindow=getFromWindow;function getFromWindowOrThrow(Mn){const Fn=getFromWindow(Mn);if(!Fn)throw new Error(`${Mn} is not defined in Window`);return Fn}cjs$3.getFromWindowOrThrow=getFromWindowOrThrow;function getDocumentOrThrow(){return getFromWindowOrThrow("document")}cjs$3.getDocumentOrThrow=getDocumentOrThrow;function getDocument(){return getFromWindow("document")}var getDocument_1=cjs$3.getDocument=getDocument;function getNavigatorOrThrow(){return getFromWindowOrThrow("navigator")}cjs$3.getNavigatorOrThrow=getNavigatorOrThrow;function getNavigator(){return getFromWindow("navigator")}var getNavigator_1=cjs$3.getNavigator=getNavigator;function getLocationOrThrow(){return getFromWindowOrThrow("location")}cjs$3.getLocationOrThrow=getLocationOrThrow;function getLocation(){return getFromWindow("location")}var getLocation_1=cjs$3.getLocation=getLocation;function getCryptoOrThrow(){return getFromWindowOrThrow("crypto")}cjs$3.getCryptoOrThrow=getCryptoOrThrow;function getCrypto(){return getFromWindow("crypto")}cjs$3.getCrypto=getCrypto;function getLocalStorageOrThrow(){return getFromWindowOrThrow("localStorage")}cjs$3.getLocalStorageOrThrow=getLocalStorageOrThrow;function getLocalStorage(){return getFromWindow("localStorage")}cjs$3.getLocalStorage=getLocalStorage;var cjs$2={};Object.defineProperty(cjs$2,"__esModule",{value:!0});var getWindowMetadata_1=cjs$2.getWindowMetadata=void 0;const window_getters_1=cjs$3;function getWindowMetadata(){let Mn,Fn;try{Mn=window_getters_1.getDocumentOrThrow(),Fn=window_getters_1.getLocationOrThrow()}catch{return null}function io(){const Go=Mn.getElementsByTagName("link"),Vo=[];for(let Yo=0;Yo<Go.length;Yo++){const Xo=Go[Yo],is=Xo.getAttribute("rel");if(is&&is.toLowerCase().indexOf("icon")>-1){const yl=Xo.getAttribute("href");if(yl)if(yl.toLowerCase().indexOf("https:")===-1&&yl.toLowerCase().indexOf("http:")===-1&&yl.indexOf("//")!==0){let us=Fn.protocol+"//"+Fn.host;if(yl.indexOf("/")===0)us+=yl;else{const hs=Fn.pathname.split("/");hs.pop();const _l=hs.join("/");us+=_l+"/"+yl}Vo.push(us)}else if(yl.indexOf("//")===0){const us=Fn.protocol+yl;Vo.push(us)}else Vo.push(yl)}}return Vo}function fo(...Go){const Vo=Mn.getElementsByTagName("meta");for(let Yo=0;Yo<Vo.length;Yo++){const Xo=Vo[Yo],is=["itemprop","property","name"].map(yl=>Xo.getAttribute(yl)).filter(yl=>yl?Go.includes(yl):!1);if(is.length&&is){const yl=Xo.getAttribute("content");if(yl)return yl}}return""}function $o(){let Go=fo("name","og:site_name","og:title","twitter:title");return Go||(Go=Mn.title),Go}function mo(){return fo("description","og:description","twitter:description","keywords")}const Ao=$o(),jo=mo(),Lo=Fn.origin,Ho=io();return{description:jo,url:Lo,icons:Ho,name:Ao}}getWindowMetadata_1=cjs$2.getWindowMetadata=getWindowMetadata;var queryString={},strictUriEncode=Mn=>encodeURIComponent(Mn).replace(/[!'()*]/g,Fn=>`%${Fn.charCodeAt(0).toString(16).toUpperCase()}`),token="%[a-f0-9]{2}",singleMatcher=new RegExp("("+token+")|([^%]+?)","gi"),multiMatcher=new RegExp("("+token+")+","gi");function decodeComponents(Mn,Fn){try{return[decodeURIComponent(Mn.join(""))]}catch{}if(Mn.length===1)return Mn;Fn=Fn||1;var io=Mn.slice(0,Fn),fo=Mn.slice(Fn);return Array.prototype.concat.call([],decodeComponents(io),decodeComponents(fo))}function decode$3(Mn){try{return decodeURIComponent(Mn)}catch{for(var Fn=Mn.match(singleMatcher)||[],io=1;io<Fn.length;io++)Mn=decodeComponents(Fn,io).join(""),Fn=Mn.match(singleMatcher)||[];return Mn}}function customDecodeURIComponent(Mn){for(var Fn={"%FE%FF":"��","%FF%FE":"��"},io=multiMatcher.exec(Mn);io;){try{Fn[io[0]]=decodeURIComponent(io[0])}catch{var fo=decode$3(io[0]);fo!==io[0]&&(Fn[io[0]]=fo)}io=multiMatcher.exec(Mn)}Fn["%C2"]="�";for(var $o=Object.keys(Fn),mo=0;mo<$o.length;mo++){var Ao=$o[mo];Mn=Mn.replace(new RegExp(Ao,"g"),Fn[Ao])}return Mn}var decodeUriComponent=function(Mn){if(typeof Mn!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof Mn+"`");try{return Mn=Mn.replace(/\+/g," "),decodeURIComponent(Mn)}catch{return customDecodeURIComponent(Mn)}},splitOnFirst=(Mn,Fn)=>{if(!(typeof Mn=="string"&&typeof Fn=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(Fn==="")return[Mn];const io=Mn.indexOf(Fn);return io===-1?[Mn]:[Mn.slice(0,io),Mn.slice(io+Fn.length)]},filterObj=function(Mn,Fn){for(var io={},fo=Object.keys(Mn),$o=Array.isArray(Fn),mo=0;mo<fo.length;mo++){var Ao=fo[mo],jo=Mn[Ao];($o?Fn.indexOf(Ao)!==-1:Fn(Ao,jo,Mn))&&(io[Ao]=jo)}return io};(function(Mn){const Fn=strictUriEncode,io=decodeUriComponent,fo=splitOnFirst,$o=filterObj,mo=hs=>hs==null,Ao=Symbol("encodeFragmentIdentifier");function jo(hs){switch(hs.arrayFormat){case"index":return _l=>(xl,Il)=>{const Ol=xl.length;return Il===void 0||hs.skipNull&&Il===null||hs.skipEmptyString&&Il===""?xl:Il===null?[...xl,[zo(_l,hs),"[",Ol,"]"].join("")]:[...xl,[zo(_l,hs),"[",zo(Ol,hs),"]=",zo(Il,hs)].join("")]};case"bracket":return _l=>(xl,Il)=>Il===void 0||hs.skipNull&&Il===null||hs.skipEmptyString&&Il===""?xl:Il===null?[...xl,[zo(_l,hs),"[]"].join("")]:[...xl,[zo(_l,hs),"[]=",zo(Il,hs)].join("")];case"colon-list-separator":return _l=>(xl,Il)=>Il===void 0||hs.skipNull&&Il===null||hs.skipEmptyString&&Il===""?xl:Il===null?[...xl,[zo(_l,hs),":list="].join("")]:[...xl,[zo(_l,hs),":list=",zo(Il,hs)].join("")];case"comma":case"separator":case"bracket-separator":{const _l=hs.arrayFormat==="bracket-separator"?"[]=":"=";return xl=>(Il,Ol)=>Ol===void 0||hs.skipNull&&Ol===null||hs.skipEmptyString&&Ol===""?Il:(Ol=Ol===null?"":Ol,Il.length===0?[[zo(xl,hs),_l,zo(Ol,hs)].join("")]:[[Il,zo(Ol,hs)].join(hs.arrayFormatSeparator)])}default:return _l=>(xl,Il)=>Il===void 0||hs.skipNull&&Il===null||hs.skipEmptyString&&Il===""?xl:Il===null?[...xl,zo(_l,hs)]:[...xl,[zo(_l,hs),"=",zo(Il,hs)].join("")]}}function Lo(hs){let _l;switch(hs.arrayFormat){case"index":return(xl,Il,Ol)=>{if(_l=/\[(\d*)\]$/.exec(xl),xl=xl.replace(/\[\d*\]$/,""),!_l){Ol[xl]=Il;return}Ol[xl]===void 0&&(Ol[xl]={}),Ol[xl][_l[1]]=Il};case"bracket":return(xl,Il,Ol)=>{if(_l=/(\[\])$/.exec(xl),xl=xl.replace(/\[\]$/,""),!_l){Ol[xl]=Il;return}if(Ol[xl]===void 0){Ol[xl]=[Il];return}Ol[xl]=[].concat(Ol[xl],Il)};case"colon-list-separator":return(xl,Il,Ol)=>{if(_l=/(:list)$/.exec(xl),xl=xl.replace(/:list$/,""),!_l){Ol[xl]=Il;return}if(Ol[xl]===void 0){Ol[xl]=[Il];return}Ol[xl]=[].concat(Ol[xl],Il)};case"comma":case"separator":return(xl,Il,Ol)=>{const Tl=typeof Il=="string"&&Il.includes(hs.arrayFormatSeparator),Cl=typeof Il=="string"&&!Tl&&Go(Il,hs).includes(hs.arrayFormatSeparator);Il=Cl?Go(Il,hs):Il;const Nl=Tl||Cl?Il.split(hs.arrayFormatSeparator).map(Wl=>Go(Wl,hs)):Il===null?Il:Go(Il,hs);Ol[xl]=Nl};case"bracket-separator":return(xl,Il,Ol)=>{const Tl=/(\[\])$/.test(xl);if(xl=xl.replace(/\[\]$/,""),!Tl){Ol[xl]=Il&&Go(Il,hs);return}const Cl=Il===null?[]:Il.split(hs.arrayFormatSeparator).map(Nl=>Go(Nl,hs));if(Ol[xl]===void 0){Ol[xl]=Cl;return}Ol[xl]=[].concat(Ol[xl],Cl)};default:return(xl,Il,Ol)=>{if(Ol[xl]===void 0){Ol[xl]=Il;return}Ol[xl]=[].concat(Ol[xl],Il)}}}function Ho(hs){if(typeof hs!="string"||hs.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function zo(hs,_l){return _l.encode?_l.strict?Fn(hs):encodeURIComponent(hs):hs}function Go(hs,_l){return _l.decode?io(hs):hs}function Vo(hs){return Array.isArray(hs)?hs.sort():typeof hs=="object"?Vo(Object.keys(hs)).sort((_l,xl)=>Number(_l)-Number(xl)).map(_l=>hs[_l]):hs}function Yo(hs){const _l=hs.indexOf("#");return _l!==-1&&(hs=hs.slice(0,_l)),hs}function Xo(hs){let _l="";const xl=hs.indexOf("#");return xl!==-1&&(_l=hs.slice(xl)),_l}function is(hs){hs=Yo(hs);const _l=hs.indexOf("?");return _l===-1?"":hs.slice(_l+1)}function yl(hs,_l){return _l.parseNumbers&&!Number.isNaN(Number(hs))&&typeof hs=="string"&&hs.trim()!==""?hs=Number(hs):_l.parseBooleans&&hs!==null&&(hs.toLowerCase()==="true"||hs.toLowerCase()==="false")&&(hs=hs.toLowerCase()==="true"),hs}function us(hs,_l){_l=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},_l),Ho(_l.arrayFormatSeparator);const xl=Lo(_l),Il=Object.create(null);if(typeof hs!="string"||(hs=hs.trim().replace(/^[?#&]/,""),!hs))return Il;for(const Ol of hs.split("&")){if(Ol==="")continue;let[Tl,Cl]=fo(_l.decode?Ol.replace(/\+/g," "):Ol,"=");Cl=Cl===void 0?null:["comma","separator","bracket-separator"].includes(_l.arrayFormat)?Cl:Go(Cl,_l),xl(Go(Tl,_l),Cl,Il)}for(const Ol of Object.keys(Il)){const Tl=Il[Ol];if(typeof Tl=="object"&&Tl!==null)for(const Cl of Object.keys(Tl))Tl[Cl]=yl(Tl[Cl],_l);else Il[Ol]=yl(Tl,_l)}return _l.sort===!1?Il:(_l.sort===!0?Object.keys(Il).sort():Object.keys(Il).sort(_l.sort)).reduce((Ol,Tl)=>{const Cl=Il[Tl];return Cl&&typeof Cl=="object"&&!Array.isArray(Cl)?Ol[Tl]=Vo(Cl):Ol[Tl]=Cl,Ol},Object.create(null))}Mn.extract=is,Mn.parse=us,Mn.stringify=(hs,_l)=>{if(!hs)return"";_l=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},_l),Ho(_l.arrayFormatSeparator);const xl=Cl=>_l.skipNull&&mo(hs[Cl])||_l.skipEmptyString&&hs[Cl]==="",Il=jo(_l),Ol={};for(const Cl of Object.keys(hs))xl(Cl)||(Ol[Cl]=hs[Cl]);const Tl=Object.keys(Ol);return _l.sort!==!1&&Tl.sort(_l.sort),Tl.map(Cl=>{const Nl=hs[Cl];return Nl===void 0?"":Nl===null?zo(Cl,_l):Array.isArray(Nl)?Nl.length===0&&_l.arrayFormat==="bracket-separator"?zo(Cl,_l)+"[]":Nl.reduce(Il(Cl),[]).join("&"):zo(Cl,_l)+"="+zo(Nl,_l)}).filter(Cl=>Cl.length>0).join("&")},Mn.parseUrl=(hs,_l)=>{_l=Object.assign({decode:!0},_l);const[xl,Il]=fo(hs,"#");return Object.assign({url:xl.split("?")[0]||"",query:us(is(hs),_l)},_l&&_l.parseFragmentIdentifier&&Il?{fragmentIdentifier:Go(Il,_l)}:{})},Mn.stringifyUrl=(hs,_l)=>{_l=Object.assign({encode:!0,strict:!0,[Ao]:!0},_l);const xl=Yo(hs.url).split("?")[0]||"",Il=Mn.extract(hs.url),Ol=Mn.parse(Il,{sort:!1}),Tl=Object.assign(Ol,hs.query);let Cl=Mn.stringify(Tl,_l);Cl&&(Cl=`?${Cl}`);let Nl=Xo(hs.url);return hs.fragmentIdentifier&&(Nl=`#${_l[Ao]?zo(hs.fragmentIdentifier,_l):hs.fragmentIdentifier}`),`${xl}${Cl}${Nl}`},Mn.pick=(hs,_l,xl)=>{xl=Object.assign({parseFragmentIdentifier:!0,[Ao]:!1},xl);const{url:Il,query:Ol,fragmentIdentifier:Tl}=Mn.parseUrl(hs,xl);return Mn.stringifyUrl({url:Il,query:$o(Ol,_l),fragmentIdentifier:Tl},xl)},Mn.exclude=(hs,_l,xl)=>{const Il=Array.isArray(_l)?Ol=>!_l.includes(Ol):(Ol,Tl)=>!_l(Ol,Tl);return Mn.pick(hs,Il,xl)}})(queryString);var chacha20poly1305={},chacha={},binary={},int$1={};(function(Mn){Object.defineProperty(Mn,"__esModule",{value:!0});function Fn(jo,Lo){var Ho=jo>>>16&65535,zo=jo&65535,Go=Lo>>>16&65535,Vo=Lo&65535;return zo*Vo+(Ho*Vo+zo*Go<<16>>>0)|0}Mn.mul=Math.imul||Fn;function io(jo,Lo){return jo+Lo|0}Mn.add=io;function fo(jo,Lo){return jo-Lo|0}Mn.sub=fo;function $o(jo,Lo){return jo<<Lo|jo>>>32-Lo}Mn.rotl=$o;function mo(jo,Lo){return jo<<32-Lo|jo>>>Lo}Mn.rotr=mo;function Ao(jo){return typeof jo=="number"&&isFinite(jo)&&Math.floor(jo)===jo}Mn.isInteger=Number.isInteger||Ao,Mn.MAX_SAFE_INTEGER=9007199254740991,Mn.isSafeInteger=function(jo){return Mn.isInteger(jo)&&jo>=-Mn.MAX_SAFE_INTEGER&&jo<=Mn.MAX_SAFE_INTEGER}})(int$1);Object.defineProperty(binary,"__esModule",{value:!0});var int_1=int$1;function readInt16BE(Mn,Fn){return Fn===void 0&&(Fn=0),(Mn[Fn+0]<<8|Mn[Fn+1])<<16>>16}binary.readInt16BE=readInt16BE;function readUint16BE(Mn,Fn){return Fn===void 0&&(Fn=0),(Mn[Fn+0]<<8|Mn[Fn+1])>>>0}binary.readUint16BE=readUint16BE;function readInt16LE(Mn,Fn){return Fn===void 0&&(Fn=0),(Mn[Fn+1]<<8|Mn[Fn])<<16>>16}binary.readInt16LE=readInt16LE;function readUint16LE(Mn,Fn){return Fn===void 0&&(Fn=0),(Mn[Fn+1]<<8|Mn[Fn])>>>0}binary.readUint16LE=readUint16LE;function writeUint16BE(Mn,Fn,io){return Fn===void 0&&(Fn=new Uint8Array(2)),io===void 0&&(io=0),Fn[io+0]=Mn>>>8,Fn[io+1]=Mn>>>0,Fn}binary.writeUint16BE=writeUint16BE;binary.writeInt16BE=writeUint16BE;function writeUint16LE(Mn,Fn,io){return Fn===void 0&&(Fn=new Uint8Array(2)),io===void 0&&(io=0),Fn[io+0]=Mn>>>0,Fn[io+1]=Mn>>>8,Fn}binary.writeUint16LE=writeUint16LE;binary.writeInt16LE=writeUint16LE;function readInt32BE(Mn,Fn){return Fn===void 0&&(Fn=0),Mn[Fn]<<24|Mn[Fn+1]<<16|Mn[Fn+2]<<8|Mn[Fn+3]}binary.readInt32BE=readInt32BE;function readUint32BE(Mn,Fn){return Fn===void 0&&(Fn=0),(Mn[Fn]<<24|Mn[Fn+1]<<16|Mn[Fn+2]<<8|Mn[Fn+3])>>>0}binary.readUint32BE=readUint32BE;function readInt32LE(Mn,Fn){return Fn===void 0&&(Fn=0),Mn[Fn+3]<<24|Mn[Fn+2]<<16|Mn[Fn+1]<<8|Mn[Fn]}binary.readInt32LE=readInt32LE;function readUint32LE(Mn,Fn){return Fn===void 0&&(Fn=0),(Mn[Fn+3]<<24|Mn[Fn+2]<<16|Mn[Fn+1]<<8|Mn[Fn])>>>0}binary.readUint32LE=readUint32LE;function writeUint32BE(Mn,Fn,io){return Fn===void 0&&(Fn=new Uint8Array(4)),io===void 0&&(io=0),Fn[io+0]=Mn>>>24,Fn[io+1]=Mn>>>16,Fn[io+2]=Mn>>>8,Fn[io+3]=Mn>>>0,Fn}binary.writeUint32BE=writeUint32BE;binary.writeInt32BE=writeUint32BE;function writeUint32LE(Mn,Fn,io){return Fn===void 0&&(Fn=new Uint8Array(4)),io===void 0&&(io=0),Fn[io+0]=Mn>>>0,Fn[io+1]=Mn>>>8,Fn[io+2]=Mn>>>16,Fn[io+3]=Mn>>>24,Fn}binary.writeUint32LE=writeUint32LE;binary.writeInt32LE=writeUint32LE;function readInt64BE(Mn,Fn){Fn===void 0&&(Fn=0);var io=readInt32BE(Mn,Fn),fo=readInt32BE(Mn,Fn+4);return io*4294967296+fo-(fo>>31)*4294967296}binary.readInt64BE=readInt64BE;function readUint64BE(Mn,Fn){Fn===void 0&&(Fn=0);var io=readUint32BE(Mn,Fn),fo=readUint32BE(Mn,Fn+4);return io*4294967296+fo}binary.readUint64BE=readUint64BE;function readInt64LE(Mn,Fn){Fn===void 0&&(Fn=0);var io=readInt32LE(Mn,Fn),fo=readInt32LE(Mn,Fn+4);return fo*4294967296+io-(io>>31)*4294967296}binary.readInt64LE=readInt64LE;function readUint64LE(Mn,Fn){Fn===void 0&&(Fn=0);var io=readUint32LE(Mn,Fn),fo=readUint32LE(Mn,Fn+4);return fo*4294967296+io}binary.readUint64LE=readUint64LE;function writeUint64BE(Mn,Fn,io){return Fn===void 0&&(Fn=new Uint8Array(8)),io===void 0&&(io=0),writeUint32BE(Mn/4294967296>>>0,Fn,io),writeUint32BE(Mn>>>0,Fn,io+4),Fn}binary.writeUint64BE=writeUint64BE;binary.writeInt64BE=writeUint64BE;function writeUint64LE(Mn,Fn,io){return Fn===void 0&&(Fn=new Uint8Array(8)),io===void 0&&(io=0),writeUint32LE(Mn>>>0,Fn,io),writeUint32LE(Mn/4294967296>>>0,Fn,io+4),Fn}binary.writeUint64LE=writeUint64LE;binary.writeInt64LE=writeUint64LE;function readUintBE(Mn,Fn,io){if(io===void 0&&(io=0),Mn%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(Mn/8>Fn.length-io)throw new Error("readUintBE: array is too short for the given bitLength");for(var fo=0,$o=1,mo=Mn/8+io-1;mo>=io;mo--)fo+=Fn[mo]*$o,$o*=256;return fo}binary.readUintBE=readUintBE;function readUintLE(Mn,Fn,io){if(io===void 0&&(io=0),Mn%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(Mn/8>Fn.length-io)throw new Error("readUintLE: array is too short for the given bitLength");for(var fo=0,$o=1,mo=io;mo<io+Mn/8;mo++)fo+=Fn[mo]*$o,$o*=256;return fo}binary.readUintLE=readUintLE;function writeUintBE(Mn,Fn,io,fo){if(io===void 0&&(io=new Uint8Array(Mn/8)),fo===void 0&&(fo=0),Mn%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(Fn))throw new Error("writeUintBE value must be an integer");for(var $o=1,mo=Mn/8+fo-1;mo>=fo;mo--)io[mo]=Fn/$o&255,$o*=256;return io}binary.writeUintBE=writeUintBE;function writeUintLE(Mn,Fn,io,fo){if(io===void 0&&(io=new Uint8Array(Mn/8)),fo===void 0&&(fo=0),Mn%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(Fn))throw new Error("writeUintLE value must be an integer");for(var $o=1,mo=fo;mo<fo+Mn/8;mo++)io[mo]=Fn/$o&255,$o*=256;return io}binary.writeUintLE=writeUintLE;function readFloat32BE(Mn,Fn){Fn===void 0&&(Fn=0);var io=new DataView(Mn.buffer,Mn.byteOffset,Mn.byteLength);return io.getFloat32(Fn)}binary.readFloat32BE=readFloat32BE;function readFloat32LE(Mn,Fn){Fn===void 0&&(Fn=0);var io=new DataView(Mn.buffer,Mn.byteOffset,Mn.byteLength);return io.getFloat32(Fn,!0)}binary.readFloat32LE=readFloat32LE;function readFloat64BE(Mn,Fn){Fn===void 0&&(Fn=0);var io=new DataView(Mn.buffer,Mn.byteOffset,Mn.byteLength);return io.getFloat64(Fn)}binary.readFloat64BE=readFloat64BE;function readFloat64LE(Mn,Fn){Fn===void 0&&(Fn=0);var io=new DataView(Mn.buffer,Mn.byteOffset,Mn.byteLength);return io.getFloat64(Fn,!0)}binary.readFloat64LE=readFloat64LE;function writeFloat32BE(Mn,Fn,io){Fn===void 0&&(Fn=new Uint8Array(4)),io===void 0&&(io=0);var fo=new DataView(Fn.buffer,Fn.byteOffset,Fn.byteLength);return fo.setFloat32(io,Mn),Fn}binary.writeFloat32BE=writeFloat32BE;function writeFloat32LE(Mn,Fn,io){Fn===void 0&&(Fn=new Uint8Array(4)),io===void 0&&(io=0);var fo=new DataView(Fn.buffer,Fn.byteOffset,Fn.byteLength);return fo.setFloat32(io,Mn,!0),Fn}binary.writeFloat32LE=writeFloat32LE;function writeFloat64BE(Mn,Fn,io){Fn===void 0&&(Fn=new Uint8Array(8)),io===void 0&&(io=0);var fo=new DataView(Fn.buffer,Fn.byteOffset,Fn.byteLength);return fo.setFloat64(io,Mn),Fn}binary.writeFloat64BE=writeFloat64BE;function writeFloat64LE(Mn,Fn,io){Fn===void 0&&(Fn=new Uint8Array(8)),io===void 0&&(io=0);var fo=new DataView(Fn.buffer,Fn.byteOffset,Fn.byteLength);return fo.setFloat64(io,Mn,!0),Fn}binary.writeFloat64LE=writeFloat64LE;var wipe$1={};Object.defineProperty(wipe$1,"__esModule",{value:!0});function wipe(Mn){for(var Fn=0;Fn<Mn.length;Fn++)Mn[Fn]=0;return Mn}wipe$1.wipe=wipe;Object.defineProperty(chacha,"__esModule",{value:!0});var binary_1=binary,wipe_1$3=wipe$1,ROUNDS=20;function core(Mn,Fn,io){for(var fo=1634760805,$o=857760878,mo=2036477234,Ao=1797285236,jo=io[3]<<24|io[2]<<16|io[1]<<8|io[0],Lo=io[7]<<24|io[6]<<16|io[5]<<8|io[4],Ho=io[11]<<24|io[10]<<16|io[9]<<8|io[8],zo=io[15]<<24|io[14]<<16|io[13]<<8|io[12],Go=io[19]<<24|io[18]<<16|io[17]<<8|io[16],Vo=io[23]<<24|io[22]<<16|io[21]<<8|io[20],Yo=io[27]<<24|io[26]<<16|io[25]<<8|io[24],Xo=io[31]<<24|io[30]<<16|io[29]<<8|io[28],is=Fn[3]<<24|Fn[2]<<16|Fn[1]<<8|Fn[0],yl=Fn[7]<<24|Fn[6]<<16|Fn[5]<<8|Fn[4],us=Fn[11]<<24|Fn[10]<<16|Fn[9]<<8|Fn[8],hs=Fn[15]<<24|Fn[14]<<16|Fn[13]<<8|Fn[12],_l=fo,xl=$o,Il=mo,Ol=Ao,Tl=jo,Cl=Lo,Nl=Ho,Wl=zo,Dl=Go,Rl=Vo,Qo=Yo,Jo=Xo,rs=is,ps=yl,_c=us,$l=hs,El=0;El<ROUNDS;El+=2)_l=_l+Tl|0,rs^=_l,rs=rs>>>16|rs<<16,Dl=Dl+rs|0,Tl^=Dl,Tl=Tl>>>20|Tl<<12,xl=xl+Cl|0,ps^=xl,ps=ps>>>16|ps<<16,Rl=Rl+ps|0,Cl^=Rl,Cl=Cl>>>20|Cl<<12,Il=Il+Nl|0,_c^=Il,_c=_c>>>16|_c<<16,Qo=Qo+_c|0,Nl^=Qo,Nl=Nl>>>20|Nl<<12,Ol=Ol+Wl|0,$l^=Ol,$l=$l>>>16|$l<<16,Jo=Jo+$l|0,Wl^=Jo,Wl=Wl>>>20|Wl<<12,Il=Il+Nl|0,_c^=Il,_c=_c>>>24|_c<<8,Qo=Qo+_c|0,Nl^=Qo,Nl=Nl>>>25|Nl<<7,Ol=Ol+Wl|0,$l^=Ol,$l=$l>>>24|$l<<8,Jo=Jo+$l|0,Wl^=Jo,Wl=Wl>>>25|Wl<<7,xl=xl+Cl|0,ps^=xl,ps=ps>>>24|ps<<8,Rl=Rl+ps|0,Cl^=Rl,Cl=Cl>>>25|Cl<<7,_l=_l+Tl|0,rs^=_l,rs=rs>>>24|rs<<8,Dl=Dl+rs|0,Tl^=Dl,Tl=Tl>>>25|Tl<<7,_l=_l+Cl|0,$l^=_l,$l=$l>>>16|$l<<16,Qo=Qo+$l|0,Cl^=Qo,Cl=Cl>>>20|Cl<<12,xl=xl+Nl|0,rs^=xl,rs=rs>>>16|rs<<16,Jo=Jo+rs|0,Nl^=Jo,Nl=Nl>>>20|Nl<<12,Il=Il+Wl|0,ps^=Il,ps=ps>>>16|ps<<16,Dl=Dl+ps|0,Wl^=Dl,Wl=Wl>>>20|Wl<<12,Ol=Ol+Tl|0,_c^=Ol,_c=_c>>>16|_c<<16,Rl=Rl+_c|0,Tl^=Rl,Tl=Tl>>>20|Tl<<12,Il=Il+Wl|0,ps^=Il,ps=ps>>>24|ps<<8,Dl=Dl+ps|0,Wl^=Dl,Wl=Wl>>>25|Wl<<7,Ol=Ol+Tl|0,_c^=Ol,_c=_c>>>24|_c<<8,Rl=Rl+_c|0,Tl^=Rl,Tl=Tl>>>25|Tl<<7,xl=xl+Nl|0,rs^=xl,rs=rs>>>24|rs<<8,Jo=Jo+rs|0,Nl^=Jo,Nl=Nl>>>25|Nl<<7,_l=_l+Cl|0,$l^=_l,$l=$l>>>24|$l<<8,Qo=Qo+$l|0,Cl^=Qo,Cl=Cl>>>25|Cl<<7;binary_1.writeUint32LE(_l+fo|0,Mn,0),binary_1.writeUint32LE(xl+$o|0,Mn,4),binary_1.writeUint32LE(Il+mo|0,Mn,8),binary_1.writeUint32LE(Ol+Ao|0,Mn,12),binary_1.writeUint32LE(Tl+jo|0,Mn,16),binary_1.writeUint32LE(Cl+Lo|0,Mn,20),binary_1.writeUint32LE(Nl+Ho|0,Mn,24),binary_1.writeUint32LE(Wl+zo|0,Mn,28),binary_1.writeUint32LE(Dl+Go|0,Mn,32),binary_1.writeUint32LE(Rl+Vo|0,Mn,36),binary_1.writeUint32LE(Qo+Yo|0,Mn,40),binary_1.writeUint32LE(Jo+Xo|0,Mn,44),binary_1.writeUint32LE(rs+is|0,Mn,48),binary_1.writeUint32LE(ps+yl|0,Mn,52),binary_1.writeUint32LE(_c+us|0,Mn,56),binary_1.writeUint32LE($l+hs|0,Mn,60)}function streamXOR(Mn,Fn,io,fo,$o){if($o===void 0&&($o=0),Mn.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(fo.length<io.length)throw new Error("ChaCha: destination is shorter than source");var mo,Ao;if($o===0){if(Fn.length!==8&&Fn.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");mo=new Uint8Array(16),Ao=mo.length-Fn.length,mo.set(Fn,Ao)}else{if(Fn.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");mo=Fn,Ao=$o}for(var jo=new Uint8Array(64),Lo=0;Lo<io.length;Lo+=64){core(jo,mo,Mn);for(var Ho=Lo;Ho<Lo+64&&Ho<io.length;Ho++)fo[Ho]=io[Ho]^jo[Ho-Lo];incrementCounter(mo,0,Ao)}return wipe_1$3.wipe(jo),$o===0&&wipe_1$3.wipe(mo),fo}chacha.streamXOR=streamXOR;function stream(Mn,Fn,io,fo){return fo===void 0&&(fo=0),wipe_1$3.wipe(io),streamXOR(Mn,Fn,io,io,fo)}chacha.stream=stream;function incrementCounter(Mn,Fn,io){for(var fo=1;io--;)fo=fo+(Mn[Fn]&255)|0,Mn[Fn]=fo&255,fo>>>=8,Fn++;if(fo>0)throw new Error("ChaCha: counter overflow")}var poly1305={},constantTime={};Object.defineProperty(constantTime,"__esModule",{value:!0});function select(Mn,Fn,io){return~(Mn-1)&Fn|Mn-1&io}constantTime.select=select;function lessOrEqual(Mn,Fn){return(Mn|0)-(Fn|0)-1>>>31&1}constantTime.lessOrEqual=lessOrEqual;function compare$c(Mn,Fn){if(Mn.length!==Fn.length)return 0;for(var io=0,fo=0;fo<Mn.length;fo++)io|=Mn[fo]^Fn[fo];return 1&io-1>>>8}constantTime.compare=compare$c;function equal(Mn,Fn){return Mn.length===0||Fn.length===0?!1:compare$c(Mn,Fn)!==0}constantTime.equal=equal;(function(Mn){Object.defineProperty(Mn,"__esModule",{value:!0});var Fn=constantTime,io=wipe$1;Mn.DIGEST_LENGTH=16;var fo=function(){function Ao(jo){this.digestLength=Mn.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var Lo=jo[0]|jo[1]<<8;this._r[0]=Lo&8191;var Ho=jo[2]|jo[3]<<8;this._r[1]=(Lo>>>13|Ho<<3)&8191;var zo=jo[4]|jo[5]<<8;this._r[2]=(Ho>>>10|zo<<6)&7939;var Go=jo[6]|jo[7]<<8;this._r[3]=(zo>>>7|Go<<9)&8191;var Vo=jo[8]|jo[9]<<8;this._r[4]=(Go>>>4|Vo<<12)&255,this._r[5]=Vo>>>1&8190;var Yo=jo[10]|jo[11]<<8;this._r[6]=(Vo>>>14|Yo<<2)&8191;var Xo=jo[12]|jo[13]<<8;this._r[7]=(Y{"ActionError":{"index":0,"kind":{"FunctionCallError":{"CompilationError":{"CodeDoesNotExist":{"account_id":"web4.nearbuilders.testnet"}}}}}}
1 automatic refund step from the network not shown.
This page reads FastNEAR's public transaction index and stores nothing. This command asks a NEAR archival node for the same transaction and needs no keys.
curl -s https://archival-rpc.testnet.fastnear.com -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tx","params":{"tx_hash":"7TfXiDQSbPPr96VaEVDnYfTuwcqxkDTvrtviHjXyksJb","sender_account_id":"web4.nearbuilders.testnet","wait_until":"FINAL"}}'Vouch has its own page because testnet.nearblocks.io stopped indexing on 27 Sep 2026, so it can't show newer transactions.