1import{l as b,n as x,a as O,C as g,t as V,_ as a,o as c,R as h,N as E,M as K,S as y,e as Q,z as X,H as G,r as Y,m as J,a2 as H,a3 as L,E as Z}from"./index-BIORMvyr.js";import{n as d,r as u,c as v,U as I,o as ee}from"./index-CpfTOVbp.js";import"./index-BHcJ4DMo.js";import"./index-BptpsUrD.js";import"./index-BiNkYFaC.js";import{e as M,n as q}from"./ref-MQa39_Jq.js";import"./index-CpsoUYLr.js";import"./index-CIXF30Qt.js";import"./index-CMaInidy.js";import{S as P}from"./SwapController-_-_mM67n.js";import"./index-D8D72RhJ.js";import"./index-B2BnwR-U.js";import"./index-DAG8zYix.js";import"./index-Deo8FYYR.js";import"./index-C-3KXJnM.js";import"./vendor-lodash-DaKx9L3Z.js";import"./vendor-react-DmhAABj7.js";import"./vendor-posthog-NDQyeBQD.js";import"./vendor-recharts-BK6oYQkz.js";import"./vendor-sentry-RRLtfDYd.js";import"./vendor-socket-io-2VDPH2mZ.js";import"./vendor-framer-motion-buPOh-wu.js";import"./index-DEJWY_33.js";import"./index-BZPqE6ae.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8012e4a9-a03b-4960-a954-8a6e3b663e57",e._sentryDebugIdIdentifier="sentry-dbid-8012e4a9-a03b-4960-a954-8a6e3b663e57")}catch{}})();const te=b` 2 :host { 3 width: 100%; 4 height: 100px; 5 border-radius: ${({borderRadius:e})=>e[5]}; 6 border: 1px solid ${({tokens:e})=>e.theme.foregroundPrimary}; 7 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 8 transition: background-color ${({durations:e})=>e.lg} 9 ${({easings:e})=>e["ease-out-power-1"]}; 10 will-change: background-color; 11 position: relative; 12 } 13 14 :host(:hover) { 15 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 16 } 17 18 wui-flex { 19 width: 100%; 20 height: fit-content; 21 } 22 23 wui-button { 24 display: ruby; 25 color: ${({tokens:e})=>e.theme.textPrimary}; 26 margin: 0 ${({spacing:e})=>e[2]}; 27 } 28 29 .instruction { 30 position: absolute; 31 top: 50%; 32 transform: translateY(-50%); 33 z-index: 2; 34 } 35 36 .paste { 37 display: inline-flex; 38 } 39 40 textarea { 41 background: transparent; 42 width: 100%; 43 font-family: ${({fontFamily:e})=>e.regular}; 44 font-style: normal; 45 font-size: ${({textSize:e})=>e.large}; 46 font-weight: ${({fontWeight:e})=>e.regular}; 47 line-height: ${({typography:e})=>e["lg-regular"].lineHeight}; 48 letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing}; 49 color: ${({tokens:e})=>e.theme.textPrimary}; 50 caret-color: ${({tokens:e})=>e.core.backgroundAccentPrimary}; 51 box-sizing: border-box; 52 -webkit-appearance: none; 53 -moz-appearance: textfield; 54 padding: 0px; 55 border: none; 56 outline: none; 57 appearance: none; 58 resize: none; 59 overflow: hidden; 60 } 61`;var D=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let A=class extends x{constructor(){super(...arguments),this.inputElementRef=M(),this.instructionElementRef=M(),this.readOnly=!1,this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=O.debounce(async t=>{if(!t.length){this.setReceiverAddress("");return}const i=g.state.activeChain;if(O.isAddress(t,i)){this.setReceiverAddress(t);return}try{const r=await V.getEnsAddress(t);if(r){a.setReceiverProfileName(t),a.setReceiverAddress(r);const n=await V.getEnsAvatar(t);a.setReceiverProfileImageUrl(n||void 0)}}catch{this.setReceiverAddress(t)}finally{a.setLoading(!1)}})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return this.readOnly?c` <wui-flex 62 flexDirection="column" 63 justifyContent="center" 64 gap="01" 65 .padding=${["8","4","5","4"]} 66 > 67 <textarea 68 spellcheck="false" 69 ?disabled=${!0} 70 autocomplete="off" 71 .value=${this.value??""} 72 ></textarea> 73 </wui-flex>`:c` <wui-flex 74 @click=${this.onBoxClick.bind(this)} 75 flexDirection="column" 76 justifyContent="center" 77 gap="01" 78 .padding=${["8","4","5","4"]} 79 > 80 <wui-text 81 ${q(this.instructionElementRef)} 82 class="instruction" 83 color="secondary" 84 variant="md-medium" 85 > 86 Type or 87 <wui-button 88 class="paste" 89 size="md" 90 variant="neutral-secondary" 91 iconLeft="copy" 92 @click=${this.onPasteClick.bind(this)} 93 > 94 <wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon> 95 Paste 96 </wui-button>
96 97 address 98 </wui-text> 99 <textarea 100 spellcheck="false" 101 ?disabled=${!this.instructionHidden} 102 ${q(this.inputElementRef)} 103 @input=${this.onInputChange.bind(this)} 104 @blur=${this.onBlur.bind(this)} 105 .value=${this.value??""} 106 autocomplete="off" 107 ></textarea> 108 </wui-flex>`}async focusInput(){var t;this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",(t=this.inputElementRef.value)==null||t.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){var t;this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",(t=this.inputElementRef.value)==null||t.blur())}async toggleInstructionFocus(t){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:t?0:1},{opacity:t?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 t=await navigator.clipboard.readText();a.setReceiverAddress(t),this.focusInput()}onInputChange(t){var o;const i=t.target;this.pasting=!1,this.value=(o=t.target)==null?void 0:o.value,i.value&&!this.instructionHidden&&this.focusInput(),a.setLoading(!0),this.onDebouncedSearch(i.value)}setReceiverAddress(t){a.setReceiverAddress(t),a.setReceiverProfileName(void 0),a.setReceiverProfileImageUrl(void 0),a.setLoading(!1)}};A.styles=te;D([d()],A.prototype,"value",void 0);D([d({type:Boolean})],A.prototype,"readOnly",void 0);D([u()],A.prototype,"instructionHidden",void 0);D([u()],A.prototype,"pasting",void 0);A=D([v("w3m-input-address")],A);const ie=b` 109 :host { 110 width: 100%; 111 height: 100px; 112 border-radius: ${({borderRadius:e})=>e[5]}; 113 border: 1px solid ${({tokens:e})=>e.theme.foregroundPrimary}; 114 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 115 transition: background-color ${({durations:e})=>e.lg} 116 ${({easings:e})=>e["ease-out-power-1"]}; 117 will-change: background-color; 118 transition: all ${({easings:e})=>e["ease-out-power-1"]} 119 ${({durations:e})=>e.lg}; 120 } 121 122 :host(:hover) { 123 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 124 } 125 126 wui-flex { 127 width: 100%; 128 height: fit-content; 129 } 130 131 wui-button { 132 width: 100%; 133 display: flex; 134 justify-content: flex-end; 135 } 136 137 wui-input-amount { 138 mask-image: linear-gradient( 139 270deg, 140 transparent 0px, 141 transparent 8px, 142 black 24px, 143 black 25px, 144 black 32px, 145 black 100% 146 ); 147 } 148 149 .totalValue { 150 width: 100%; 151 } 152`;var R=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let $=class extends x{constructor(){super(...arguments),this.readOnly=!1,this.isInsufficientBalance=!1}render(){const t=this.readOnly||!this.token;return c` <wui-flex 153 flexDirection="column" 154 gap="01" 155 .padding=${["5","3","4","3"]} 156 > 157 <wui-flex alignItems="center"> 158 <wui-input-amount 159 @inputChange=${this.onInputChange.bind(this)} 160 ?disabled=${t} 161 .value=${this.sendTokenAmount??""} 162 ?error=${!!this.isInsufficientBalance} 163 ></wui-input-amount> 164 ${this.buttonTemplate()} 165 </wui-flex> 166 ${this.bottomTemplate()} 167 </wui-flex>`}buttonTemplate(){return this.token?c`<wui-token-button 168 text=${this.token.symbol} 169 imageSrc=${this.token.iconUrl} 170 @click=${this.handleSelectButtonClick.bind(this)} 171 > 172 </wui-token-button>
172`:c`<wui-button 173 size="md" 174 variant="neutral-secondary" 175 @click=${this.handleSelectButtonClick.bind(this)} 176 >Select token</wui-button 177 >`}handleSelectButtonClick(){this.readOnly||h.push("WalletSendSelectToken")}sendValueTemplate(){if(!this.readOnly&&this.token&&this.sendTokenAmount){const i=this.token.price*Number(this.sendTokenAmount);return c`<wui-text class="totalValue" variant="sm-regular" color="secondary" 178 >${i?`$${E.formatNumberToLocalString(i,2)}`:"Incorrect value"}</wui-text 179 >`}return null}maxAmountTemplate(){return this.token?c` <wui-text variant="sm-regular" color="secondary"> 180 ${I.roundNumber(Number(this.token.quantity.numeric),6,5)} 181 </wui-text>`:null}actionTemplate(){return this.token?c`<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>`:null}bottomTemplate(){return this.readOnly?null:c`<wui-flex alignItems="center" justifyContent="space-between"> 182 ${this.sendValueTemplate()} 183 <wui-flex alignItems="center" gap="01" justifyContent="flex-end"> 184 ${this.maxAmountTemplate()} ${this.actionTemplate()} 185 </wui-flex> 186 </wui-flex>`}onInputChange(t){a.setTokenAmount(String(t.detail))}onMaxClick(){if(this.token){const t=Number(this.token.quantity.decimals),i=E.bigNumber(this.token.quantity.numeric);if(!this.token.address&&this.gasPrice){const r=65000n*BigInt(this.gasPrice),n=E.bigNumber(r.toString()).div(E.bigNumber(10).pow(t)),s=i.minus(n);a.setTokenAmount(s.gt(0)?s.toFixed(t,0):"0")}else a.setTokenAmount(i.toFixed(t,0))}}};$.styles=ie;R([d({type:Object})],$.prototype,"token",void 0);R([d({type:Boolean})],$.prototype,"readOnly",void 0);R([d({type:String})],$.prototype,"sendTokenAmount",void 0);R([d({type:Boolean})],$.prototype,"isInsufficientBalance",void 0);R([d({type:String})],$.prototype,"gasPrice",void 0);$=R([v("w3m-input-token")],$);const ne=b` 187 :host { 188 display: block; 189 } 190 191 wui-flex { 192 position: relative; 193 } 194 195 wui-icon-box { 196 width: 32px; 197 height: 32px; 198 border-radius: ${({borderRadius:e})=>e[10]} !important; 199 border: 4px solid ${({tokens:e})=>e.theme.backgroundPrimary}; 200 background: ${({tokens:e})=>e.theme.foregroundPrimary}; 201 position: absolute; 202 top: 50%; 203 left: 50%; 204 transform: translate(-50%, -50%); 205 z-index: 3; 206 } 207 208 wui-button { 209 --local-border-radius: ${({borderRadius:e})=>e[4]} !important; 210 } 211 212 .inputContainer { 213 height: fit-content; 214 } 215`;var w=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const m={INSUFFICIENT_FUNDS:"Insufficient Funds",INCORRECT_VALUE:"Incorrect Value",INVALID_ADDRESS:"Invalid Address",ADD_ADDRESS:"Add Address",ADD_AMOUNT:"Add Amount",SELECT_TOKEN:"Select Token",PREVIEW_SEND:"Preview Send"};let p=class extends x{constructor(){var i,o;super(),this.unsubscribe=[],this.isTryingToChooseDifferentWallet=!1,this.token=a.state.token,this.sendTokenAmount=a.state.sendTokenAmount,this.receiverAddress=a.state.receiverAddress,this.receiverProfileName=a.state.receiverProfileName,this.loading=a.state.loading,this.params=(i=h.state.data)==null?void 0:i.send,this.caipAddress=(o=g.getAccountData())==null?void 0:o.caipAddress,this.disconnecting=!1,this.gasFee=P.state.gasFee,this.token&&!this.params&&(this.fetchBalances(),this.fetchNetworkPrice());const t=g.subscribeKey("activeCaipAddress",r=>{!r&&this.isTryingToChooseDifferentWallet&&(this.isTryingToChooseDifferentWallet=!1,K.open({view:"Connect",data:{redirectView:"WalletSend"}}).catch(()=>null),t())});this.unsubscribe.push(g.subscribeAccountStateProp("caipAddress",r=>{this.caipAddress=r}),a.subscribe(r=>{this.token=r.token,this.sendTokenAmount=r.sendTokenAmount,this.receiverAddress=r.receiverAddress,this.receiverProfileName=r.receiverProfileName,this.loading=r.loading}),P.subscribeKey("gasFee",r=>{this.gasFee=r}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}async firstUpdated(){await this.handleSendParameters()}render(){const t=this.getMessage(),i=!!this.params;return c` <wui-flex flexDirection="column" .padding=${["0","4","4","4"]}> 216 <wui-flex class="inputContainer" gap="2" flexDirection="column"> 217 <w3m-input-token 218 .token=${this.token} 219 .sendTokenAmount=${this.sendTokenAmount} 220 .gasPrice=${this.gasFee} 221 ?readOnly=${i} 222 ?isInsufficientBalance=${t===m.INSUFFICIENT_FUNDS} 223 ></w3m-input-token> 224 <wui-icon-box size="md" variant="secondary" icon="arrowBottom"></wui-icon-box> 225 <w3m-input-address 226 ?readOnly=${i} 227 .value=${this.receiverProfileName?this.receiverProfileName:this.receiverAddress} 228 ></w3m-input-address> 229 </wui-flex> 230 ${this.buttonTemplate(t)}
230 231 </wui-flex>`}async fetchBalances(){await a.fetchTokenBalance(),a.fetchNetworkBalance()}async fetchNetworkPrice(){await P.getNetworkTokenPrice(),await P.getInitialGasPrice()}onButtonClick(){h.push("WalletSendPreview",{send:this.params})}onFundWalletClick(){h.push("FundWallet",{redirectView:"WalletSend"})}async onConnectDifferentWalletClick(){try{this.isTryingToChooseDifferentWallet=!0,this.disconnecting=!0,await V.disconnect()}finally{this.disconnecting=!1}}getMessage(){return this.token?this.sendTokenAmount?this.token.price&&!(Number(this.sendTokenAmount)*this.token.price)?m.INCORRECT_VALUE:E.bigNumber(this.sendTokenAmount).gt(this.token.quantity.numeric)?m.INSUFFICIENT_FUNDS:this.receiverAddress?O.isAddress(this.receiverAddress,g.state.activeChain)?m.PREVIEW_SEND:m.INVALID_ADDRESS:m.ADD_ADDRESS:m.ADD_AMOUNT:m.SELECT_TOKEN}buttonTemplate(t){const i=!t.startsWith(m.PREVIEW_SEND),o=t===m.INSUFFICIENT_FUNDS,r=!!this.params;return o&&!r?c` 232 <wui-flex .margin=${["4","0","0","0"]} flexDirection="column" gap="4"> 233 <wui-button 234 @click=${this.onFundWalletClick.bind(this)} 235 size="lg" 236 variant="accent-secondary" 237 fullWidth 238 > 239 Fund Wallet 240 </wui-button> 241 242 <wui-separator data-testid="wui-separator" text="or"></wui-separator> 243 244 <wui-button 245 @click=${this.onConnectDifferentWalletClick.bind(this)} 246 size="lg" 247 variant="neutral-secondary" 248 fullWidth 249 ?loading=${this.disconnecting} 250 > 251 Connect a different wallet 252 </wui-button> 253 </wui-flex> 254 `:c`<wui-flex .margin=${["4","0","0","0"]}> 255 <wui-button 256 @click=${this.onButtonClick.bind(this)} 257 ?disabled=${i} 258 size="lg" 259 variant="accent-primary" 260 ?loading=${this.loading} 261 fullWidth 262 > 263 ${t} 264 </wui-button> 265 </wui-flex>`}async handleSendParameters(){if(this.loading=!0,!this.params){this.loading=!1;return}const t=Number(this.params.amount);if(isNaN(t)){y.showError("Invalid amount"),this.loading=!1;return}const{namespace:i,chainId:o,assetAddress:r}=this.params;if(!Q.SEND_PARAMS_SUPPORTED_CHAINS.includes(i)){y.showError(`Chain "${i}" is not supported for send parameters`),this.loading=!1;return}const n=g.getCaipNetworkById(o,i);if(!n){y.showError(`Network with id "${o}" not found`),this.loading=!1;return}try{const{balance:s,name:l,symbol:U,decimals:z}=await X.fetchERC20Balance({caipAddress:this.caipAddress,assetAddress:r,caipNetwork:n});if(!l||!U||!z||!s){y.showError("Token not found");return}a.setToken({name:l,symbol:U,chainId:n.id.toString(),address:`${n.chainNamespace}:${n.id}:${r}`,value:0,price:0,quantity:{decimals:z.toString(),numeric:s.toString()},iconUrl:G.getTokenImage(U)??""}),a.setTokenAmount(String(t)),a.setReceiverAddress(this.params.to)}catch(s){console.error("Failed to load token information:",s),y.showError("Failed to load token information")}finally{this.loading=!1}}};p.styles=ne;w([u()],p.prototype,"token",void 0);w([u()],p.prototype,"sendTokenAmount",void 0);w([u()],p.prototype,"receiverAddress",void 0);w([u()],p.prototype,"receiverProfileName",void 0);w([u()],p.prototype,"loading",void 0);w([u()],p.prototype,"params",void 0);w([u()],p.prototype,"caipAddress",void 0);w([u()],p.prototype,"disconnecting",void 0);w([u()],p.prototype,"gasFee",void 0);p=w([v("w3m-wallet-send-view")],p);const re=b` 266 .contentContainer { 267 height: 440px; 268 overflow: scroll; 269 scrollbar-width: none; 270 } 271 272 .contentContainer::-webkit-scrollbar {
273 display: none; 274 } 275 276 wui-icon-box { 277 width: 40px; 278 height: 40px; 279 border-radius: ${({borderRadius:e})=>e[3]}; 280 } 281`;var _=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let T=class extends x{constructor(){super(),this.unsubscribe=[],this.tokenBalances=a.state.tokenBalances,this.search="",this.onDebouncedSearch=O.debounce(t=>{this.search=t}),this.fetchBalancesAndNetworkPrice(),this.unsubscribe.push(a.subscribe(t=>{this.tokenBalances=t.tokenBalances}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){return c` 282 <wui-flex flexDirection="column"> 283 ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()} 284 </wui-flex> 285 `}async fetchBalancesAndNetworkPrice(){var t;(!this.tokenBalances||((t=this.tokenBalances)==null?void 0:t.length)===0)&&(await this.fetchBalances(),await this.fetchNetworkPrice())}async fetchBalances(){await a.fetchTokenBalance(),a.fetchNetworkBalance()}async fetchNetworkPrice(){await P.getNetworkTokenPrice()}templateSearchInput(){return c` 286 <wui-flex gap="2" padding="3"> 287 <wui-input-text 288 @inputChange=${this.onInputChange.bind(this)} 289 class="network-search-input" 290 size="sm" 291 placeholder="Search token" 292 icon="search" 293 ></wui-input-text> 294 </wui-flex> 295 `}templateTokens(){var t,i;return this.tokens=(t=this.tokenBalances)==null?void 0:t.filter(o=>{var r;return o.chainId===((r=g.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)}),this.search?this.filteredTokens=(i=this.tokenBalances)==null?void 0:i.filter(o=>o.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,c` 296 <wui-flex 297 class="contentContainer" 298 flexDirection="column" 299 .padding=${["0","3","0","3"]} 300 > 301 <wui-flex justifyContent="flex-start" .padding=${["4","3","3","3"]}> 302 <wui-text variant="md-medium" color="secondary">Your tokens</wui-text> 303 </wui-flex> 304 <wui-flex flexDirection="column" gap="2"> 305 ${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(o=>c`<wui-list-token 306 @click=${this.handleTokenClick.bind(this,o)} 307 ?clickable=${!0} 308 tokenName=${o.name} 309 tokenImageUrl=${o.iconUrl} 310 tokenAmount=${o.quantity.numeric} 311 tokenValue=${o.value} 312 tokenCurrency=${o.symbol} 313 ></wui-list-token>`):c`<wui-flex 314 .padding=${["20","0","0","0"]} 315 alignItems="center" 316 flexDirection="column" 317 gap="4" 318 > 319 <wui-icon-box icon="coinPlaceholder" color="default" size="lg"></wui-icon-box> 320 <wui-flex 321 class="textContent" 322 gap="2" 323 flexDirection="column" 324 justifyContent="center" 325 flexDirection="column" 326 > 327 <wui-text variant="lg-medium" align="center" color="primary"> 328 No tokens found 329 </wui-text> 330 <wui-text variant="lg-regular" align="center" color="secondary"> 331 Your tokens will appear here 332 </wui-text> 333 </wui-flex> 334 <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link> 335 </wui-flex>`} 336 </wui-flex> 337 </wui-flex> 338 `}onBuyClick(){h.push("OnRampProviders")}onInputChange(t){this.onDebouncedSearch(t.detail)}handleTokenClick(t){a.setToken(t),a.setTokenAmount(void 0),h.goBack()}};T.styles=re;_([u()],T.prototype,"tokenBalances",void 0);_([u()],T.prototype,"tokens",void 0);_([u()],T.prototype,"filteredTokens",void 0);_([u()],T.prototype,"search",void 0);T=_([v("w3m-wallet-send-select-token-view")],T);const oe=b` 339 :host { 340 height: 32px; 341 display: flex; 342 align-items: center; 343 gap: ${({spacing:e})=>e[1]}; 344 border-radius: ${({borderRadius:e})=>e[32]}; 345 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 346 padding: ${({spacing:e})=>e[1]}; 347 padding-left: ${({spacing:e})=>e[2]}; 348 } 349 350 wui-avatar, 351 wui-image { 352 width: 24px; 353 height: 24px; 354 border-radius: ${({borderRadius:e})=>e[16]}; 355 } 356 357 wui-icon { 358 border-radius: ${({borderRadius:e})=>e[16]}; 359 } 360`;var B=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let C=class extends x{constructor(){super(...arguments),this.text=""}render(){return c`<wui-text variant="lg-regular" color="primary">${this.text}</wui-text> 361 ${this.imageTemplate()}`}imageTemplate(){return this.address?c`<wui-avatar address=${this.address} .imageSrc=${this.imageSrc}></wui-avatar>`:this.imageSrc?c`<wui-image src=${this.imageSrc}></wui-image>`:c`<wui-icon size="lg" color="inverse" name="networkPlaceholder"></wui-icon>`}};C.styles=[Y,J,oe];B([d({type:String})],C.prototype,"text",void 0);B([d({type:String})],C.prototype,"address",void 0);B([d({type:String})],C.prototype,"imageSrc",void 0);C=B([v("wui-preview-item")],C);const se=b` 362 :host { 363 display: flex; 364 padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[3]}; 365 width: 100%; 366 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 367 border-radius: ${({borderRadius:e})=>e[4]}; 368 } 369 370 wui-image {
371 width: 20px; 372 height: 20px; 373 border-radius: ${({borderRadius:e})=>e[16]}; 374 } 375 376 wui-icon { 377 width: 20px; 378 height: 20px; 379 } 380`;var W=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let S=class extends x{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return c` 381 <wui-flex justifyContent="space-between" alignItems="center"> 382 <wui-text variant="lg-regular" color="primary"> ${this.textTitle} </wui-text> 383 ${this.templateContent()} 384 </wui-flex> 385 `}templateContent(){return this.imageSrc?c`<wui-image src=${this.imageSrc} alt=${this.textTitle}></wui-image>`:this.textValue?c` <wui-text variant="md-regular" color="secondary"> ${this.textValue} </wui-text>`:c`<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`}};S.styles=[Y,J,se];W([d()],S.prototype,"imageSrc",void 0);W([d()],S.prototype,"textTitle",void 0);W([d()],S.prototype,"textValue",void 0);S=W([v("wui-list-content")],S);const ae=b` 386 :host { 387 display: flex; 388 width: auto; 389 flex-direction: column; 390 gap: ${({spacing:e})=>e[1]}; 391 border-radius: ${({borderRadius:e})=>e[5]}; 392 background: ${({tokens:e})=>e.theme.foregroundPrimary}; 393 padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[2]} 394 ${({spacing:e})=>e[2]} ${({spacing:e})=>e[2]}; 395 } 396 397 wui-list-content { 398 width: -webkit-fill-available !important; 399 } 400 401 wui-text { 402 padding: 0 ${({spacing:e})=>e[2]}; 403 } 404 405 wui-flex { 406 margin-top: ${({spacing:e})=>e[2]}; 407 } 408 409 .network { 410 cursor: pointer; 411 transition: background-color ${({durations:e})=>e.lg} 412 ${({easings:e})=>e["ease-out-power-1"]}; 413 will-change: background-color; 414 } 415 416 .network:focus-visible { 417 border: 1px solid ${({tokens:e})=>e.core.textAccentPrimary}; 418 background-color: ${({tokens:e})=>e.core.glass010}; 419 -webkit-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent010}; 420 -moz-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent010}; 421 box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent010}; 422 } 423 424 .network:hover { 425 background-color: ${({tokens:e})=>e.core.glass010}; 426 } 427 428 .network:active { 429 background-color: ${({tokens:e})=>e.core.glass010}; 430 } 431`;var j=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let N=class extends x{constructor(){var t;super(...arguments),this.params=(t=h.state.data)==null?void 0:t.send}render(){return c` <wui-text variant="sm-regular" color="secondary">Details</wui-text> 432 <wui-flex flexDirection="column" gap="1"> 433 <wui-list-content 434 textTitle="Address" 435 textValue=${I.getTruncateString({string:this.receiverAddress??"",charsStart:4,charsEnd:4,truncate:"middle"})} 436 > 437 </wui-list-content> 438 ${this.networkTemplate()} 439 </wui-flex>`}networkTemplate(){var t;return(t=this.caipNetwork)!=null&&t.name?c` <wui-list-content 440 @click=${()=>this.onNetworkClick(this.caipNetwork)} 441 class="network" 442 textTitle="Network" 443 imageSrc=${ee(G.getNetworkImage(this.caipNetwork))} 444 ></wui-list-content>`:null}onNetworkClick(t){t&&!this.params&&h.push("Networks",{network:t})}};N.styles=ae;j([d()],N.prototype,"receiverAddress",void 0);j([d({type:Object})],N.prototype,"caipNetwork",void 0);j([u()],N.prototype,"params",void 0);N=j([v("w3m-wallet-send-details")],N);const le=b` 445 wui-avatar, 446 wui-image { 447 display: ruby; 448 width: 32px; 449 height: 32px; 450 border-radius: ${({borderRadius:e})=>e[20]}; 451 } 452 453 .sendButton { 454 width: 70%; 455 --local-width: 100% !important; 456 --local-border-radius: ${({borderRadius:e})=>e[4]} !important; 457 } 458 459 .cancelButton { 460 width: 30%; 461 --local-width: 100% !important; 462 --local-border-radius: ${({borderRadius:e})=>e[4]} !important; 463 } 464`;var k=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let f=class extends x{constructor(){var t;super(),this.unsubscribe=[],this.token=a.state.token,this.sendTokenAmount=a.state.sendTokenAmount,this.receiverAddress=a.state.receiverAddress,this.receiverProfileName=a.state.receiverProfileName,this.receiverProfileImageUrl=a.state.receiverProfileImageUrl,this.caipNetwork=g.state.activeCaipNetwork,this.loading=a.state.loading,this.params=(t=h.state.data)==null?void 0:t.send,this.unsubscribe.push(a.subscribe(i=>{this.token=i.token,this.sendTokenAmount=i.sendTokenAmount,this.receiverAddress=i.receiverAddress,this.receiverProfileName=i.receiverProfileName,this.receiverProfileImageUrl=i.receiverProfileImageUrl,this.loading=i.loading}
464),g.subscribeKey("activeCaipNetwork",i=>this.caipNetwork=i))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){var t,i;return c` <wui-flex flexDirection="column" .padding=${["0","4","4","4"]}> 465 <wui-flex gap="2" flexDirection="column" .padding=${["0","2","0","2"]}> 466 <wui-flex alignItems="center" justifyContent="space-between"> 467 <wui-flex flexDirection="column" gap="01"> 468 <wui-text variant="sm-regular" color="secondary">Send</wui-text> 469 ${this.sendValueTemplate()} 470 </wui-flex> 471 <wui-preview-item 472 text="${this.sendTokenAmount?I.roundNumber(Number(this.sendTokenAmount),6,5):"unknown"} ${(t=this.token)==null?void 0:t.symbol}" 473 .imageSrc=${(i=this.token)==null?void 0:i.iconUrl} 474 ></wui-preview-item> 475 </wui-flex> 476 <wui-flex> 477 <wui-icon color="default" size="md" name="arrowBottom"></wui-icon> 478 </wui-flex> 479 <wui-flex alignItems="center" justifyContent="space-between"> 480 <wui-text variant="sm-regular" color="secondary">To</wui-text> 481 <wui-preview-item 482 text="${this.receiverProfileName?I.getTruncateString({string:this.receiverProfileName,charsStart:20,charsEnd:0,truncate:"end"}):I.getTruncateString({string:this.receiverAddress?this.receiverAddress:"",charsStart:4,charsEnd:4,truncate:"middle"})}" 483 address=${this.receiverAddress??""} 484 .imageSrc=${this.receiverProfileImageUrl??void 0} 485 .isAddress=${!0} 486 ></wui-preview-item> 487 </wui-flex> 488 </wui-flex> 489 <wui-flex flexDirection="column" .padding=${["6","0","0","0"]}> 490 <w3m-wallet-send-details 491 .caipNetwork=${this.caipNetwork} 492 .receiverAddress=${this.receiverAddress} 493 ></w3m-wallet-send-details> 494 <wui-flex justifyContent="center" gap="1" .padding=${["3","0","0","0"]}> 495 <wui-icon size="sm" color="default" name="warningCircle"></wui-icon> 496 <wui-text variant="sm-regular" color="secondary">Review transaction carefully</wui-text> 497 </wui-flex> 498 <wui-flex justifyContent="center" gap="3" .padding=${["4","0","0","0"]}> 499 <wui-button 500 class="cancelButton" 501 @click=${this.onCancelClick.bind(this)} 502 size="lg" 503 variant="neutral-secondary" 504 > 505 Cancel 506 </wui-button> 507 <wui-button 508 class="sendButton" 509 @click=${this.onSendClick.bind(this)} 510 size="lg" 511 variant="accent-primary" 512 .loading=${this.loading} 513 > 514 Send 515 </wui-button> 516 </wui-flex> 517 </wui-flex></wui-flex 518 >`}sendValueTemplate(){if(!this.params&&this.token&&this.sendTokenAmount){const i=this.token.price*Number(this.sendTokenAmount);return c`<wui-text variant="md-regular" color="primary" 519 >$${i.toFixed(2)}</wui-text 520 >`}return null}async onSendClick(){if(!this.sendTokenAmount||!this.receiverAddress){y.showError("Please enter a valid amount and receiver address");return}try{await a.sendToken(),this.params?h.reset("WalletSendConfirmed"):(y.showSuccess("Transaction started"),h.replace("Account"))}catch(t){let i="Failed to send transaction";const o=t instanceof H&&t.originalName===L.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST,r=t instanceof H&&t.originalName===L.PROVIDER_RPC_ERROR_NAME.SEND_TRANSACTION_ERROR;(o||r)&&(i=t.message),Z.sendEvent({type:"track",event:o?"SEND_REJECTED":"SEND_ERROR",properties:a.getSdkEventProperties(t)}),y.showError(i)}}onCancelClick(){h.goBack()}};f.styles=le;k([u()],f.prototype,"token",void 0);k([u()],f.prototype,"sendTokenAmount",void 0);k([u()],f.prototype,"receiverAddress",void 0);k([u()],f.prototype,"receiverProfileName",void 0);k([u()],f.prototype,"receiverProfileImageUrl",void 0);k([u()],f.prototype,"caipNetwork",void 0);k([u()],f.prototype,"loading",void 0);k([u()],f.prototype,"params",void 0);f=k([v("w3m-wallet-send-preview-view")],f);const ce=b` 521 .icon-box { 522 width: 64px; 523 height: 64px; 524 border-radius: 16px; 525 background-color: ${({spacing:e})=>e[16]}; 526 border: 8px solid ${({tokens:e})=>e.theme.borderPrimary}; 527 border-radius: ${({borderRadius:e})=>e.round}; 528 } 529`;var ue=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let F=class extends x{constructor(){super(),this.unsubscribe=[],this.unsubscribe.push()}render(){return c` 530 <wui-flex 531 flexDirection="column" 532 alignItems="center" 533 gap="4" 534 .padding="${["1","3","4","3"]}" 535 > 536 <wui-flex justifyContent="center" alignItems="center" class="icon-box"> 537 <wui-icon size="xxl" color="success" name="checkmark"></wui-icon> 538 </wui-flex> 539 540 <wui-text variant="h6-medium" color="primary">You successfully sent asset</wui-text> 541 542 <wui-button 543 fullWidth 544 @click=${this.onCloseClick.bind(this)} 545 size="lg" 546 variant="neutral-secondary" 547 > 548 Close 549 </wui-button>
549 550 </wui-flex> 551 `}onCloseClick(){K.close()}};F.styles=ce;F=ue([v("w3m-send-confirmed-view")],F);export{F as W3mSendConfirmedView,T as W3mSendSelectTokenView,f as W3mWalletSendPreviewView,p as W3mWalletSendView};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.