PageSourceSearch

https://carsandcrypto.io/_next/static/chunks/4508.e022594bd7becdd9.js

js carsandcrypto.io collected 2026-10-02 01:58:44 UTC 171,446 bytes, 2,418 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4508],{14508:function(e,t,o){o.r(t),o.d(t,{AppKitModal:function(){return oa},W3mListWallet:function(){return ou},W3mModal:function(){return or},W3mModalBase:function(){return oi},W3mRouterContainer:function(){return om},W3mUsageExceededView:function(){return os}});var i=o(56545),r=o(76547),a=o(21045),n=o(64904),s=o(96238),c=o(21331),l=o(99420),d=o(29748),u=o(56854),p=o(73668),h=o(80843);let m={isUnsupportedChainView:()=>"UnsupportedChain"===u.RouterController.state.view||"SwitchNetwork"===u.RouterController.state.view&&u.RouterController.state.history.includes("UnsupportedChain"),async safeClose(){if(this.isUnsupportedChainView()||await h.w.isSIWXCloseDisabled()){s.I.shake();return}("DataCapture"===u.RouterController.state.view||"DataCaptureOtpConfirm"===u.RouterController.state.view)&&p.ConnectionController.disconnect(),s.I.close()}};var w=o(2059),g=o(13465),y=o(87481),f=o(10164),b=o(86924),v=o(97105),x=o(63768),k=o(923),C=o(54892),S=o(57054),T=o(22837),A=o(82833);let I={getGasPriceInEther:(e,t)=>Number(t*e)/1e18,getGasPriceInUSD(e,t,o){let i=I.getGasPriceInEther(t,o);return b.C.bigNumber(e).times(i).toNumber()},getPriceImpact({sourceTokenAmount:e,sourceTokenPriceInUSD:t,toTokenPriceInUSD:o,toTokenAmount:i}){let r=b.C.bigNumber(e).times(t),a=b.C.bigNumber(i).times(o);return r.minus(a).div(r).times(100).toNumber()},getMaxSlippage(e,t){let o=b.C.bigNumber(e).div(100);return b.C.multiply(t,o).toNumber()},getProviderFee:(e,t=.0085)=>b.C.bigNumber(e).times(t).toString(),isInsufficientNetworkTokenForGas:(e,t)=>!!b.C.bigNumber(e).eq(0)||b.C.bigNumber(b.C.bigNumber(t||"0")).gt(e),isInsufficientSourceTokenForSwap(e,t,o){let i=o?.find(e=>e.address===t)?.quantity?.numeric;return b.C.bigNumber(i||"0").lt(e)}};var E=o(71302),P=o(4655),$=o(55853),N=o(93388);let R={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,switchingTokens:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:S.bq.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},O=(0,y.sj)({...R}),_={state:O,subscribe:e=>(0,y.Ld)(O,()=>e(O)),subscribeKey:(e,t)=>(0,f.VW)(O,e,t),getParams(){let e=c.R.state.activeChain,t=c.R.getAccountData(e)?.caipAddress??c.R.state.activeCaipAddress,o=T.j.getPlainAddress(t),i=(0,C.EO)(),r=l.ConnectorController.getConnectorId(c.R.state.activeChain);if(!o)throw Error("No address found to swap the tokens from.");let a=!O.toToken?.address||!O.toToken?.decimals,n=!O.sourceToken?.address||!O.sourceToken?.decimals||!b.C.bigNumber(O.sourceTokenAmount).gt(0),s=!O.sourceTokenAmount;return{networkAddress:i,fromAddress:o,fromCaipAddress:t,sourceTokenAddress:O.sourceToken?.address,toTokenAddress:O.toToken?.address,toTokenAmount:O.toTokenAmount,toTokenDecimals:O.toToken?.decimals,sourceTokenAmount:O.sourceTokenAmount,sourceTokenDecimals:O.sourceToken?.decimals,invalidToToken:a,invalidSourceToken:n,invalidSourceTokenAmount:s,availableToSwap:t&&!a&&!n&&!s,isAuthConnector:r===v.b.CONNECTOR_ID.AUTH}},async setSourceToken(e){if(!e){O.sourceToken=e,O.sourceTokenAmount="",O.sourceTokenPriceInUSD=0;return}O.sourceToken=e,await B.setTokenPrice(e.address,"sourceToken")},setSourceTokenAmount(e){O.sourceTokenAmount=e},async setToToken(e){if(!e){O.toToken=e,O.toTokenAmount="",O.toTokenPriceInUSD=0;return}O.toToken=e,await B.setTokenPrice(e.address,"toToken")},setToTokenAmount(e){O.toTokenAmount=e?b.C.toFixed(e,6):""},async setTokenPrice(e,t){let o=O.tokensPriceMap[e]||0;o||(O.loadingPrices=!0,o=await B.getAddressPrice(e)),"sourceToken"===t?O.sourceTokenPriceInUSD=o:"toToken"===t&&(O.toTokenPriceInUSD=o),O.loadingPrices&&(O.loadingPrices=!1),B.getParams().availableToSwap&&!O.switchingTokens&&B.swapTokens()},async switchTokens(){if(!O.initializing&&O.initialized&&!O.switchingTokens){O.switchingTokens=!0;try{let e=O.toToken?{...O.toToken}:void 0,t=O.sourceToken?{...O.sourceToken}:void 0,o=e&&""===O.toTokenAmount?"1":O.toTokenAmount;B.setSourceTokenAmount(o),B.setToTokenAmount(""),await B.setSourceToken(e),await B.setToToken(t),O.switchingTokens=!1,B.swapTokens()}catch(e){throw O.switchingTokens=!1,e}}},resetState(){O.myTokensWithBalance=R.myTokensWithBalance,O.tokensPriceMap=R.tokensPriceMap,O.initialized=R.initialized,O.initializing=R.initializing,O.switchingTokens=R.switchingTokens,O.sourceToken=R.sourceToken,O.sourceTokenAmount=R.sourceTokenAmount,O.sourceTokenPriceInUSD=R.sourceTokenPriceInUSD,O.toToken=R.toToken,O.toTokenAmount=R.toTokenAmount,O.toTokenPriceInUSD=R.toTokenPriceInUSD,O.networkPrice=R.networkPrice,O.networkTokenSymbol=R.networkTokenSymbol,O.networkBalanceInUSD=R.networkBalanceInUSD,O.inputError=R.inputError},resetValues(){let{networkAddress:e}=B.getParams(),t=O.tokens?.find(t=>t.address===e);B.setSourceToken(t),B.setToToken(void 0)},getApprovalLoadingState:()=>O.loadingApprovalTransaction,clearError(){O.transactionError=void 0},async initializeState(){if(!O.initializing){if(O.initializing=!0,!O.initialized)try{await B.fetchTokens(),O.initialized=!0}catch(e){O.initialized=!1,g.SnackController.showError("Failed to initialize swap"),u.RouterController.goBack()}O.initializing=!1}},async fetchTokens(){let{networkAddress:e}=B.getParams();await B.getNetworkTokenPrice(),await B.getMyTokensWithBalance();let t=O.myTokensWithBalance?.find(t=>t.address===e);t&&(O.networkTokenSymbol=t.symbol,B.setSourceToken(t),B.setSourceTokenAmount("0"))},async getTokenList(){let e=c.R.state.activeCaipNetwork?.caipNetworkId;if(O.caipNetworkId!==e||!O.tokens)try{O.tokensLoading=!0;let t=await A.n.getTokenList(e);O.tokens=t,O.caipNetworkId=e,O.popularTokens=t.sort((e,t)=>
1e.symbol<t.symbol?-1:e.symbol>t.symbol?1:0);let o=(e&&S.bq.SUGGESTED_TOKENS_BY_CHAIN?.[e]||[]).map(e=>t.find(t=>t.symbol===e)).filter(e=>!!e),i=(S.bq.SWAP_SUGGESTED_TOKENS||[]).map(e=>t.find(t=>t.symbol===e)).filter(e=>!!e).filter(e=>!o.some(t=>t.address===e.address));O.suggestedTokens=[...o,...i]}catch(e){O.tokens=[],O.popularTokens=[],O.suggestedTokens=[]}finally{O.tokensLoading=!1}},async getAddressPrice(e){let t=O.tokensPriceMap[e];if(t)return t;let o=await $.L.fetchTokenPrice({addresses:[e]}),i=o?.fungibles||[],r=[...O.tokens||[],...O.myTokensWithBalance||[]],a=r?.find(t=>t.address===e)?.symbol,n=parseFloat((i.find(e=>e.symbol.toLowerCase()===a?.toLowerCase())?.price||0).toString());return O.tokensPriceMap[e]=n,n},async getNetworkTokenPrice(){let{networkAddress:e}=B.getParams(),t=await $.L.fetchTokenPrice({addresses:[e]}).catch(()=>(g.SnackController.showError("Failed to fetch network token price"),{fungibles:[]})),o=t.fungibles?.[0],i=o?.price.toString()||"0";O.tokensPriceMap[e]=parseFloat(i),O.networkTokenSymbol=o?.symbol||"",O.networkPrice=i},async getMyTokensWithBalance(e){let t=await k.Q.getMyTokensWithBalance({forceUpdate:e,caipNetwork:c.R.state.activeCaipNetwork,address:c.R.getAccountData()?.address}),o=A.n.mapBalancesToSwapTokens(t);o&&(await B.getInitialGasPrice(),B.setBalances(o))},setBalances(e){let{networkAddress:t}=B.getParams(),o=c.R.state.activeCaipNetwork;if(!o)return;let i=e.find(e=>e.address===t);e.forEach(e=>{O.tokensPriceMap[e.address]=e.price||0}),O.myTokensWithBalance=e.filter(e=>e.address.startsWith(o.caipNetworkId)),O.networkBalanceInUSD=i?b.C.multiply(i.quantity.numeric,i.price).toString():"0"},async getInitialGasPrice(){let e=await A.n.fetchGasPrice();if(!e)return{gasPrice:null,gasPriceInUSD:null};switch(c.R.state?.activeCaipNetwork?.chainNamespace){case v.b.CHAIN.SOLANA:return O.gasFee=e.standard??"0",O.gasPriceInUSD=b.C.multiply(e.standard,O.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(O.gasFee),gasPriceInUSD:Number(O.gasPriceInUSD)};case v.b.CHAIN.EVM:default:let t=e.standard??"0",o=BigInt(t),i=BigInt(15e4),r=I.getGasPriceInUSD(O.networkPrice,i,o);return O.gasFee=t,O.gasPriceInUSD=r,{gasPrice:o,gasPriceInUSD:r}}},async swapTokens(){let e=c.R.getAccountData()?.address,t=O.sourceToken,o=O.toToken,i=b.C.bigNumber(O.sourceTokenAmount).gt(0);if(i||B.setToTokenAmount(""),!o||!t||O.loadingPrices||!i||!e)return;O.loadingQuote=!0;let r=b.C.bigNumber(O.sourceTokenAmount).times(10**t.decimals).round(0).toFixed(0);try{let i=await $.L.fetchSwapQuote({userAddress:e,from:t.address,to:o.address,gasPrice:O.gasFee,amount:r.toString()});O.loadingQuote=!1;let a=i?.quotes?.[0]?.toAmount;if(!a){P.AlertController.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");return}let n=b.C.bigNumber(a).div(10**o.decimals).toString();B.setToTokenAmount(n),B.hasInsufficientToken(O.sourceTokenAmount,t.address)?O.inputError="Insufficient balance":(O.inputError=void 0,B.setTransactionDetails())}catch(t){let e=await A.n.handleSwapError(t);O.loadingQuote=!1,O.inputError=e||"Insufficient balance"}},async getTransaction(){let{fromCaipAddress:e,availableToSwap:t}=B.getParams(),o=O.sourceToken,i=O.toToken;if(e&&t&&o&&i&&!O.loadingQuote)try{let t;return O.loadingBuildTransaction=!0,t=await A.n.fetchSwapAllowance({userAddress:e,tokenAddress:o.address,sourceTokenAmount:O.sourceTokenAmount,sourceTokenDecimals:o.decimals})?await B.createSwapTransaction():await B.createAllowanceTransaction(),O.loadingBuildTransaction=!1,O.fetchError=!1,t}catch(e){u.RouterController.goBack(),g.SnackController.showError("Failed to check allowance"),O.loadingBuildTransaction=!1,O.approvalTransaction=void 0,O.swapTransaction=void 0,O.fetchError=!0;return}},async createAllowanceTransaction(){let{fromCaipAddress:e,sourceTokenAddress:t,toTokenAddress:o}=B.getParams();if(e&&o){if(!t)throw Error("createAllowanceTransaction - No source token address found.");try{let i=await $.L.generateApproveCalldata({from:t,to:o,userAddress:e}),r=T.j.getPlainAddress(i.tx.from);if(!r)throw Error("SwapController:createAllowanceTransaction - address is required");let a={data:i.tx.data,to:r,gasPrice:BigInt(i.tx.eip155.gasPrice),value:BigInt(i.tx.value),toAmount:O.toTokenAmount};return O.swapTransaction=void 0,O.approvalTransaction={data:a.data,to:a.to,gasPrice:a.gasPrice,value:a.value,toAmount:a.toAmount},{data:a.data,to:a.to,gasPrice:a.gasPrice,value:a.value,toAmount:a.toAmount}}catch(e){u.RouterController.goBack(),g.SnackController.showError("Failed to create approval transaction"),O.approvalTransaction=void 0,O.swapTransaction=void 0,O.fetchError=!0;return}}},async createSwapTransaction(){let{networkAddress:e,fromCaipAddress:t,sourceTokenAmount:o}=B.getParams(),i=O.sourceToken,r=O.toToken;if(!t||!o||!i||!r)return;let a=p.ConnectionController.parseUnits(o,i.decimals)?.toString();try{let o=await $.L.generateSwapCalldata({userAddress:t,from:i.address,to:r.address,amount:a,disableEstimate:!0}),n=i.address===e,s=BigInt(o.tx.eip155.gas),c=BigInt(o.tx.eip155.gasPrice),l=T.j.getPlainAddress(o.tx.to);if(!l)throw Error("SwapController:createSwapTransaction - address is required");let d={data:o.tx.data,to:l,gas:s,gasPrice:c,value:n?BigInt(a??"0"):BigInt("0"),toAmount:O.toTokenAmount};return O.gasPriceInUSD=I.getGasPriceInUSD(O.networkPrice,s,c),O.approvalTransaction=void 0,O.swapTransaction=d,d}catch(e){u.RouterController.goBack(),g.SnackController.showError("Failed to create transaction"),O.approvalTransaction=void 0,O.swapTransaction=void 0,O.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){g.SnackController.showLoading("Approve limit increase in your wallet"),u.RouterController.replace("SwapPreview")},async sendTransactionForApproval(e){let{fromAddress:t,isAuthConnector:o}=B.getParams();O.loadingApprovalTransaction=!0,o?u.RouterController.pushTransactionStack({onSuccess:B.onEmbeddedWalletApprovalSuccess}):g.SnackController.showLoading("Approve limit increase in your wallet");try{await p.ConnectionController.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:v.b.CHAIN.EVM}),await B.swapTokens(),await B.getTransaction(),O.approvalTransaction=void 0,O.loadingApprovalTransaction=!1}catch(e){O.transactionError=e?.displayMessage,O.loadingApprovalTransaction=!1,g.SnackController.showError(e?.displayMessage||"Transaction error"),N.X.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:e?.displayMessage||e?.message||"Unknown",network:c.R.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:B.state.sourceToken?.symbol||"",swapToToken:B.state.toToken?.symbol||"",swapFromAmount:B.state.sourceTokenAmount||"",swapToAmount:B.state.toTokenAmount||"",isSmartAccount:(0,C.r9)(v.b.CHAIN.EVM)===x.y_.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(e){if(!e)return;let{fromAddress:t,toTokenAmount:o,isAuthConnector:i}=B.getParams();O.loadingTransaction=!0;let r=`Swapping ${O.sourceToken?.symbol} to ${b.C.formatNumberToLocalString(o,3)} ${O.toToken?.symbol}`,a=`Swapped ${O.sourceToken?.symbol} to ${b.C.formatNumberToLocalString(o,3)} ${O.toToken?.symbol}`;i?u.RouterController.pushTransactionStack({onSuccess(){u.RouterController.replace("Account"),g.SnackController.showLoading(r),_.resetState()}}
1):g.SnackController.showLoading("Confirm transaction in your wallet");try{let o=[O.sourceToken?.address,O.toToken?.address].join(","),r=await p.ConnectionController.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:v.b.CHAIN.EVM});return O.loadingTransaction=!1,g.SnackController.showSuccess(a),N.X.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:c.R.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:B.state.sourceToken?.symbol||"",swapToToken:B.state.toToken?.symbol||"",swapFromAmount:B.state.sourceTokenAmount||"",swapToAmount:B.state.toTokenAmount||"",isSmartAccount:(0,C.r9)(v.b.CHAIN.EVM)===x.y_.ACCOUNT_TYPES.SMART_ACCOUNT}}),_.resetState(),i||u.RouterController.replace("Account"),_.getMyTokensWithBalance(o),r}catch(e){O.transactionError=e?.displayMessage,O.loadingTransaction=!1,g.SnackController.showError(e?.displayMessage||"Transaction error"),N.X.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:e?.displayMessage||e?.message||"Unknown",network:c.R.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:B.state.sourceToken?.symbol||"",swapToToken:B.state.toToken?.symbol||"",swapFromAmount:B.state.sourceTokenAmount||"",swapToAmount:B.state.toTokenAmount||"",isSmartAccount:(0,C.r9)(v.b.CHAIN.EVM)===x.y_.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken:(e,t)=>I.isInsufficientSourceTokenForSwap(e,t,O.myTokensWithBalance),setTransactionDetails(){let{toTokenAddress:e,toTokenDecimals:t}=B.getParams();e&&t&&(O.gasPriceInUSD=I.getGasPriceInUSD(O.networkPrice,BigInt(O.gasFee),BigInt(15e4)),O.priceImpact=I.getPriceImpact({sourceTokenAmount:O.sourceTokenAmount,sourceTokenPriceInUSD:O.sourceTokenPriceInUSD,toTokenPriceInUSD:O.toTokenPriceInUSD,toTokenAmount:O.toTokenAmount}),O.maxSlippage=I.getMaxSlippage(O.slippage,O.toTokenAmount),O.providerFee=I.getProviderFee(O.sourceTokenAmount))}},B=(0,E.P)(_);var U=o(20425),D=o(52550),L=o(236),W=o(39629),z=(0,W.iv)`
2  :host {
3    display: block;
4    border-radius: clamp(0px, ${({borderRadius:e})=>e["8"]}, 44px);
5    box-shadow: 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary};
6    overflow: hidden;
7  }
8`;let j=class extends i.oi{render(){return(0,i.dy)`<slot></slot>`}};j.styles=[D.ET,z],j=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n}([(0,L.M)("wui-card")],j),o(72110),o(66026),o(75016),o(75363);var F=(0,W.iv)`
9  :host {
10    width: 100%;
11  }
12
13  :host > wui-flex {
14    width: 100%;
15    display: flex;
16    align-items: center;
17    justify-content: center;
18    gap: ${({spacing:e})=>e[2]};
19    padding: ${({spacing:e})=>e[3]};
20    border-radius: ${({borderRadius:e})=>e[6]};
21    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
22    box-sizing: border-box;
23    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
24    box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
25    color: ${({tokens:e})=>e.theme.textPrimary};
26  }
27
28  :host > wui-flex[data-type='info'] {
29    .icon-box {
30      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
31
32      wui-icon {
33        color: ${({tokens:e})=>e.theme.iconDefault};
34      }
35    }
36  }
37  :host > wui-flex[data-type='success'] {
38    .icon-box {
39      background-color: ${({tokens:e})=>e.core.backgroundSuccess};
40
41      wui-icon {
42        color: ${({tokens:e})=>e.core.borderSuccess};
43      }
44    }
45  }
46  :host > wui-flex[data-type='warning'] {
47    .icon-box {
48      background-color: ${({tokens:e})=>e.core.backgroundWarning};
49
50      wui-icon {
51        color: ${({tokens:e})=>e.core.borderWarning};
52      }
53    }
54  }
55  :host > wui-flex[data-type='error'] {
56    .icon-box {
57      background-color: ${({tokens:e})=>e.core.backgroundError};
58
59      wui-icon {
60        color: ${({tokens:e})=>e.core.borderError};
61      }
62    }
63  }
64
65  wui-flex {
66    width: 100%;
67  }
68
69  wui-text {
70    word-break: break-word;
71    flex: 1;
72  }
73
74  .close {
75    cursor: pointer;
76    color: ${({tokens:e})=>e.theme.iconDefault};
77  }
78
79  .icon-box {
80    height: 40px;
81    width: 40px;
82    border-radius: ${({borderRadius:e})=>e["2"]};
83    background-color: var(--local-icon-bg-value);
84  }
85`,M=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let q={info:"info",success:"checkmark",warning:"warningCircle",error:"warning"},V=class extends i.oi{constructor(){super(...arguments),this.message="",this.type="info"}render(){return(0,i.dy)`
86      <wui-flex
87        data-type=${(0,a.o)(this.type)}
88        flexDirection="row"
89        justifyContent="space-between"
90        alignItems="center"
91        gap="2"
92      >
93        <wui-flex columnGap="2" flexDirection="row" alignItems="center">
94          <wui-flex
95            flexDirection="row"
96            alignItems="center"
97            justifyContent="center"
98            class="icon-box"
99          >
100            <wui-icon color="inherit" size="md" name=${q[this.type]}></wui-icon>
101          </wui-flex>
102          <wui-text variant="md-medium" color="inherit" data-testid="wui-alertbar-text"
103            >${this.message}</wui-text
104          >
105        </wui-flex>
106        <wui-icon
107          class="close"
108          color="inherit"
109          size="sm"
110          name="close"
111          @click=${this.onClose}
112        ></wui-icon>
113      </wui-flex>
114    `}onClose(){P.AlertController.close()}};V.styles=[D.ET,F],M([(0,r.Cb)()],V.prototype,"message",void 0),M([(0,r.Cb)()],V.prototype,"type",void 0),V=M([(0,L.M)("wui-alertbar")],V);var G=(0,U.iv)`
115  :host {
116    display: block;
117    position: absolute;
118    top: ${({spacing:e})=>e["3"]};
119    left: ${({spacing:e})=>e["4"]};
120    right: ${({spacing:e})=>e["4"]};
121    opacity: 0;
122    pointer-events: none;
123  }
124`,H=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let Y={info:{backgroundColor:"fg-350",iconColor:"fg-325",icon:"info"},success:{backgroundColor:"success-glass-reown-020",iconColor:"success-125",icon:"checkmark"},warning:{backgroundColor:"warning-glass-reown-020",iconColor:"warning-100",icon:"warningCircle"},error:{backgroundColor:"error-glass-reown-020",iconColor:"error-125",icon:"warning"}},K=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.open=P.AlertController.state.open,this.onOpen(!0),this.unsubscribe.push(P.AlertController.subscribeKey("open",e=>{this.open=e,this.onOpen(!1)}))}
124disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{message:e,variant:t}=P.AlertController.state,o=Y[t];return(0,i.dy)`
125      <wui-alertbar
126        message=${e}
127        backgroundColor=${o?.backgroundColor}
128        iconColor=${o?.iconColor}
129        icon=${o?.icon}
130        type=${t}
131      ></wui-alertbar>
132    `}onOpen(e){this.open?(this.animate([{opacity:0,transform:"scale(0.85)"},{opacity:1,transform:"scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: auto"):e||(this.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: none")}};K.styles=G,H([(0,r.SB)()],K.prototype,"open",void 0),K=H([(0,U.Mo)("w3m-alertbar")],K);var Q=o(41077),X=o(7719),Z=(0,W.iv)`
133  :host {
134    position: relative;
135  }
136
137  button {
138    display: flex;
139    justify-content: center;
140    align-items: center;
141    background-color: transparent;
142    padding: ${({spacing:e})=>e[1]};
143  }
144
145  /* -- Colors --------------------------------------------------- */
146  button[data-type='accent'] wui-icon {
147    color: ${({tokens:e})=>e.core.iconAccentPrimary};
148  }
149
150  button[data-type='neutral'][data-variant='primary'] wui-icon {
151    color: ${({tokens:e})=>e.theme.iconInverse};
152  }
153
154  button[data-type='neutral'][data-variant='secondary'] wui-icon {
155    color: ${({tokens:e})=>e.theme.iconDefault};
156  }
157
158  button[data-type='success'] wui-icon {
159    color: ${({tokens:e})=>e.core.iconSuccess};
160  }
161
162  button[data-type='error'] wui-icon {
163    color: ${({tokens:e})=>e.core.iconError};
164  }
165
166  /* -- Sizes --------------------------------------------------- */
167  button[data-size='xs'] {
168    width: 16px;
169    height: 16px;
170
171    border-radius: ${({borderRadius:e})=>e[1]};
172  }
173
174  button[data-size='sm'] {
175    width: 20px;
176    height: 20px;
177    border-radius: ${({borderRadius:e})=>e[1]};
178  }
179
180  button[data-size='md'] {
181    width: 24px;
182    height: 24px;
183    border-radius: ${({borderRadius:e})=>e[2]};
184  }
185
186  button[data-size='lg'] {
187    width: 28px;
188    height: 28px;
189    border-radius: ${({borderRadius:e})=>e[2]};
190  }
191
192  button[data-size='xs'] wui-icon {
193    width: 8px;
194    height: 8px;
195  }
196
197  button[data-size='sm'] wui-icon {
198    width: 12px;
199    height: 12px;
200  }
201
202  button[data-size='md'] wui-icon {
203    width: 16px;
204    height: 16px;
205  }
206
207  button[data-size='lg'] wui-icon {
208    width: 20px;
209    height: 20px;
210  }
211
212  /* -- Hover --------------------------------------------------- */
213  @media (hover: hover) {
214    button[data-type='accent']:hover:enabled {
215      background-color: ${({tokens:e})=>e.core.foregroundAccent010};
216    }
217
218    button[data-variant='primary'][data-type='neutral']:hover:enabled {
219      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
220    }
221
222    button[data-variant='secondary'][data-type='neutral']:hover:enabled {
223      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
224    }
225
226    button[data-type='success']:hover:enabled {
227      background-color: ${({tokens:e})=>e.core.backgroundSuccess};
228    }
229
230    button[data-type='error']:hover:enabled {
231      background-color: ${({tokens:e})=>e.core.backgroundError};
232    }
233  }
234
235  /* -- Focus --------------------------------------------------- */
236  button:focus-visible {
237    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
238  }
239
240  /* -- Properties --------------------------------------------------- */
241  button[data-full-width='true'] {
242    width: 100%;
243  }
244
245  :host([fullWidth]) {
246    width: 100%;
247  }
248
249  button[disabled] {
250    opacity: 0.5;
251    cursor: not-allowed;
252  }
253`,J=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ee=class extends i.oi{constructor(){super(...arguments),this.icon="card",this.variant="primary",this.type="accent",this.size="md",this.iconSize=void 0,this.fullWidth=!1,this.disabled=!1}render(){return(0,i.dy)`<button
254      data-variant=${this.variant}
255      data-type=${this.type}
256      data-size=${this.size}
257      data-full-width=${this.fullWidth}
258      ?disabled=${this.disabled}
259    >
260      <wui-icon color="inherit" name=${this.icon} size=${(0,a.o)(this.iconSize)}></wui-icon>
261    </button>`}}
261;ee.styles=[D.ET,D.ZM,Z],J([(0,r.Cb)()],ee.prototype,"icon",void 0),J([(0,r.Cb)()],ee.prototype,"variant",void 0),J([(0,r.Cb)()],ee.prototype,"type",void 0),J([(0,r.Cb)()],ee.prototype,"size",void 0),J([(0,r.Cb)()],ee.prototype,"iconSize",void 0),J([(0,r.Cb)({type:Boolean})],ee.prototype,"fullWidth",void 0),J([(0,r.Cb)({type:Boolean})],ee.prototype,"disabled",void 0),ee=J([(0,L.M)("wui-icon-button")],ee),o(65547);var et=(0,W.iv)`
262  button {
263    display: block;
264    display: flex;
265    align-items: center;
266    padding: ${({spacing:e})=>e[1]};
267    transition: background-color ${({durations:e})=>e.lg}
268      ${({easings:e})=>e["ease-out-power-2"]};
269    will-change: background-color;
270    border-radius: ${({borderRadius:e})=>e[32]};
271  }
272
273  wui-image {
274    border-radius: 100%;
275  }
276
277  wui-text {
278    padding-left: ${({spacing:e})=>e[1]};
279  }
280
281  .left-icon-container,
282  .right-icon-container {
283    width: 24px;
284    height: 24px;
285    justify-content: center;
286    align-items: center;
287  }
288
289  wui-icon {
290    color: ${({tokens:e})=>e.theme.iconDefault};
291  }
292
293  /* -- Sizes --------------------------------------------------- */
294  button[data-size='lg'] {
295    height: 32px;
296  }
297
298  button[data-size='md'] {
299    height: 28px;
300  }
301
302  button[data-size='sm'] {
303    height: 24px;
304  }
305
306  button[data-size='lg'] wui-image {
307    width: 24px;
308    height: 24px;
309  }
310
311  button[data-size='md'] wui-image {
312    width: 20px;
313    height: 20px;
314  }
315
316  button[data-size='sm'] wui-image {
317    width: 16px;
318    height: 16px;
319  }
320
321  button[data-size='lg'] .left-icon-container {
322    width: 24px;
323    height: 24px;
324  }
325
326  button[data-size='md'] .left-icon-container {
327    width: 20px;
328    height: 20px;
329  }
330
331  button[data-size='sm'] .left-icon-container {
332    width: 16px;
333    height: 16px;
334  }
335
336  /* -- Variants --------------------------------------------------------- */
337  button[data-type='filled-dropdown'] {
338    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
339  }
340
341  button[data-type='text-dropdown'] {
342    background-color: transparent;
343  }
344
345  /* -- Focus states --------------------------------------------------- */
346  button:focus-visible:enabled {
347    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
348    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
349  }
350
351  /* -- Hover & Active states ----------------------------------------------------------- */
352  @media (hover: hover) and (pointer: fine) {
353    button:hover:enabled,
354    button:active:enabled {
355      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
356    }
357  }
358
359  /* -- Disabled states --------------------------------------------------- */
360  button:disabled {
361    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
362    opacity: 0.5;
363  }
364`,eo=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ei={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},er={lg:"lg",md:"md",sm:"sm"},ea=class extends i.oi{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size="lg",this.type="text-dropdown",this.disabled=!1}render(){return(0,i.dy)`<button ?disabled=${this.disabled} data-size=${this.size} data-type=${this.type}>
365      ${this.imageTemplate()} ${this.textTemplate()}
366      <wui-flex class="right-icon-container">
367        <wui-icon name="chevronBottom"></wui-icon>
368      </wui-flex>
369    </button>`}textTemplate(){let e=ei[this.size];return this.text?(0,i.dy)`<wui-text color="primary" variant=${e}>${this.text}</wui-text>`:null}imageTemplate(){if(this.imageSrc)return(0,i.dy)`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`;let e=er[this.size];return(0,i.dy)` <wui-flex class="left-icon-container">
370      <wui-icon size=${e} name="networkPlaceholder"></wui-icon>
371    </wui-flex>`}};ea.styles=[D.ET,D.ZM,et],eo([(0,r.Cb)()],ea.prototype,"imageSrc",void 0),eo([(0,r.Cb)()],ea.prototype,"text",void 0),eo([(0,r.Cb)()],ea.prototype,"size",void 0),eo([(0,r.Cb)()],ea.prototype,"type",void 0),eo([(0,r.Cb)({type:Boolean})],ea.prototype,"disabled",void 0),ea=eo([(0,L.M)("wui-select")],ea),o(58868),o(58643);var en=o(20357);let es={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(void 0!==en&&void 0!==en.env?en.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};o(61853),o(21508);var ec=(0,W.iv)`
372  button {
373    background-color: transparent;
374    padding: ${({spacing:e})=>e[1]};
375  }
376
377  button:focus-visible {
378    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
379  }
380
381  button[data-variant='accent']:hover:enabled,
382  button[data-variant='accent']:focus-visible {
383    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
384  }
385
386  button[data-variant='primary']:hover:enabled,
387  button[data-variant='primary']:focus-visible,
388  button[data-variant='secondary']:hover:enabled,
389  button[data-variant='secondary']:focus-visible {
390    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
391  }
392
393  button[data-size='xs'] > wui-icon {
394    width: 8px;
395    height: 8px;
396  }
397
398  button[data-size='sm'] > wui-icon {
399    width: 12px;
400    height: 12px;
401  }
402
403  button[data-size='xs'],
404  button[data-size='sm'] {
405    border-radius: ${({borderRadius:e})=>e[1]};
406  }
407
408  button[data-size='md'],
409  button[data-size='lg'] {
410    border-radius: ${({borderRadius:e})=>e[2]};
411  }
412
413  button[data-size='md'] > wui-icon {
414    width: 16px;
415    height: 16px;
416  }
417
418  button[data-size='lg'] > wui-icon {
419    width: 20px;
420    height: 20px;
421  }
422
423  button:disabled {
424    background-color: transparent;
425    cursor: not-allowed;
426    opacity: 0.5;
427  }
428
429  button:hover:not(:disabled) {
430    background-color: var(--wui-color-accent-glass-015);
431  }
432
433  button:focus-visible:not(:disabled) {
434    background-color: var(--wui-color-accent-glass-015);
435    box-shadow:
436      inset 0 0 0 1px var(--wui-color-accent-100),
437      0 0 0 4px var(--wui-color-accent-glass-020);
438  }
439`,el=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ed=class extends i.oi{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="default",this.variant="accent"}render(){return(0,i.dy)`
440      <button data-variant=${this.variant} ?disabled=${this.disabled} data-size=${this.size}>
441        <wui-icon
442          color=${({accent:"accent-primary",primary:"inverse",secondary:"default"})[this.variant]||this.iconColor}
443          size=${this.size}
444          name=${this.icon}
445        ></wui-icon>
446      </button>
447    `}};ed.styles=[D.ET,D.ZM,ec],el([(0,r.Cb)()],ed.prototype,"size",void 0),el([(0,r.Cb)({type:Boolean})],ed.prototype,"disabled",void 0),el([(0,r.Cb)()],ed.prototype,"icon",void 0),el([(0,r.Cb)()],ed.prototype,"iconColor",void 0),el([(0,r.Cb)()],ed.prototype,"variant",void 0),ed=el([(0,L.M)("wui-icon-link")],ed),o(46515),o(75680);let eu=(0,i.YP)`<svg width="86" height="96" fill="none">
448  <path
449    d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
450  />
451</svg>`;var ep=o(1912);let eh=(0,i.YP)`
452  <svg fill="none" viewBox="0 0 36 40">
453    <path
454      d="M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z"
455    />
456  </svg>
457`;var em=(0,W.iv)`
458  :host {
459    position: relative;
460    border-radius: inherit;
461    display: flex;
462    justify-content: center;
463    align-items: center;
464    width: var(--local-width);
465    height: var(--local-height);
466  }
467
468  :host([data-round='true']) {
469    background: ${({tokens:e})=>e.theme.foregroundPrimary};
470    border-radius: 100%;
471    outline: 1px solid ${({tokens:e})=>e.core.glass010};
472  }
473
474  svg {
475    position: absolute;
476    top: 0;
477    left: 0;
478    width: 100%;
479    height: 100%;
480    z-index: 1;
481  }
482
483  svg > path {
484    stroke: var(--local-stroke);
485  }
486
487  wui-image {
488    width: 100%;
489    height: 100%;
490    -webkit-clip-path: var(--local-path);
491    clip-path: var(--local-path);
492    background: ${({tokens:e})=>e.theme.foregroundPrimary};
493  }
494
495  wui-icon {
496    transform: translateY(-5%);
497    width: var(--local-icon-size);
498    height: var(--local-icon-size);
499  }
500`,ew=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let eg=class extends i.oi{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:eh,md:ep.W,lg:eu},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=`
501      --local-width: var(--apkt-spacing-10);
502      --local-height: var(--apkt-spacing-10);
503      --local-icon-size: var(--apkt-spacing-4);
504    `):this.style.cssText=`
505
506      --local-path: var(--apkt-path-network-${this.size});
507      --local-width:  var(--apkt-width-network-${this.size});
508      --local-height:  var(--apkt-height-network-${this.size});
509      --local-icon-size:  var(--apkt-spacing-${({sm:"4",md:"6",lg:"10"})[this.size]});
510    `,(0,i.dy)`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?(0,i.dy)`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:(0,i.dy)`<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`}};eg.styles=[D.ET,em],ew([(0,r.Cb)()],eg.prototype,"size",void 0),ew([(0,r.Cb)()],eg.prototype,"name",void 0),ew([(0,r.Cb)({type:Object})],eg.prototype,"networkImagesBySize",void 0),ew([(0,r.Cb)()],eg.prototype,"imageSrc",void 0),ew([(0,r.Cb)({type:Boolean})],eg.prototype,"selected",void 0),ew([(0,r.Cb)({type:Boolean})],eg.prototype,"round",void 0),eg=ew([(0,L.M)("wui-network-image")],eg);var ey=(0,W.iv)`
511  :host {
512    position: relative;
513    display: flex;
514    width: 100%;
515    height: 1px;
516    background-color: ${({tokens:e})=>e.theme.borderPrimary};
517    justify-content: center;
518    align-items: center;
519  }
520
521  :host > wui-text {
522    position: absolute;
523    padding: 0px 8px;
524    transition: background-color ${({durations:e})=>e.lg}
525      ${({easings:e})=>e["ease-out-power-2"]};
526    will-change: background-color;
527  }
528
529  :host([data-bg-color='primary']) > wui-text {
530    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
531  }
532
533  :host([data-bg-color='secondary']) > wui-text {
534    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
535  }
536`,ef=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let eb=class extends i.oi{constructor(){super(...arguments),this.text="",this.bgColor="primary"}render(){return this.dataset.bgColor=this.bgColor,(0,i.dy)`${this.template()}`}template(){return this.text?(0,i.dy)`<wui-text variant="md-regular" color="secondary">${this.text}</wui-text>`:null}};eb.styles=[D.ET,ey],ef([(0,r.Cb)()],eb.prototype,"text",void 0),ef([(0,r.Cb)()],eb.prototype,"bgColor",void 0),eb=ef([(0,L.M)("wui-separator")],eb),o(37332);var ev=o(51561),ex=o(3147);let ek={INVALID_PAYMENT_CONFIG:"INVALID_PAYMENT_CONFIG",INVALID_RECIPIENT:"INVALID_RECIPIENT",INVALID_ASSET:"INVALID_ASSET",INVALID_AMOUNT:"INVALID_AMOUNT",UNKNOWN_ERROR:"UNKNOWN_ERROR",UNABLE_TO_INITIATE_PAYMENT:"UNABLE_TO_INITIATE_PAYMENT",INVALID_CHAIN_NAMESPACE:"INVALID_CHAIN_NAMESPACE",GENERIC_PAYMENT_ERROR:"GENERIC_PAYMENT_ERROR",UNABLE_TO_GET_EXCHANGES:"UNABLE_TO_GET_EXCHANGES",ASSET_NOT_SUPPORTED:"ASSET_NOT_SUPPORTED",UNABLE_TO_GET_PAY_URL:"UNABLE_TO_GET_PAY_URL",UNABLE_TO_GET_BUY_STATUS:"UNABLE_TO_GET_BUY_STATUS",UNABLE_TO_GET_TOKEN_BALANCES:"UNABLE_TO_GET_TOKEN_BALANCES",UNABLE_TO_GET_QUOTE:"UNABLE_TO_GET_QUOTE",UNABLE_TO_GET_QUOTE_STATUS:"UNABLE_TO_GET_QUOTE_STATUS",INVALID_RECIPIENT_ADDRESS_FOR_ASSET:"INVALID_RECIPIENT_ADDRESS_FOR_ASSET"},eC={[ek.INVALID_PAYMENT_CONFIG]:"Invalid payment configuration",[ek.INVALID_RECIPIENT]:"Invalid recipient address",[ek.INVALID_ASSET]:"Invalid asset specified",[ek.INVALID_AMOUNT]:"Invalid payment amount",[ek.INVALID_RECIPIENT_ADDRESS_FOR_ASSET]:"Invalid recipient address for the asset selected",[ek.UNKNOWN_ERROR]:"Unknown payment error occurred",[ek.UNABLE_TO_INITIATE_PAYMENT]:"Unable to initiate payment",[ek.INVALID_CHAIN_NAMESPACE]:"Invalid chain namespace",[ek.GENERIC_PAYMENT_ERROR]:"Unable to process payment",[ek.UNABLE_TO_GET_EXCHANGES]:"Unable to get exchanges",[ek.ASSET_NOT_SUPPORTED]:"Asset not supported by the selected exchange",[ek.UNABLE_TO_GET_PAY_URL]:"Unable to get payment URL",[ek.UNABLE_TO_GET_BUY_STATUS]:"Unable to get buy status",[ek.UNABLE_TO_GET_TOKEN_BALANCES]:"Unable to get token balances",[ek.UNABLE_TO_GET_QUOTE]:"Unable to get quote. Please choose a different token",[ek.UNABLE_TO_GET_QUOTE_STATUS]:"Unable to get quote status"};class eS extends Error{get message(){return eC[this.code]}constructor(e,t){super(eC[e]),this.name="AppKitPayError",this.code=e,this.details=t,Error.captureStackTrace&&Error.captureStackTrace(this,eS)}}var eT=o(52351);let eA="reown_test";var eI=o(42274),eE=o(96990);async function eP(e,t,o){if(t!==v.b.CHAIN.EVM)throw new eS(ek.INVALID_CHAIN_NAMESPACE);if(!o.fromAddress)throw new eS(ek.INVALID_PAYMENT_CONFIG,"fromAddress is required for native EVM payments.");let i="string"==typeof o.amount?parseFloat(o.amount):o.amount;if(isNaN(i))throw new eS(ek.INVALID_PAYMENT_CONFIG);let r=e.metadata?.decimals??18,a=p.ConnectionController.parseUnits(i.toString(),r);if("bigint"!=typeof a)throw new eS(ek.GENERIC_PAYMENT_ERROR);return await p.ConnectionController.sendTransaction({chainNamespace:t,to:o.recipient,address:o.fromAddress,value:a,data:"0x"})??void 0}async function e$(e,t){if(!t.fromAddress)throw new eS(ek.INVALID_PAYMENT_CONFIG,"fromAddress is required for ERC20 EVM payments.");let o=e.asset,i=t.recipient,r=Number(e.metadata.decimals),a=p.ConnectionController.parseUnits(t.amount.toString(),r);if(void 0===a)throw new eS(ek.GENERIC_PAYMENT_ERROR);return await p.ConnectionController.writeContract({fromAddress:t.fromAddress,tokenAddress:o,args:[i,a],method:"transfer",abi:eI.g.getERC20Abi(o),chainNamespace:v.b.CHAIN.EVM})??void 0}async function eN(e,t){if(e!==v.b.CHAIN.SOLANA)throw new eS(ek.INVALID_CHAIN_NAMESPACE);if(!t.fromAddress)throw new eS(ek.INVALID_PAYMENT_CONFIG,"fromAddress is required for Solana payments.");let o="string"==typeof t.amount?parseFloat(t.amount):t.amount;if(isNaN(o)||o<=0)throw new eS(ek.INVALID_PAYMENT_CONFIG,"Invalid payment amount.");try{if(!eE.O.getProvider(e))throw new eS(ek.GENERIC_PAYMENT_ERROR,"No Solana provider available.");let i=await p.ConnectionController.sendTransaction({chainNamespace:v.b.CHAIN.SOLANA,to:t.recipient,value:o,tokenMint:t.tokenMint});if(!i)throw new eS(ek.GENERIC_PAYMENT_ERROR,"Transaction failed.");return i}catch(e){if(e instanceof eS)throw e;throw new eS(ek.GENERIC_PAYMENT_ERROR,`Solana payment failed: ${e}`)}}async function eR({sourceToken:e,toToken:t,amount:o,recipient:i}){let r=p.ConnectionController.parseUnits(o,e.metadata.decimals),a=p.ConnectionController.parseUnits(o,t.metadata.decimals);return Promise.resolve({type:eZ,origin:{amount:r?.toString()??"0",currency:e},destination:{amount:a?.toString()??"0",currency:t},fees:[{id:"service",label:"Service Fee",amount:"0",currency:t}],steps:[{requestId:eZ,type:"deposit",deposit:{amount:r?.toString()??"0",currency:e.asset,receiver:i}}],timeInSeconds:6})}function eO(e){if(!e)return null;let t=e.steps[0];return t&&t.type===eJ?t:null}function e_(e,t=0){if(!e)return[];let o=e.steps.filter(e=>e.type===e0),i=o.filter((e,o)=>o+1>t);return o.length>0&&o.length<3?i:[]}let eB=new eT.V({baseUrl:T.j.getApiUrl(),clientId:null});
536class eU extends Error{}function eD(){let{projectId:e,sdkType:t,sdkVersion:o}=n.OptionsController.state;return{projectId:e,st:t||"appkit",sv:o||"html-wagmi-4.2.2"}}async function eL(e,t){let o=function(){let e=n.OptionsController.getSnapshot().projectId;return`https://rpc.walletconnect.org/v1/json-rpc?projectId=${e}`}(),{sdkType:i,sdkVersion:r,projectId:a}=n.OptionsController.getSnapshot(),s={jsonrpc:"2.0",id:1,method:e,params:{...t||{},st:i,sv:r,projectId:a}},c=await fetch(o,{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}}),l=await c.json();if(l.error)throw new eU(l.error.message);return l}async function eW(e){return(await eL("reown_getExchanges",e)).result}async function ez(e){return(await eL("reown_getExchangePayUrl",e)).result}async function ej(e){return(await eL("reown_getExchangeBuyStatus",e)).result}async function eF(e){let t=b.C.bigNumber(e.amount).times(10**e.toToken.metadata.decimals).toString(),{chainId:o,chainNamespace:i}=ev.u.parseCaipNetworkId(e.sourceToken.network),{chainId:r,chainNamespace:a}=ev.u.parseCaipNetworkId(e.toToken.network),n="native"===e.sourceToken.asset?(0,C.rG)(i):e.sourceToken.asset,s="native"===e.toToken.asset?(0,C.rG)(a):e.toToken.asset;return await eB.post({path:"/appkit/v1/transfers/quote",body:{user:e.address,originChainId:o.toString(),originCurrency:n,destinationChainId:r.toString(),destinationCurrency:s,recipient:e.recipient,amount:t},params:eD()})}async function eM(e){let t=ex.g.isLowerCaseMatch(e.sourceToken.network,e.toToken.network),o=ex.g.isLowerCaseMatch(e.sourceToken.asset,e.toToken.asset);return t&&o?eR(e):eF(e)}async function eq(e){return await eB.get({path:"/appkit/v1/transfers/status",params:{requestId:e.requestId,...eD()}})}async function eV(e){return await eB.get({path:`/appkit/v1/transfers/assets/exchanges/${e}`,params:eD()})}let eG=["eip155","solana"],eH={eip155:{native:{assetNamespace:"slip44",assetReference:"60"},defaultTokenNamespace:"erc20"},solana:{native:{assetNamespace:"slip44",assetReference:"501"},defaultTokenNamespace:"token"}},eY={56:"714",204:"714"};function eK(e,t){let{chainNamespace:o,chainId:i}=ev.u.parseCaipNetworkId(e),r=eH[o];if(!r)throw Error(`Unsupported chain namespace for CAIP-19 formatting: ${o}`);let a=r.native.assetNamespace,n=r.native.assetReference;"native"!==t?(a=r.defaultTokenNamespace,n=t):"eip155"===o&&eY[i]&&(n=eY[i]);let s=`${o}:${i}`;return`${s}/${a}:${n}`}function eQ(e){let t=b.C.bigNumber(e,{safe:!0});return t.lt(.001)?"<0.001":t.round(4).toString()}let eX="unknown",eZ="direct-transfer",eJ="deposit",e0="transaction",e3=(0,y.sj)({paymentAsset:{network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},recipient:"0x0",amount:0,isConfigured:!1,error:null,isPaymentInProgress:!1,exchanges:[],isLoading:!1,openInNewTab:!0,redirectUrl:void 0,payWithExchange:void 0,currentPayment:void 0,analyticsSet:!1,paymentId:void 0,choice:"pay",tokenBalances:{[v.b.CHAIN.EVM]:[],[v.b.CHAIN.SOLANA]:[]},isFetchingTokenBalances:!1,selectedPaymentAsset:null,quote:void 0,quoteStatus:"waiting",quoteError:null,isFetchingQuote:!1,selectedExchange:void 0,exchangeUrlForQuote:void 0,requestId:void 0}),e1={state:e3,subscribe:e=>(0,y.Ld)(e3,()=>e(e3)),subscribeKey:(e,t)=>(0,f.VW)(e3,e,t),async handleOpenPay(e){this.resetState(),this.setPaymentConfig(e),this.initializeAnalytics(),function(){let{chainNamespace:e}=ev.u.parseCaipNetworkId(e1.state.paymentAsset.network);if(!T.j.isAddress(e1.state.recipient,e))throw new eS(ek.INVALID_RECIPIENT_ADDRESS_FOR_ASSET,`Provide valid recipient address for namespace "${e}"`)}(),await this.prepareTokenLogo(),e3.isConfigured=!0,N.X.sendEvent({type:"track",event:"PAY_MODAL_OPEN",properties:{exchanges:e3.exchanges,configuration:{network:e3.paymentAsset.network,asset:e3.paymentAsset.asset,recipient:e3.recipient,amount:e3.amount}}}),await s.I.open({view:"Pay"})},resetState(){e3.paymentAsset={network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},e3.recipient="0x0",e3.amount=0,e3.isConfigured=!1,e3.error=null,e3.isPaymentInProgress=!1,e3.isLoading=!1,e3.currentPayment=void 0,e3.selectedExchange=void 0,e3.exchangeUrlForQuote=void 0,e3.requestId=void 0},resetQuoteState(){e3.quote=void 0,e3.quoteStatus="waiting",e3.quoteError=null,e3.isFetchingQuote=!1,e3.requestId=void 0},setPaymentConfig(e){if(!e.paymentAsset)throw new eS(ek.INVALID_PAYMENT_CONFIG);try{e3.choice=e.choice??"pay",e3.paymentAsset=e.paymentAsset,e3.recipient=e.recipient,e3.amount=e.amount,e3.openInNewTab=e.openInNewTab??!0,e3.redirectUrl=e.redirectUrl,e3.payWithExchange=e.payWithExchange,e3.error=null}catch(e){throw new eS(ek.INVALID_PAYMENT_CONFIG,e.message)}},setSelectedPaymentAsset(e){e3.selectedPaymentAsset=e},setSelectedExchange(e){e3.selectedExchange=e},setRequestId(e){e3.requestId=e},setPaymentInProgress(e){e3.isPaymentInProgress=e},getPaymentAsset:()=>
536e3.paymentAsset,getExchanges:()=>e3.exchanges,async fetchExchanges(){try{e3.isLoading=!0;let e=await eW({page:0});e3.exchanges=e.exchanges.slice(0,2)}catch(e){throw g.SnackController.showError(eC.UNABLE_TO_GET_EXCHANGES),new eS(ek.UNABLE_TO_GET_EXCHANGES)}finally{e3.isLoading=!1}},async getAvailableExchanges(e){try{let t=e?.asset&&e?.network?eK(e.network,e.asset):void 0;return await eW({page:e?.page??0,asset:t,amount:e?.amount?.toString()})}catch(e){throw new eS(ek.UNABLE_TO_GET_EXCHANGES)}},async getPayUrl(e,t,o=!1){try{let i=Number(t.amount),r=await ez({exchangeId:e,asset:eK(t.network,t.asset),amount:i.toString(),recipient:`${t.network}:${t.recipient}`});return N.X.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{source:"pay",exchange:{id:e},configuration:{network:t.network,asset:t.asset,recipient:t.recipient,amount:i},currentPayment:{type:"exchange",exchangeId:e},headless:o}}),o&&(this.initiatePayment(),N.X.sendEvent({type:"track",event:"PAY_INITIATED",properties:{source:"pay",paymentId:e3.paymentId||eX,configuration:{network:t.network,asset:t.asset,recipient:t.recipient,amount:i},currentPayment:{type:"exchange",exchangeId:e}}})),r}catch(e){if(e instanceof Error&&e.message.includes("is not supported"))throw new eS(ek.ASSET_NOT_SUPPORTED);throw Error(e.message)}},async generateExchangeUrlForQuote({exchangeId:e,paymentAsset:t,amount:o,recipient:i}){let r=await ez({exchangeId:e,asset:eK(t.network,t.asset),amount:o.toString(),recipient:i});e3.exchangeSessionId=r.sessionId,e3.exchangeUrlForQuote=r.url},async openPayUrl(e,t,o=!1){try{let i=await this.getPayUrl(e.exchangeId,t,o);if(!i)throw new eS(ek.UNABLE_TO_GET_PAY_URL);let r=e.openInNewTab??!0;return T.j.openHref(i.url,r?"_blank":"_self"),i}catch(e){throw e instanceof eS?e3.error=e.message:e3.error=eC.GENERIC_PAYMENT_ERROR,new eS(ek.UNABLE_TO_GET_PAY_URL)}},async onTransfer({chainNamespace:e,fromAddress:t,toAddress:o,amount:i,paymentAsset:r}){if(e3.currentPayment={type:"wallet",status:"IN_PROGRESS"},!e3.isPaymentInProgress)try{this.initiatePayment();let a=c.R.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===r.network);if(!a)throw Error("Target network not found");let n=c.R.state.activeCaipNetwork;switch(ex.g.isLowerCaseMatch(n?.caipNetworkId,a.caipNetworkId)||await c.R.switchActiveNetwork(a),e){case v.b.CHAIN.EVM:"native"===r.asset&&(e3.currentPayment.result=await eP(r,e,{recipient:o,amount:i,fromAddress:t})),r.asset.startsWith("0x")&&(e3.currentPayment.result=await e$(r,{recipient:o,amount:i,fromAddress:t})),e3.currentPayment.status="SUCCESS";break;case v.b.CHAIN.SOLANA:e3.currentPayment.result=await eN(e,{recipient:o,amount:i,fromAddress:t,tokenMint:"native"===r.asset?void 0:r.asset}),e3.currentPayment.status="SUCCESS";break;default:throw new eS(ek.INVALID_CHAIN_NAMESPACE)}}catch(e){throw e instanceof eS?e3.error=e.message:e3.error=eC.GENERIC_PAYMENT_ERROR,e3.currentPayment.status="FAILED",g.SnackController.showError(e3.error),e}finally{e3.isPaymentInProgress=!1}},async onSendTransaction(e){try{let{namespace:t,transactionStep:o}=e;e1.initiatePayment();let i=c.R.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===e3.paymentAsset?.network);if(!i)throw Error("Target network not found");let r=c.R.state.activeCaipNetwork;if(ex.g.isLowerCaseMatch(r?.caipNetworkId,i.caipNetworkId)||await c.R.switchActiveNetwork(i),t===v.b.CHAIN.EVM){let{from:e,to:i,data:r,value:a}=o.transaction;await p.ConnectionController.sendTransaction({address:e,to:i,data:r,value:BigInt(a),chainNamespace:t})}else if(t===v.b.CHAIN.SOLANA){let{instructions:e}=o.transaction;await p.ConnectionController.writeSolanaTransaction({instructions:e})}}catch(e){throw e instanceof eS?e3.error=e.message:e3.error=eC.GENERIC_PAYMENT_ERROR,g.SnackController.showError(e3.error),e}finally{e3.isPaymentInProgress=!1}},getExchangeById:e=>e3.exchanges.find(t=>t.id===e),validatePayConfig(e){let{paymentAsset:t,recipient:o,amount:i}=e;if(!t)throw new eS(ek.INVALID_PAYMENT_CONFIG);if(!o)throw new eS(ek.INVALID_RECIPIENT);if(!t.asset)throw new eS(ek.INVALID_ASSET);if(null==i||i<=0)throw new eS(ek.INVALID_AMOUNT)},async handlePayWithExchange(e){try{e3.currentPayment={type:"exchange",exchangeId:e};let{network:t,asset:o}=e3.paymentAsset,i={network:t,asset:o,amount:e3.amount,recipient:e3.re
536cipient},r=await this.getPayUrl(e,i);if(!r)throw new eS(ek.UNABLE_TO_INITIATE_PAYMENT);return e3.currentPayment.sessionId=r.sessionId,e3.currentPayment.status="IN_PROGRESS",e3.currentPayment.exchangeId=e,this.initiatePayment(),{url:r.url,openInNewTab:e3.openInNewTab}}catch(e){return e instanceof eS?e3.error=e.message:e3.error=eC.GENERIC_PAYMENT_ERROR,e3.isPaymentInProgress=!1,g.SnackController.showError(e3.error),null}},async getBuyStatus(e,t){try{let o=await ej({sessionId:t,exchangeId:e});return("SUCCESS"===o.status||"FAILED"===o.status)&&N.X.sendEvent({type:"track",event:"SUCCESS"===o.status?"PAY_SUCCESS":"PAY_ERROR",properties:{message:"FAILED"===o.status?T.j.parseError(e3.error):void 0,source:"pay",paymentId:e3.paymentId||eX,configuration:{network:e3.paymentAsset.network,asset:e3.paymentAsset.asset,recipient:e3.recipient,amount:e3.amount},currentPayment:{type:"exchange",exchangeId:e3.currentPayment?.exchangeId,sessionId:e3.currentPayment?.sessionId,result:o.txHash}}}),o}catch(e){throw new eS(ek.UNABLE_TO_GET_BUY_STATUS)}},async fetchTokensFromEOA({caipAddress:e,caipNetwork:t,namespace:o}){if(!e)return[];let{address:i}=ev.u.parseCaipAddress(e),r=t;return o===v.b.CHAIN.EVM&&(r=void 0),await k.Q.getMyTokensWithBalance({address:i,caipNetwork:r})},async fetchTokensFromExchange(){if(!e3.selectedExchange)return[];let e=Object.values((await eV(e3.selectedExchange.id)).assets).flat();return await Promise.all(e.map(async e=>{let t={chainId:e.network,address:`${e.network}:${e.asset}`,symbol:e.metadata.symbol,name:e.metadata.name,iconUrl:e.metadata.logoURI||"",price:0,quantity:{numeric:"0",decimals:e.metadata.decimals.toString()}},{chainNamespace:o}=ev.u.parseCaipNetworkId(t.chainId),i=t.address;if(T.j.isCaipAddress(i)){let{address:e}=ev.u.parseCaipAddress(i);i=e}let r=await Q.f.getImageByToken(i??"",o).catch(()=>void 0);return t.iconUrl=r??"",t}))},async fetchTokens({caipAddress:e,caipNetwork:t,namespace:o}){try{e3.isFetchingTokenBalances=!0;let i=e3.selectedExchange?this.fetchTokensFromExchange():this.fetchTokensFromEOA({caipAddress:e,caipNetwork:t,namespace:o}),r=await i;e3.tokenBalances={...e3.tokenBalances,[o]:r}}catch(t){let e=t instanceof Error?t.message:"Unable to get token balances";g.SnackController.showError(e)}finally{e3.isFetchingTokenBalances=!1}},async fetchQuote({amount:e,address:t,sourceToken:o,toToken:i,recipient:r}){try{e1.resetQuoteState(),e3.isFetchingQuote=!0;let a=await eM({amount:e,address:e3.selectedExchange?void 0:t,sourceToken:o,toToken:i,recipient:r});if(e3.selectedExchange){let e=eO(a);if(e){let t=`${o.network}:${e.deposit.receiver}`,i=b.C.formatNumber(e.deposit.amount,{decimals:o.metadata.decimals??0,round:8});await e1.generateExchangeUrlForQuote({exchangeId:e3.selectedExchange.id,paymentAsset:o,amount:i.toString(),recipient:t})}}e3.quote=a}catch(t){let e=eC.UNABLE_TO_GET_QUOTE;if(t instanceof Error&&t.cause&&t.cause instanceof Response)try{let o=await t.cause.json();o.error&&"string"==typeof o.error&&(e=o.error)}catch{}throw e3.quoteError=e,g.SnackController.showError(e),new eS(ek.UNABLE_TO_GET_QUOTE)}finally{e3.isFetchingQuote=!1}},async fetchQuoteStatus({requestId:e}){try{if(e===eZ){let e=e3.selectedExchange,t=e3.exchangeSessionId;if(e&&t){switch((await this.getBuyStatus(e.id,t)).status){case"IN_PROGRESS":case"UNKNOWN":default:e3.quoteStatus="waiting";break;case"SUCCESS":e3.quoteStatus="success",e3.isPaymentInProgress=!1;break;case"FAILED":e3.quoteStatus="failure",e3.isPaymentInProgress=!1}return}e3.quoteStatus="success";return}let{status:t}=await eq({requestId:e});e3.quoteStatus=t}catch{throw e3.quoteStatus="failure",new eS(ek.UNABLE_TO_GET_QUOTE_STATUS)}},initiatePayment(){e3.isPaymentInProgress=!0,e3.paymentId=crypto.randomUUID()},initializeAnalytics(){e3.analyticsSet||(e3.analyticsSet=!0,this.subscribeKey("isPaymentInProgress",e=>{if(e3.currentPayment?.status&&"UNKNOWN"!==e3.currentPayment.status){let e={IN_PROGRESS:"PAY_INITIATED",SUCCESS:"PAY_SUCCESS",FAILED:"PAY_ERROR"}[e3.currentPayment.status];N.X.sendEvent({type:"track",event:e,properties:{message:"FAILED"===e3.currentPayment.status?T.j.parseError(e3.error):void 0,source:"pay",paymentId:e3.paymentId||eX,configuration:{network:e3.paymentAsset.network,asset:e3.paymentAsset.asset,recipient:e3.re
536cipient,amount:e3.amount},currentPayment:{type:e3.currentPayment.type,exchangeId:e3.currentPayment.exchangeId,sessionId:e3.currentPayment.sessionId,result:e3.currentPayment.result}}})}}))},async prepareTokenLogo(){if(!e3.paymentAsset.metadata.logoURI)try{let{chainNamespace:e}=ev.u.parseCaipNetworkId(e3.paymentAsset.network),t=await Q.f.getImageByToken(e3.paymentAsset.asset,e);e3.paymentAsset.metadata.logoURI=t}catch{}}};var e2=(0,U.iv)`
537  wui-separator {
538    margin: var(--apkt-spacing-3) calc(var(--apkt-spacing-3) * -1) var(--apkt-spacing-2)
539      calc(var(--apkt-spacing-3) * -1);
540    width: calc(100% + var(--apkt-spacing-3) * 2);
541  }
542
543  .token-display {
544    padding: var(--apkt-spacing-3) var(--apkt-spacing-3);
545    border-radius: var(--apkt-borderRadius-5);
546    background-color: var(--apkt-tokens-theme-backgroundPrimary);
547    margin-top: var(--apkt-spacing-3);
548    margin-bottom: var(--apkt-spacing-3);
549  }
550
551  .token-display wui-text {
552    text-transform: none;
553  }
554
555  wui-loading-spinner {
556    padding: var(--apkt-spacing-2);
557  }
558
559  .left-image-container {
560    position: relative;
561    justify-content: center;
562    align-items: center;
563  }
564
565  .token-image {
566    border-radius: ${({borderRadius:e})=>e.round};
567    width: 40px;
568    height: 40px;
569  }
570
571  .chain-image {
572    position: absolute;
573    width: 20px;
574    height: 20px;
575    bottom: -3px;
576    right: -5px;
577    border-radius: ${({borderRadius:e})=>e.round};
578    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
579  }
580
581  .payment-methods-container {
582    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
583    border-top-right-radius: ${({borderRadius:e})=>e[8]};
584    border-top-left-radius: ${({borderRadius:e})=>e[8]};
585  }
586`,e5=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let e4=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.amount=e1.state.amount,this.namespace=void 0,this.paymentAsset=e1.state.paymentAsset,this.activeConnectorIds=l.ConnectorController.state.activeConnectorIds,this.caipAddress=void 0,this.exchanges=e1.state.exchanges,this.isLoading=e1.state.isLoading,this.initializeNamespace(),this.unsubscribe.push(e1.subscribeKey("amount",e=>this.amount=e)),this.unsubscribe.push(l.ConnectorController.subscribeKey("activeConnectorIds",e=>this.activeConnectorIds=e)),this.unsubscribe.push(e1.subscribeKey("exchanges",e=>this.exchanges=e)),this.unsubscribe.push(e1.subscribeKey("isLoading",e=>this.isLoading=e)),e1.fetchExchanges(),e1.setSelectedExchange(void 0)}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,i.dy)`
587      <wui-flex flexDirection="column">
588        ${this.paymentDetailsTemplate()} ${this.paymentMethodsTemplate()}
589      </wui-flex>
590    `}paymentMethodsTemplate(){return(0,i.dy)`
591      <wui-flex flexDirection="column" padding="3" gap="2" class="payment-methods-container">
592        ${this.payWithWalletTemplate()} ${this.templateSeparator()}
593        ${this.templateExchangeOptions()}
594      </wui-flex>
595    `}initializeNamespace(){let e=c.R.state.activeChain;this.namespace=e,this.caipAddress=c.R.getAccountData(e)?.caipAddress,this.unsubscribe.push(c.R.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress},e))}paymentDetailsTemplate(){let e=c.R.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===this.paymentAsset.network);return(0,i.dy)`
596      <wui-flex
597        alignItems="center"
598        justifyContent="space-between"
599        .padding=${["6","8","6","8"]}
600        gap="2"
601      >
602        <wui-flex alignItems="center" gap="1">
603          <wui-text variant="h1-regular" color="primary">
604            ${eQ(this.amount||"0")}
605          </wui-text>
606
607          <wui-flex flexDirection="column">
608            <wui-text variant="h6-regular" color="secondary">
609              ${this.paymentAsset.metadata.symbol||"Unknown"}
610            </wui-text>
611            <wui-text variant="md-medium" color="secondary"
612              >on ${e?.name||"Unknown"}</wui-text
613            >
614          </wui-flex>
615        </wui-flex>
616
617        <wui-flex class="left-image-container">
618          <wui-image
619            src=${(0,a.o)(this.paymentAsset.metadata.logoURI)}
620            class="token-image"
621          ></wui-image>
622          <wui-image
623            src=${(0,a.o)(Q.f.getNetworkImage(e))}
624            class="chain-image"
625          ></wui-image>
626        </wui-flex>
627      </wui-flex>
628    `}payWithWalletTemplate(){return!function(e){let{chainNamespace:t}=ev.u.parseCaipNetworkId(e);return eG.includes(t)}(this.paymentAsset.network)?(0,i.dy)``:this.caipAddress?this.connectedWalletTemplate():this.disconnectedWalletTemplate()}connectedWalletTemplate(){let{name:e,image:t}=this.getWalletProperties({namespace:this.namespace});return(0,i.dy)`
629      <wui-flex flexDirection="column" gap="3">
630        <wui-list-item
631          type="secondary"
632          boxColor="foregroundSecondary"
633          @click=${this.onWalletPayment}
634          .boxed=${!1}
635          ?chevron=${!0}
636          ?fullSize=${!1}
637          ?rounded=${!0}
638          data-testid="wallet-payment-option"
639          imageSrc=${(0,a.o)(t)}
640          imageSize="3xl"
641        >
642          <wui-text variant="lg-regular" color="primary">Pay with ${e}</wui-text>
643        </wui-list-item>
644
645        <wui-list-item
646          type="secondary"
647          icon="power"
648          iconColor="error"
649          @click=${this.onDisconnect}
650          data-testid="disconnect-button"
651          ?chevron=${!1}
652          boxColor="foregroundSecondary"
653        >
654          <wui-text variant="lg-regular" color="secondary">Disconnect</wui-text>
655        </wui-list-item>
656      </wui-flex>
657    `}disconnectedWalletTemplate(){return(0,i.dy)`<wui-list-item
658      type="secondary"
659      boxColor="foregroundSecondary"
660      variant="icon"
661      iconColor="default"
662      iconVariant="overlay"
663      icon="wallet"
664      @click=${this.onWalletPayment}
665      ?chevron=${!0}
666      data-testid="wallet-payment-option"
667    >
668      <wui-text variant="lg-regular" color="primary">Pay with wallet</wui-text>
669    </wui-list-item>`}templateExchangeOptions(){if(this.isLoading)return(0,i.dy)`<wui-flex justifyContent="center" alignItems="center">
670        <wui-loading-spinner size="md"></wui-loading-spinner>
671      </wui-flex>`;let e=this.exchanges.filter(e=>!function(e){let t=c.R.getAllRequestedCaipNetworks().find(t=>t.caipNetworkId===e.network);return!!t&&!!t.testnet}(this.paymentAsset)?e.id!==eA:e.id===eA);return 0===e.length?(0,i.dy)`<wui-flex justifyContent="center" alignItems="center">
672        <wui-text variant="md-medium" color="primary">No exchanges available</wui-text>
673      </wui-flex>`:e.map(e=>(0,i.dy)`
674        <wui-list-item
675          type="secondary"
676          boxColor="foregroundSecondary"
677          @click=${()=>this.onExchangePayment(e)}
678          data-testid="exchange-option-${e.id}"
679          ?chevron=${!0}
680          imageSrc=${(0,a.o)(e.imageUrl)}
681        >
682          <wui-text flexGrow="1" variant="lg-regular" color="primary">
683            Pay with ${e.name}
684          </wui-text>
685        </wui-list-item>
686      `)}templateSeparator(){return(0,i.dy)`<wui-separator text="or" bgColor="secondary"></wui-separator>`}async onWalletPayment(){if(!this.namespace)throw Error("Namespace not found");this.caipAddress?u.RouterController.push("PayQuote"):(await l.ConnectorController.connect(),await s.I.open({view:"PayQuote"}))}onExchangePayment(e){e1.setSelectedExchange(e),u.RouterController.push("PayQuote")}async onDisconnect(){try{await p.ConnectionController.disconnect(),await s.I.open({view:"Pay"})}catch{console.error("Failed to disconnect"),g.SnackController.showError("Failed to disconnect")}}getWalletProperties({namespace:e}){if(!e)return{name:void 0,image:void 0};let t=this.activeConnectorIds[e];if(!t)return{name:void 0,image:void 0};let o=l.ConnectorController.getConnector({id:t,namespace:e});if(!o)return{name:void 0,image:void 0};let i=Q.f.getConnectorImage(o);return{name:o.name,image:i}}};e4.styles=e2,e5([(0,r.SB)()],e4.prototype,"amount",void 0),e5([(0,r.SB)()],e4.prototype,"namespace",void 0),e5([(0,r.SB)()],e4.prototype,"paymentAsset",void 0),e5([(0,r.SB)()],e4.prototype,"activeConnectorIds",void 0),e5([(0,r.SB)()],e4.prototype,"caipAddress",void 0),e5([(0,r.SB)()],e4.prototype,"exchanges",void 0),e5([(0,r.SB)()],e4.prototype,"isLoading",void 0),e4=e5([(0,U.Mo)("w3m-pay-view")],e4);var e6=o(78290),e8=(0,W.iv)`
687  :host {
688    display: inline-flex;
689    align-items: center;
690    justify-content: center;
691  }
692
693  .pulse-container {
694    position: relative;
695    width: var(--pulse-size);
696    height: var(--pulse-size);
697    display: flex;
698    align-items: center;
699    justify-content: center;
700  }
701
702  .pulse-rings {
703    position: absolute;
704    inset: 0;
705    pointer-events: none;
706  }
707
708  .pulse-ring {
709    position: absolute;
710    inset: 0;
711    border-radius: 50%;
712    border: 2px solid var(--pulse-color);
713    opacity: 0;
714    animation: pulse var(--pulse-duration, 2s) ease-out infinite;
715  }
716
717  .pulse-content {
718    position: relative;
719    z-index: 1;
720    display: flex;
721    align-items: center;
722    justify-content: center;
723  }
724
725  @keyframes pulse {
726    0% {
727      transform: scale(0.5);
728      opacity: var(--pulse-opacity, 0.3);
729    }
730    50% {
731      opacity: calc(var(--pulse-opacity, 0.3) * 0.5);
732    }
733    100% {
734      transform: scale(1.2);
735      opacity: 0;
736    }
737  }
738`,e7=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let e9={"accent-primary":W.gR.tokens.core.backgroundAccentPrimary},te=class extends i.oi{constructor(){super(...arguments),this.rings=3,this.duration=2,this.opacity=.3,this.size="200px",this.variant="accent-primary"}render(){let e=e9[this.variant];this.style.cssText=`
739      --pulse-size: ${this.size};
740      --pulse-duration: ${this.duration}s;
741      --pulse-color: ${e};
742      --pulse-opacity: ${this.opacity};
743    `;let t=Array.from({length:this.rings},(e,t)=>this.renderRing(t,this.rings));return(0,i.dy)`
744      <div class="pulse-container">
745        <div class="pulse-rings">${t}</div>
746        <div class="pulse-content">
747          <slot></slot>
748        </div>
749      </div>
750    `}renderRing(e,t){let o=e/t*this.duration,r=`animation-delay: ${o}s;`;return(0,i.dy)`<div class="pulse-ring" style=${r}></div>`}};te.styles=[D.ET,e8],e7([(0,r.Cb)({type:Number})],te.prototype,"rings",void 0),e7([(0,r.Cb)({type:Number})],te.prototype,"duration",void 0),e7([(0,r.Cb)({type:Number})],te.prototype,"opacity",void 0),e7([(0,r.Cb)()],te.prototype,"size",void 0),e7([(0,r.Cb)()],te.prototype,"variant",void 0),te=e7([(0,L.M)("wui-pulse")],te);let tt=[{id:"received",title:"Receiving funds",icon:"dollar"},{id:"processing",title:"Swapping asset",icon:"recycleHorizontal"},{id:"sending",title:"Sending asset to the recipient address",icon:"send"}],to=["success","submitted","failure","timeout","refund"];var ti=(0,U.iv)`
751  :host {
752    display: block;
753    height: 100%;
754    width: 100%;
755  }
756
757  wui-image {
758    border-radius: ${({borderRadius:e})=>e.round};
759  }
760
761  .token-badge-container {
762    position: absolute;
763    bottom: 6px;
764    left: 50%;
765    transform: translateX(-50%);
766    border-radius: ${({borderRadius:e})=>e[4]};
767    z-index: 3;
768    min-width: 105px;
769  }
770
771  .token-badge-container.loading {
772    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
773    border: 3px solid ${({tokens:e})=>e.theme.backgroundPrimary};
774  }
775
776  .token-badge-container.success {
777    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
778    border: 3px solid ${({tokens:e})=>e.theme.backgroundPrimary};
779  }
780
781  .token-image-container {
782    position: relative;
783  }
784
785  .token-image {
786    border-radius: ${({borderRadius:e})=>e.round};
787    width: 64px;
788    height: 64px;
789  }
790
791  .token-image.success {
792    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
793  }
794
795  .token-image.error {
796    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
797  }
798
799  .token-image.loading {
800    background: ${({colors:e})=>e.accent010};
801  }
802
803  .token-image wui-icon {
804    width: 32px;
805    height: 32px;
806  }
807
808  .token-badge {
809    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
810    border: 1px solid ${({tokens:e})=>e.theme.foregroundSecondary};
811    border-radius: ${({borderRadius:e})=>e[4]};
812  }
813
814  .token-badge wui-text {
815    white-space: nowrap;
816  }
817
818  .payment-lifecycle-container {
819    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
820    border-top-right-radius: ${({borderRadius:e})=>e[6]};
821    border-top-left-radius: ${({borderRadius:e})=>e[6]};
822  }
823
824  .payment-step-badge {
825    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
826    border-radius: ${({borderRadius:e})=>e[1]};
827  }
828
829  .payment-step-badge.loading {
830    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
831  }
832
833  .payment-step-badge.error {
834    background-color: ${({tokens:e})=>e.core.backgroundError};
835  }
836
837  .payment-step-badge.success {
838    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
839  }
840
841  .step-icon-container {
842    position: relative;
843    height: 40px;
844    width: 40px;
845    border-radius: ${({borderRadius:e})=>e.round};
846    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
847  }
848
849  .step-icon-box {
850    position: absolute;
851    right: -4px;
852    bottom: -1px;
853    padding: 2px;
854    border-radius: ${({borderRadius:e})=>e.round};
855    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
856    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
857  }
858
859  .step-icon-box.success {
860    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
861  }
862`,tr=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ta={received:["pending","success","submitted"],processing:["success","submitted"],sending:["success","submitted"]},tn=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.pollingInterval=null,this.paymentAsset=e1.state.paymentAsset,this.quoteStatus=e1.state.quoteStatus,this.quote=e1.state.quote,this.amount=e1.state.amount,this.namespace=void 0,this.caipAddress=void 0,this.profileName=null,this.activeConnectorIds=l.ConnectorController.state.activeConnectorIds,this.selectedExchange=e1.state.selectedExchange,this.initializeNamespace(),this.unsubscribe.push(e1.subscribeKey("quoteStatus",e=>this.quoteStatus=e),e1.subscribeKey("quote",e=>this.quote=e),l.ConnectorController.subscribeKey("activeConnectorIds",e=>this.activeConnectorIds=e),e1.subscribeKey("selectedExchange",e=>this.selectedExchange=e))}connectedCallback(){super.connectedCallback(),this.startPolling()}disconnectedCallback(){super.disconnectedCallback(),this.stopPolling(),this.unsubscribe.forEach(e
862=>e())}render(){return(0,i.dy)`
863      <wui-flex flexDirection="column" .padding=${["3","0","0","0"]} gap="2">
864        ${this.tokenTemplate()} ${this.paymentTemplate()} ${this.paymentLifecycleTemplate()}
865      </wui-flex>
866    `}tokenTemplate(){let e=eQ(this.amount||"0"),t=this.paymentAsset.metadata.symbol??"Unknown",o=c.R.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===this.paymentAsset.network),r="failure"===this.quoteStatus||"timeout"===this.quoteStatus||"refund"===this.quoteStatus;return"success"===this.quoteStatus||"submitted"===this.quoteStatus?(0,i.dy)`<wui-flex alignItems="center" justifyContent="center">
867        <wui-flex justifyContent="center" alignItems="center" class="token-image success">
868          <wui-icon name="checkmark" color="success" size="inherit"></wui-icon>
869        </wui-flex>
870      </wui-flex>`:r?(0,i.dy)`<wui-flex alignItems="center" justifyContent="center">
871        <wui-flex justifyContent="center" alignItems="center" class="token-image error">
872          <wui-icon name="close" color="error" size="inherit"></wui-icon>
873        </wui-flex>
874      </wui-flex>`:(0,i.dy)`
875      <wui-flex alignItems="center" justifyContent="center">
876        <wui-flex class="token-image-container">
877          <wui-pulse size="125px" rings="3" duration="4" opacity="0.5" variant="accent-primary">
878            <wui-flex justifyContent="center" alignItems="center" class="token-image loading">
879              <wui-icon name="paperPlaneTitle" color="accent-primary" size="inherit"></wui-icon>
880            </wui-flex>
881          </wui-pulse>
882
883          <wui-flex
884            justifyContent="center"
885            alignItems="center"
886            class="token-badge-container loading"
887          >
888            <wui-flex
889              alignItems="center"
890              justifyContent="center"
891              gap="01"
892              padding="1"
893              class="token-badge"
894            >
895              <wui-image
896                src=${(0,a.o)(Q.f.getNetworkImage(o))}
897                class="chain-image"
898                size="mdl"
899              ></wui-image>
900
901              <wui-text variant="lg-regular" color="primary">${e} ${t}</wui-text>
902            </wui-flex>
903          </wui-flex>
904        </wui-flex>
905      </wui-flex>
906    `}paymentTemplate(){return(0,i.dy)`
907      <wui-flex flexDirection="column" gap="2" .padding=${["0","6","0","6"]}>
908        ${this.renderPayment()}
909        <wui-separator></wui-separator>
910        ${this.renderWallet()}
911      </wui-flex>
912    `}paymentLifecycleTemplate(){let e=this.getStepsWithStatus();return(0,i.dy)`
913      <wui-flex flexDirection="column" padding="4" gap="2" class="payment-lifecycle-container">
914        <wui-flex alignItems="center" justifyContent="space-between">
915          <wui-text variant="md-regular" color="secondary">PAYMENT CYCLE</wui-text>
916
917          ${this.renderPaymentCycleBadge()}
918        </wui-flex>
919
920        <wui-flex flexDirection="column" gap="5" .padding=${["2","0","2","0"]}>
921          ${e.map(e=>this.renderStep(e))}
922        </wui-flex>
923      </wui-flex>
924    `}renderPaymentCycleBadge(){let e="failure"===this.quoteStatus||"timeout"===this.quoteStatus||"refund"===this.quoteStatus,t="success"===this.quoteStatus||"submitted"===this.quoteStatus;if(e)return(0,i.dy)`
925        <wui-flex
926          justifyContent="center"
927          alignItems="center"
928          class="payment-step-badge error"
929          gap="1"
930        >
931          <wui-icon name="close" color="error" size="xs"></wui-icon>
932          <wui-text variant="sm-regular" color="error">Failed</wui-text>
933        </wui-flex>
934      `;if(t)return(0,i.dy)`
935        <wui-flex
936          justifyContent="center"
937          alignItems="center"
938          class="payment-step-badge success"
939          gap="1"
940        >
941          <wui-icon name="checkmark" color="success" size="xs"></wui-icon>
942          <wui-text variant="sm-regular" color="success">Completed</wui-text>
943        </wui-flex>
944      `;let o=this.quote?.timeInSeconds??0;return(0,i.dy)`
945      <wui-flex alignItems="center" justifyContent="space-between" gap="3">
946        <wui-flex
947          justifyContent="center"
948          alignItems="center"
949          class="payment-step-badge loading"
950          gap="1"
951        >
952          <wui-icon name="clock" color="default" size="xs"></wui-icon>
953          <wui-text variant="sm-regular" color="primary">Est. ${o} sec</wui-text>
954        </wui-flex>
955
956        <wui-icon name="chevronBottom" color="default" size="xxs"></wui-icon>
957      </wui-flex>
958    `}renderPayment(){let e=c.R.getAllRequestedCaipNetworks().find(e=>{let t=this.quote?.origin.currency.network;if(!t)return!1;let{chainId:o}=ev.u.parseCaipNetworkId(t);return ex.g.isLowerCaseMatch(e.id.toString(),o.toString())}),t=eQ(b.C.formatNumber(this.quote?.origin.amount||"0",{decimals:this.quote?.origin.currency.metadata.decimals??0}).toString()),o=this.quote?.origin.currency.metadata.symbol??"Unknown";return(0,i.dy)`
959      <wui-flex
960        alignItems="flex-start"
961        justifyContent="space-between"
962        .padding=${["3","0","3","0"]}
963      >
964        <wui-text variant="lg-regular" color="secondary">Payment Method</wui-text>
965
966        <wui-flex flexDirection="column" alignItems="flex-end" gap="1">
967          <wui-flex alignItems="center" gap="01">
968            <wui-text variant="lg-regular" color="primary">${t}</wui-text>
969            <wui-text variant="lg-regular" color="secondary">${o}</wui-text>
970          </wui-flex>
971
972          <wui-flex alignItems="center" gap="1">
973            <wui-text variant="md-regular" color="secondary">on</wui-text>
974            <wui-image
975              src=${(0,a.o)(Q.f.getNetworkImage(e))}
976              size="xs"
977            ></wui-image>
978            <wui-text variant="md-regular" color="secondary">${e?.name}</wui-text>
979          </wui-flex>
980        </wui-flex>
981      </wui-flex>
982    `}renderWallet(){return(0,i.dy)`
983      <wui-flex
984        alignItems="flex-start"
985        justifyContent="space-between"
986        .padding=${["3","0","3","0"]}
987      >
988        <wui-text variant="lg-regular" color="secondary"
989          >${this.selectedExchange?"Exchange":"Wallet"}</wui-text
990        >
991
992        ${this.renderWalletText()}
993      </wui-flex>
994    `}renderWalletText(){let{image:e}=this.getWalletProperties({namespace:this.namespace}),{address:t}=this.caipAddress?ev.u.parseCaipAddress(this.caipAddress):{},o=this.selectedExchange?.name;return this.selectedExchange?(0,i.dy)`
995        <wui-flex alignItems="center" justifyContent="flex-end" gap="1">
996          <wui-text variant="lg-regular" color="primary">${o}</wui-text>
997          <wui-image src=${(0,a.o)(this.selectedExchange.imageUrl)} size="mdl"></wui-image>
998        </wui-flex>
999      `:(0,i.dy)`
1000      <wui-flex alignItems="center" justifyContent="flex-end" gap="1">
1001        <wui-text variant="lg-regular" color="primary">
1002          ${U.Hg.getTruncateString({string:this.profileName||t||o||"",charsStart:this.profileName?16:4,charsEnd:this.profileName?0:6,truncate:this.profileName?"end":"middle"})}
1003        </wui-text>
1004
1005        <wui-image src=${(0,a.o)(e)} size="mdl"></wui-image>
1006      </wui-flex>
1007    `}getStepsWithStatus(){return"failure"===this.quoteStatus||"timeout"===this.quoteStatus||"refund"===this.quoteStatus?tt.map(e=>({...e,status:"failed"})):tt.map(e=>{let t=(ta[e.id]??[]).includes(this.quoteStatus)?"completed":"pending";return{...e,status:t}})}renderStep({title:e,icon:t,status:o}){return(0,i.dy)`
1008      <wui-flex alignItems="center" gap="3">
1009        <wui-flex justifyContent="center" alignItems="center" class="step-icon-container">
1010          <wui-icon name=${t} color="default" size="mdl"></wui-icon>
1011
1012          <wui-flex alignItems="center" justifyContent="center" class=${(0,e6.$)({"step-icon-box":!0,success:"completed"===o})}>
1013            ${this.renderStatusIndicator(o)}
1014          </wui-flex>
1015        </wui-flex>
1016
1017        <wui-text variant="md-regular" color="primary">${e}</wui-text>
1018      </wui-flex>
1019    `}renderStatusIndicator(e){return"completed"===e?(0,i.dy)`<wui-icon size="sm" color="success" name="checkmark"></wui-icon>`:"failed"===e?(0,i.dy)`<wui-icon size="sm" color="error" name="close"></wui-icon>`:"pending"===e?(0,i.dy)`<wui-loading-spinner color="accent-primary" size="sm"></wui-loading-spinner>`:null}startPolling(){this.pollingInterval||(this.fetchQuoteStatus(),this.pollingInterval=setInterval(()=>{this.fetchQuoteStatus()},3e3))}stopPolling(){this.pollingInterval&&(clearInterval(this.pollingInterval),this.pollingInterval=null)}async fetchQuoteStatus(){let e=e1.state.requestId;if(!e||to.includes(this.quoteStatus))this.stopPolling();else try{await e1.fetchQuoteStatus({requestId:e}),to.includes(this.quoteStatus)&&this.stopPolling()}catch{this.stopPolling()}}initializeNamespace(){let e=c.R.state.activeChain;this.namespace=e,this.caipAddress=c.R.getAccountData(e)?.caipAddress,this.profileName=c.R.getAccountData(e)?.profileName??null,this.unsubscribe.push(c.R.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress,this.profileName=e?.profileName??null},e))}getWalletProperties({namespace:e}){if(!e)return{name:void 0,image:void 0};let t=this.activeConnectorIds[e];if(!t)return{name:void 0,image:void 0};let o=l.ConnectorController.getConnector({id:t,namespace:e});if(!o)return{name:void 0,image:void 0};let i=Q.f.getConnectorImage(o);return{name:o.name,image:i}}};tn.styles=ti,tr([(0,r.SB)()],tn.prototype,"paymentAsset",void 0),tr([(0,r.SB)()],tn.prototype,"quoteStatus",void 0),tr([(0,r.SB)()],tn.prototype,"quote",void 0),tr([(0,r.SB)()],tn.prototype,"amount",void 0),tr([(0,r.SB)()],tn.prototype,"namespace",void 0),tr([(0,r.SB)()],tn.prototype,"caipAddress",void 0),tr([(0,r.SB)()],tn.prototype,"profileName",void 0),tr([(0,r.SB)()],tn.prototype,"activeConnectorIds",void 0),tr([(0,r.SB)()],tn.prototype,"selectedExchange",void 0),tn=tr([(0,U.Mo)("w3m-pay-loading-view")],tn
1019);var ts=o(46674),tc=(0,W.iv)`
1020  button {
1021    display: flex;
1022    align-items: center;
1023    height: 40px;
1024    padding: ${({spacing:e})=>e[2]};
1025    border-radius: ${({borderRadius:e})=>e[4]};
1026    column-gap: ${({spacing:e})=>e[1]};
1027    background-color: transparent;
1028    transition: background-color ${({durations:e})=>e.lg}
1029      ${({easings:e})=>e["ease-out-power-2"]};
1030    will-change: background-color;
1031  }
1032
1033  wui-image,
1034  .icon-box {
1035    width: ${({spacing:e})=>e[6]};
1036    height: ${({spacing:e})=>e[6]};
1037    border-radius: ${({borderRadius:e})=>e[4]};
1038  }
1039
1040  wui-text {
1041    flex: 1;
1042  }
1043
1044  .icon-box {
1045    position: relative;
1046  }
1047
1048  .icon-box[data-active='true'] {
1049    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1050  }
1051
1052  .circle {
1053    position: absolute;
1054    left: 16px;
1055    top: 15px;
1056    width: 8px;
1057    height: 8px;
1058    background-color: ${({tokens:e})=>e.core.textSuccess};
1059    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.foregroundPrimary};
1060    border-radius: 50%;
1061  }
1062
1063  /* -- Hover & Active states ----------------------------------------------------------- */
1064  @media (hover: hover) {
1065    button:hover:enabled,
1066    button:active:enabled {
1067      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1068    }
1069  }
1070`,tl=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let td=class extends i.oi{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.enableGreenCircle=!0,this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return(0,i.dy)`
1071      <button>
1072        ${this.leftImageTemplate()} ${this.textTemplate()} ${this.rightImageTemplate()}
1073      </button>
1074    `}leftImageTemplate(){let e=this.icon?(0,i.dy)`<wui-icon
1075          size=${(0,a.o)(this.iconSize)}
1076          color="default"
1077          name=${this.icon}
1078          class="icon"
1079        ></wui-icon>`:(0,i.dy)`<wui-image src=${this.imageSrc} alt=${this.alt}></wui-image>`;return(0,i.dy)`
1080      <wui-flex
1081        alignItems="center"
1082        justifyContent="center"
1083        class="icon-box"
1084        data-active=${!!this.icon}
1085      >
1086        ${e}
1087        ${this.enableGreenCircle?(0,i.dy)`<wui-flex class="circle"></wui-flex>`:null}
1088      </wui-flex>
1089    `}textTemplate(){return(0,i.dy)`
1090      <wui-text variant="lg-regular" color="primary">
1091        ${ts.H.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})}
1092      </wui-text>
1093    `}rightImageTemplate(){return(0,i.dy)`<wui-icon name="chevronBottom" size="sm" color="default"></wui-icon>`}};td.styles=[D.ET,D.ZM,tc],tl([(0,r.Cb)()],td.prototype,"address",void 0),tl([(0,r.Cb)()],td.prototype,"profileName",void 0),tl([(0,r.Cb)()],td.prototype,"alt",void 0),tl([(0,r.Cb)()],td.prototype,"imageSrc",void 0),tl([(0,r.Cb)()],td.prototype,"icon",void 0),tl([(0,r.Cb)()],td.prototype,"iconSize",void 0),tl([(0,r.Cb)({type:Boolean})],td.prototype,"enableGreenCircle",void 0),tl([(0,r.Cb)({type:Boolean})],td.prototype,"loading",void 0),tl([(0,r.Cb)({type:Number})],td.prototype,"charsStart",void 0),tl([(0,r.Cb)({type:Number})],td.prototype,"charsEnd",void 0),td=tl([(0,L.M)("wui-wallet-switch")],td),o(30204);var tu=(0,i.iv)`
1094  :host {
1095    display: block;
1096  }
1097`;let tp=class extends i.oi{render(){return(0,i.dy)`
1098      <wui-flex flexDirection="column" gap="4">
1099        <wui-flex alignItems="center" justifyContent="space-between">
1100          <wui-text variant="md-regular" color="secondary">Pay</wui-text>
1101          <wui-shimmer width="60px" height="16px" borderRadius="4xs" variant="light"></wui-shimmer>
1102        </wui-flex>
1103
1104        <wui-flex alignItems="center" justifyContent="space-between">
1105          <wui-text variant="md-regular" color="secondary">Network Fee</wui-text>
1106
1107          <wui-flex flexDirection="column" alignItems="flex-end" gap="2">
1108            <wui-shimmer
1109              width="75px"
1110              height="16px"
1111              borderRadius="4xs"
1112              variant="light"
1113            ></wui-shimmer>
1114
1115            <wui-flex alignItems="center" gap="01">
1116              <wui-shimmer width="14px" height="14px" rounded variant="light"></wui-shimmer>
1117              <wui-shimmer
1118                width="49px"
1119                height="14px"
1120                borderRadius="4xs"
1121                variant="light"
1122              ></wui-shimmer>
1123            </wui-flex>
1124          </wui-flex>
1125        </wui-flex>
1126
1127        <wui-flex alignItems="center" justifyContent="space-between">
1128          <wui-text variant="md-regular" color="secondary">Service Fee</wui-text>
1129          <wui-shimmer width="75px" height="16px" borderRadius="4xs" variant="light"></wui-shimmer>
1130        </wui-flex>
1131      </wui-flex>
1132    `}};tp.styles=[tu],tp=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n}([(0,U.Mo)("w3m-pay-fees-skeleton")],tp);var th=(0,U.iv)`
1133  :host {
1134    display: block;
1135  }
1136
1137  wui-image {
1138    border-radius: ${({borderRadius:e})=>e.round};
1139  }
1140`,tm=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let tw=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.quote=e1.state.quote,this.unsubscribe.push(e1.subscribeKey("quote",e=>this.quote=e))}
1140disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=b.C.formatNumber(this.quote?.origin.amount||"0",{decimals:this.quote?.origin.currency.metadata.decimals??0,round:6}).toString();return(0,i.dy)`
1141      <wui-flex flexDirection="column" gap="4">
1142        <wui-flex alignItems="center" justifyContent="space-between">
1143          <wui-text variant="md-regular" color="secondary">Pay</wui-text>
1144          <wui-text variant="md-regular" color="primary">
1145            ${e} ${this.quote?.origin.currency.metadata.symbol||"Unknown"}
1146          </wui-text>
1147        </wui-flex>
1148
1149        ${this.quote&&this.quote.fees.length>0?this.quote.fees.map(e=>this.renderFee(e)):null}
1150      </wui-flex>
1151    `}renderFee(e){let t="network"===e.id,o=b.C.formatNumber(e.amount||"0",{decimals:e.currency.metadata.decimals??0,round:6}).toString();if(t){let t=c.R.getAllRequestedCaipNetworks().find(t=>ex.g.isLowerCaseMatch(t.caipNetworkId,e.currency.network));return(0,i.dy)`
1152        <wui-flex alignItems="center" justifyContent="space-between">
1153          <wui-text variant="md-regular" color="secondary">${e.label}</wui-text>
1154
1155          <wui-flex flexDirection="column" alignItems="flex-end" gap="2">
1156            <wui-text variant="md-regular" color="primary">
1157              ${o} ${e.currency.metadata.symbol||"Unknown"}
1158            </wui-text>
1159
1160            <wui-flex alignItems="center" gap="01">
1161              <wui-image
1162                src=${(0,a.o)(Q.f.getNetworkImage(t))}
1163                size="xs"
1164              ></wui-image>
1165              <wui-text variant="sm-regular" color="secondary">
1166                ${t?.name||"Unknown"}
1167              </wui-text>
1168            </wui-flex>
1169          </wui-flex>
1170        </wui-flex>
1171      `}return(0,i.dy)`
1172      <wui-flex alignItems="center" justifyContent="space-between">
1173        <wui-text variant="md-regular" color="secondary">${e.label}</wui-text>
1174        <wui-text variant="md-regular" color="primary">
1175          ${o} ${e.currency.metadata.symbol||"Unknown"}
1176        </wui-text>
1177      </wui-flex>
1178    `}};tw.styles=[th],tm([(0,r.SB)()],tw.prototype,"quote",void 0),tw=tm([(0,U.Mo)("w3m-pay-fees")],tw);var tg=(0,U.iv)`
1179  :host {
1180    display: block;
1181    width: 100%;
1182  }
1183
1184  .disabled-container {
1185    padding: ${({spacing:e})=>e[2]};
1186    min-height: 168px;
1187  }
1188
1189  wui-icon {
1190    width: ${({spacing:e})=>e[8]};
1191    height: ${({spacing:e})=>e[8]};
1192  }
1193
1194  wui-flex > wui-text {
1195    max-width: 273px;
1196  }
1197`,ty=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let tf=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.selectedExchange=e1.state.selectedExchange,this.unsubscribe.push(e1.subscribeKey("selectedExchange",e=>this.selectedExchange=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=!!this.selectedExchange;return(0,i.dy)`
1198      <wui-flex
1199        flexDirection="column"
1200        alignItems="center"
1201        justifyContent="center"
1202        gap="3"
1203        class="disabled-container"
1204      >
1205        <wui-icon name="coins" color="default" size="inherit"></wui-icon>
1206
1207        <wui-text variant="md-regular" color="primary" align="center">
1208          You don't have enough funds to complete this transaction
1209        </wui-text>
1210
1211        ${e?null:(0,i.dy)`<wui-button
1212              size="md"
1213              variant="neutral-secondary"
1214              @click=${this.dispatchConnectOtherWalletEvent.bind(this)}
1215              >Connect other wallet</wui-button
1216            >`}
1217      </wui-flex>
1218    `}dispatchConnectOtherWalletEvent(){this.dispatchEvent(new CustomEvent("connectOtherWallet",{detail:!0,bubbles:!0,composed:!0}))}};tf.styles=[tg],ty([(0,r.Cb)({type:Array})],tf.prototype,"selectedExchange",void 0),tf=ty([(0,U.Mo)("w3m-pay-options-empty")],tf);var tb=(0,U.iv)`
1219  :host {
1220    display: block;
1221    width: 100%;
1222  }
1223
1224  .pay-options-container {
1225    max-height: 196px;
1226    overflow-y: auto;
1227    overflow-x: hidden;
1228    scrollbar-width: none;
1229  }
1230
1231  .pay-options-container::-webkit-scrollbar {
1232    display: none;
1233  }
1234
1235  .pay-option-container {
1236    border-radius: ${({borderRadius:e})=>e[4]};
1237    padding: ${({spacing:e})=>e[3]};
1238    min-height: 60px;
1239  }
1240
1241  .token-images-container {
1242    position: relative;
1243    justify-content: center;
1244    align-items: center;
1245  }
1246
1247  .chain-image {
1248    position: absolute;
1249    bottom: -3px;
1250    right: -5px;
1251    border: 2px solid ${({tokens:e})=>e.theme.foregroundSecondary};
1252  }
1253`;let tv=class extends i.oi{render(){return(0,i.dy)`
1254      <wui-flex flexDirection="column" gap="2" class="pay-options-container">
1255        ${this.renderOptionEntry()} ${this.renderOptionEntry()} ${this.renderOptionEntry()}
1256      </wui-flex>
1257    `}renderOptionEntry(){return(0,i.dy)`
1258      <wui-flex
1259        alignItems="center"
1260        justifyContent="space-between"
1261        gap="2"
1262        class="pay-option-container"
1263      >
1264        <wui-flex alignItems="center" gap="2">
1265          <wui-flex class="token-images-container">
1266            <wui-shimmer
1267              width="32px"
1268              height="32px"
1269              rounded
1270              variant="light"
1271              class="token-image"
1272            ></wui-shimmer>
1273            <wui-shimmer
1274              width="16px"
1275              height="16px"
1276              rounded
1277              variant="light"
1278              class="chain-image"
1279            ></wui-shimmer>
1280          </wui-flex>
1281
1282          <wui-flex flexDirection="column" gap="1">
1283            <wui-shimmer
1284              width="74px"
1285              height="16px"
1286              borderRadius="4xs"
1287              variant="light"
1288            ></wui-shimmer>
1289            <wui-shimmer
1290              width="46px"
1291              height="14px"
1292              borderRadius="4xs"
1293              variant="light"
1294            ></wui-shimmer>
1295          </wui-flex>
1296        </wui-flex>
1297      </wui-flex>
1298    `}};tv.styles=[tb],tv=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n}([(0,U.Mo)("w3m-pay-options-skeleton")],tv);var tx=(0,U.iv)`
1299  :host {
1300    display: block;
1301    width: 100%;
1302  }
1303
1304  .pay-options-container {
1305    max-height: 196px;
1306    overflow-y: auto;
1307    overflow-x: hidden;
1308    scrollbar-width: none;
1309    mask-image: var(--options-mask-image);
1310    -webkit-mask-image: var(--options-mask-image);
1311  }
1312
1313  .pay-options-container::-webkit-scrollbar {
1314    display: none;
1315  }
1316
1317  .pay-option-container {
1318    cursor: pointer;
1319    border-radius: ${({borderRadius:e})=>e[4]};
1320    padding: ${({spacing:e})=>e[3]};
1321    transition: background-color ${({durations:e})=>e.lg}
1322      ${({easings:e})=>e["ease-out-power-1"]};
1323    will-change: background-color;
1324  }
1325
1326  .token-images-container {
1327    position: relative;
1328    justify-content: center;
1329    align-items: center;
1330  }
1331
1332  .token-image {
1333    border-radius: ${({borderRadius:e})=>e.round};
1334    width: 32px;
1335    height: 32px;
1336  }
1337
1338  .chain-image {
1339    position: absolute;
1340    width: 16px;
1341    height: 16px;
1342    bottom: -3px;
1343    right: -5px;
1344    border-radius: ${({borderRadius:e})=>e.round};
1345    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
1346  }
1347
1348  @media (hover: hover) and (pointer: fine) {
1349    .pay-option-container:hover {
1350      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1351    }
1352  }
1353`,tk=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let tC=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.options=[],this.selectedPaymentAsset=null}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.resizeObserver?.disconnect();let e=this.shadowRoot?.querySelector(".pay-options-container");e?.removeEventListener("scroll",this.handleOptionsListScroll.bind(this))}firstUpdated(){let e=this.shadowRoot?.querySelector(".pay-options-container");e&&(requestAnimationFrame(this.handleOptionsListScroll.bind(this)),e?.addEventListener("scroll",this.handleOptionsListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleOptionsListScroll()}),this.resizeObserver?.observe(e),this.handleOptionsListScroll())}render(){return(0,i.dy)`
1354      <wui-flex flexDirection="column" gap="2" class="pay-options-container">
1355        ${this.options.map(e=>this.payOptionTemplate(e))}
1356      </wui-flex>
1357    `}payOptionTemplate(e){let{network:t,metadata:o,asset:r,amount:n="0"}=e,s=c.R.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===t),l=`${t}:${r}`,d=`${this.selectedPaymentAsset?.network}:${this.selectedPaymentAsset?.asset}`,u=b.C.bigNumber(n,{safe:!0}),p=u.gt(0);return(0,i.dy)`
1358      <wui-flex
1359        alignItems="center"
1360        justifyContent="space-between"
1361        gap="2"
1362        @click=${()=>this.onSelect?.(e)}
1363        class="pay-option-container"
1364      >
1365        <wui-flex alignItems="center" gap="2">
1366          <wui-flex class="token-images-container">
1367            <wui-image
1368              src=${(0,a.o)(o.logoURI)}
1369              class="token-image"
1370              size="3xl"
1371            ></wui-image>
1372            <wui-image
1373              src=${(0,a.o)(Q.f.getNetworkImage(s))}
1374              class="chain-image"
1375              size="md"
1376            ></wui-image>
1377          </wui-flex>
1378
1379          <wui-flex flexDirection="column" gap="1">
1380            <wui-text variant="lg-regular" color="primary">${o.symbol}</wui-text>
1381            ${p?(0,i.dy)`<wui-text variant="sm-regular" color="secondary">
1382                  ${u.round(6).toString()} ${o.symbol}
1383                </wui-text>`:null}
1384          </wui-flex>
1385        </wui-flex>
1386
1387        ${l===d?(0,i.dy)`<wui-icon name="checkmark" size="md" color="success"></wui-icon>`:null}
1388      </wui-flex>
1389    `}handleOptionsListScroll(){let e=this.shadowRoot?.querySelector(".pay-options-container");e&&(e.scrollHeight>300?(e.style.setProperty("--options-mask-image",`linear-gradient(
1390          to bottom,
1391          rgba(0, 0, 0, calc(1 - var(--options-scroll--top-opacity))) 0px,
1392          rgba(200, 200, 200, calc(1 - var(--options-scroll--top-opacity))) 1px,
1393          black 50px,
1394          black calc(100% - 50px),
1395          rgba(155, 155, 155, calc(1 - var(--options-scroll--bottom-opacity))) calc(100% - 1px),
1396          rgba(0, 0, 0, calc(1 - var(--options-scroll--bottom-opacity))) 100%
1397        )`),e.style.setProperty("--options-scroll--top-opacity",U.kj.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--options-scroll--bottom-opacity",U.kj.interpolate([0,50],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString())):(e.style.setProperty("--options-mask-image","none"),e.style.setProperty("--options-scroll--top-opacity","0"),e.style.setProperty("--options-scroll--bottom-opacity","0")))}};tC.styles=[tx],tk([(0,r.Cb)({type:Array})],tC.prototype,"options",void 0),tk([(0,r.Cb)()],tC.prototype,"selectedPaymentAsset",void 0),tk([(0,r.Cb)()],tC.prototype,"onSelect",void 0),tC=tk([(0,U.Mo)("w3m-pay-options")],tC);var tS=(0,U.iv)`
1398  .payment-methods-container {
1399    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1400    border-top-right-radius: ${({borderRadius:e})=>e[5]};
1401    border-top-left-radius: ${({borderRadius:e})=>e[5]};
1402  }
1403
1404  .pay-options-container {
1405    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1406    border-radius: ${({borderRadius:e})=>e[5]};
1407    padding: ${({spacing:e})=>e[1]};
1408  }
1409
1410  w3m-tooltip-trigger {
1411    display: flex;
1412    align-items: center;
1413    justify-content: center;
1414    max-width: fit-content;
1415  }
1416
1417  wui-image {
1418    border-radius: ${({borderRadius:e})=>e.round};
1419  }
1420
1421  w3m-pay-options.disabled {
1422    opacity: 0.5;
1423    pointer-events: none;
1424  }
1425`,tT=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let tA={eip155:{icon:"ethereum",label:"EVM"},solana:{icon:"solana",label:"Solana"},bip122:{icon:"bitcoin",label:"Bitcoin"},ton:{icon:"ton",label:"Ton"}},tI=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.profileName=null,this.paymentAsset=e1.state.paymentAsset,this.namespace=void 0,this.caipAddress=void 0,this.amount=e1.state.amount,this.recipient=e1.state.recipient,this.activeConnectorIds=l.ConnectorController.state.activeConnectorIds,this.selectedPaymentAsset=e1.state.selectedPaymentAsset,this.selectedExchange=e1.state.selectedExchange,this.isFetchingQuote=e1.state.isFetchingQuote,this.quoteError=e1.state.quoteError,this.quote=e1.state.quote,this.isFetchingTokenBalances=e1.state.isFetchingTokenBalances,this.tokenBalances=e1.state.tokenBalances,this.isPaymentInProgress=e1.state.isPaymentInProgress,this.exchangeUrlForQuote=e1.state.exchangeUrlForQuote,this.completedTransactionsCount=0,this.unsubscribe.push(e1.subscribeKey("paymentAsset",e=>this.paymentAsset=e)),this.unsubscribe.push(e1.subscribeKey("tokenBalances",e=>this.onTokenBalancesChanged(e))),this.unsubscribe.push(e1.subscribeKey("isFetchingTokenBalances",e=>this.isFetchingTokenBalances=e)),this.unsubscribe.push(l.ConnectorController.subscribeKey("activeConnectorIds",e=>this.activeConnectorIds=e)),this.unsubscribe.push(e1.subscribeKey("selectedPaymentAsset",e=>this.selectedPaymentAsset=e)),this.unsubscribe.push(e1.subscribeKey("isFetchingQuote",e=>this.isFetchingQuote=e)),this.unsubscribe.push(e1.subscribeKey("quoteError",e=>this.quoteError=e)),this.unsubscribe.push(e1.subscribeKey("quote",e=>this.quote=e)),this.unsubscribe.push(e1.subscribeKey("amount",e=>this.amount=e)),this.unsubscribe.push(e1.subscribeKey("recipient",e=>this.recipient=e)),this.unsubscribe.push(e1.subscribeKey("isPaymentInProgress",e=>this.isPaymentInProgress=e)),this.unsubscribe.push(e1.subscribeKey("selectedExchange",e=>this.selectedExchange=e)),this.unsubscribe.push(e1.subscribeKey("exchangeUrlForQuote",e=>this.exchangeUrlForQuote=e)),this.resetQuoteState(),this.initializeNamespace(),this.fetchTokens()}disconnectedCallback(){super.disconnectedCallback(),this.resetAssetsState(),this.unsubscribe.forEach(e
1425=>e())}updated(e){super.updated(e),e.has("selectedPaymentAsset")&&this.fetchQuote()}render(){return(0,i.dy)`
1426      <wui-flex flexDirection="column">
1427        ${this.profileTemplate()}
1428
1429        <wui-flex
1430          flexDirection="column"
1431          gap="4"
1432          class="payment-methods-container"
1433          .padding=${["4","4","5","4"]}
1434        >
1435          ${this.paymentOptionsViewTemplate()} ${this.amountWithFeeTemplate()}
1436
1437          <wui-flex
1438            alignItems="center"
1439            justifyContent="space-between"
1440            .padding=${["1","0","1","0"]}
1441          >
1442            <wui-separator></wui-separator>
1443          </wui-flex>
1444
1445          ${this.paymentActionsTemplate()}
1446        </wui-flex>
1447      </wui-flex>
1448    `}profileTemplate(){if(this.selectedExchange){let e=b.C.formatNumber(this.quote?.origin.amount,{decimals:this.quote?.origin.currency.metadata.decimals??0}).toString();return(0,i.dy)`
1449        <wui-flex
1450          .padding=${["4","3","4","3"]}
1451          alignItems="center"
1452          justifyContent="space-between"
1453          gap="2"
1454        >
1455          <wui-text variant="lg-regular" color="secondary">Paying with</wui-text>
1456
1457          ${this.quote?(0,i.dy)`<wui-text variant="lg-regular" color="primary">
1458                ${b.C.bigNumber(e,{safe:!0}).round(6).toString()}
1459                ${this.quote.origin.currency.metadata.symbol}
1460              </wui-text>`:(0,i.dy)`<wui-shimmer width="80px" height="18px" variant="light"></wui-shimmer>`}
1461        </wui-flex>
1462      `}let e=T.j.getPlainAddress(this.caipAddress)??"",{name:t,image:o}=this.getWalletProperties({namespace:this.namespace}),{icon:r,label:n}=tA[this.namespace]??{};return(0,i.dy)`
1463      <wui-flex
1464        .padding=${["4","3","4","3"]}
1465        alignItems="center"
1466        justifyContent="space-between"
1467        gap="2"
1468      >
1469        <wui-wallet-switch
1470          profileName=${(0,a.o)(this.profileName)}
1471          address=${(0,a.o)(e)}
1472          imageSrc=${(0,a.o)(o)}
1473          alt=${(0,a.o)(t)}
1474          @click=${this.onConnectOtherWallet.bind(this)}
1475          data-testid="wui-wallet-switch"
1476        ></wui-wallet-switch>
1477
1478        <wui-wallet-switch
1479          profileName=${(0,a.o)(n)}
1480          address=${(0,a.o)(e)}
1481          icon=${(0,a.o)(r)}
1482          iconSize="xs"
1483          .enableGreenCircle=${!1}
1484          alt=${(0,a.o)(n)}
1485          @click=${this.onConnectOtherWallet.bind(this)}
1486          data-testid="wui-wallet-switch"
1487        ></wui-wallet-switch>
1488      </wui-flex>
1489    `}initializeNamespace(){let e=c.R.state.activeChain;this.namespace=e,this.caipAddress=c.R.getAccountData(e)?.caipAddress,this.profileName=c.R.getAccountData(e)?.profileName??null,this.unsubscribe.push(c.R.subscribeChainProp("accountState",e=>this.onAccountStateChanged(e),e))}async fetchTokens(){if(this.namespace){let e;if(this.caipAddress){let{chainId:t,chainNamespace:o}=ev.u.parseCaipAddress(this.caipAddress),i=`${o}:${t}`;e=c.R.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===i)}await e1.fetchTokens({caipAddress:this.caipAddress,caipNetwork:e,namespace:this.namespace})}}fetchQuote(){if(this.amount&&this.recipient&&this.selectedPaymentAsset&&this.paymentAsset){let{address:e}=this.caipAddress?ev.u.parseCaipAddress(this.caipAddress):{};e1.fetchQuote({amount:this.amount.toString(),address:e,sourceToken:this.selectedPaymentAsset,toToken:this.paymentAsset,recipient:this.recipient})}}getWalletProperties({namespace:e}){if(!e)return{name:void 0,image:void 0};let t=this.activeConnectorIds[e];if(!t)return{name:void 0,image:void 0};let o=l.ConnectorController.getConnector({id:t,namespace:e});if(!o)return{name:void 0,image:void 0};let i=Q.f.getConnectorImage(o);return{name:o.name,image:i}}paymentOptionsViewTemplate(){return(0,i.dy)`
1490      <wui-flex flexDirection="column" gap="2">
1491        <wui-text variant="sm-regular" color="secondary">CHOOSE PAYMENT OPTION</wui-text>
1492        <wui-flex class="pay-options-container">${this.paymentOptionsTemplate()}</wui-flex>
1493      </wui-flex>
1494    `}paymentOptionsTemplate(){let e=this.getPaymentAssetFromTokenBalances();if(this.isFetchingTokenBalances)return(0,i.dy)`<w3m-pay-options-skeleton></w3m-pay-options-skeleton>`;if(0===e.length)return(0,i.dy)`<w3m-pay-options-empty
1495        @connectOtherWallet=${this.onConnectOtherWallet.bind(this)}
1496      ></w3m-pay-options-empty>`;let t={disabled:this.isFetchingQuote};return(0,i.dy)`<w3m-pay-options
1497      class=${(0,e6.$)(t)}
1498      .options=${e}
1499      .selectedPaymentAsset=${(0,a.o)(this.selectedPaymentAsset)}
1500      .onSelect=${this.onSelectedPaymentAssetChanged.bind(this)}
1501    ></w3m-pay-options>`}amountWithFeeTemplate(){return this.isFetchingQuote||!this.selectedPaymentAsset||this.quoteError?(0,i.dy)`<w3m-pay-fees-skeleton></w3m-pay-fees-skeleton>`:(0,i.dy)`<w3m-pay-fees></w3m-pay-fees>`}paymentActionsTemplate(){let e=this.isFetchingQuote||this.isFetchingTokenBalances,t=this.isFetchingQuote||this.isFetchingTokenBalances||!this.selectedPaymentAsset||!!this.quoteError,o=b.C.formatNumber(this.quote?.origin.amount??0,{decimals:this.quote?.origin.currency.metadata.decimals??0}).toString();return this.selectedExchange?e||t?(0,i.dy)`
1502          <wui-shimmer width="100%" height="48px" variant="light" ?rounded=${!0}></wui-shimmer>
1503        `:(0,i.dy)`<wui-button
1504        size="lg"
1505        fullWidth
1506        variant="accent-secondary"
1507        @click=${this.onPayWithExchange.bind(this)}
1508      >
1509        ${`Continue in ${this.selectedExchange.name}`}
1510
1511        <wui-icon name="arrowRight" color="inherit" size="sm" slot="iconRight"></wui-icon>
1512      </wui-button>
1512`:(0,i.dy)`
1513      <wui-flex alignItems="center" justifyContent="space-between">
1514        <wui-flex flexDirection="column" gap="1">
1515          <wui-text variant="md-regular" color="secondary">Order Total</wui-text>
1516
1517          ${e||t?(0,i.dy)`<wui-shimmer width="58px" height="32px" variant="light"></wui-shimmer>`:(0,i.dy)`<wui-flex alignItems="center" gap="01">
1518                <wui-text variant="h4-regular" color="primary">${eQ(o)}</wui-text>
1519
1520                <wui-text variant="lg-regular" color="secondary">
1521                  ${this.quote?.origin.currency.metadata.symbol||"Unknown"}
1522                </wui-text>
1523              </wui-flex>`}
1524        </wui-flex>
1525
1526        ${this.actionButtonTemplate({isLoading:e,isDisabled:t})}
1527      </wui-flex>
1528    `}actionButtonTemplate(e){let t=e_(this.quote),{isLoading:o,isDisabled:r}=e,a="Pay";return t.length>1&&0===this.completedTransactionsCount&&(a="Approve"),(0,i.dy)`
1529      <wui-button
1530        size="lg"
1531        variant="accent-primary"
1532        ?loading=${o||this.isPaymentInProgress}
1533        ?disabled=${r||this.isPaymentInProgress}
1534        @click=${()=>{t.length>0?this.onSendTransactions():this.onTransfer()}}
1535      >
1536        ${a}
1537        ${o?null:(0,i.dy)`<wui-icon
1538              name="arrowRight"
1539              color="inherit"
1540              size="sm"
1541              slot="iconRight"
1542            ></wui-icon>`}
1543      </wui-button>
1544    `}getPaymentAssetFromTokenBalances(){return this.namespace?(this.tokenBalances[this.namespace]??[]).map(e=>{try{return function(e){let t=c.R.getAllRequestedCaipNetworks().find(t=>t.caipNetworkId===e.chainId),o=e.address;if(!t)throw Error(`Target network not found for balance chainId "${e.chainId}"`);if(ex.g.isLowerCaseMatch(e.symbol,t.nativeCurrency.symbol))o="native";else if(T.j.isCaipAddress(o)){let{address:e}=ev.u.parseCaipAddress(o);o=e}else if(!o)throw Error(`Balance address not found for balance symbol "${e.symbol}"`);return{network:t.caipNetworkId,asset:o,metadata:{name:e.name,symbol:e.symbol,decimals:Number(e.quantity.decimals),logoURI:e.iconUrl},amount:e.quantity.numeric}}(e)}catch(e){return null}}).filter(e=>!!e).filter(e=>{let{chainId:t}=ev.u.parseCaipNetworkId(e.network),{chainId:o}=ev.u.parseCaipNetworkId(this.paymentAsset.network);return!!ex.g.isLowerCaseMatch(e.asset,this.paymentAsset.asset)||!this.selectedExchange||!ex.g.isLowerCaseMatch(t.toString(),o.toString())}):[]}onTokenBalancesChanged(e){this.tokenBalances=e;let[t]=this.getPaymentAssetFromTokenBalances();t&&e1.setSelectedPaymentAsset(t)}async onConnectOtherWallet(){await l.ConnectorController.connect(),await s.I.open({view:"PayQuote"})}onAccountStateChanged(e){let{address:t}=this.caipAddress?ev.u.parseCaipAddress(this.caipAddress):{};if(this.caipAddress=e?.caipAddress,this.profileName=e?.profileName??null,t){let{address:e}=this.caipAddress?ev.u.parseCaipAddress(this.caipAddress):{};e?ex.g.isLowerCaseMatch(e,t)||(this.resetAssetsState(),this.resetQuoteState(),this.fetchTokens()):s.I.close()}}onSelectedPaymentAssetChanged(e){this.isFetchingQuote||e1.setSelectedPaymentAsset(e)}async onTransfer(){let e=eO(this.quote);if(e){if(!ex.g.isLowerCaseMatch(this.selectedPaymentAsset?.asset,e.deposit.currency))throw Error("Quote asset is not the same as the selected payment asset");let t=this.selectedPaymentAsset?.amount??"0",o=b.C.formatNumber(e.deposit.amount,{decimals:this.selectedPaymentAsset?.metadata.decimals??0}).toString();if(!b.C.bigNumber(t).gte(o)){g.SnackController.showError("Insufficient funds");return}if(this.quote&&this.selectedPaymentAsset&&this.caipAddress&&this.namespace){let{address:t}=ev.u.parseCaipAddress(this.caipAddress);await e1.onTransfer({chainNamespace:this.namespace,fromAddress:t,toAddress:e.deposit.receiver,amount:o,paymentAsset:this.selectedPaymentAsset}),e1.setRequestId(e.requestId),u.RouterController.push("PayLoading")}}}async onSendTransactions(){let e=this.selectedPaymentAsset?.amount??"0",t=b.C.formatNumber(this.quote?.origin.amount??0,{decimals:this.selectedPaymentAsset?.metadata.decimals??0}).toString();if(!b.C.bigNumber(e).gte(t)){g.SnackController.showError("Insufficient funds");return}let o=e_(this.quote),[i]=e_(this.quote,this.completedTransactionsCount);i&&this.namespace&&(await e1.onSendTransaction({namespace:this.namespace,transactionStep:i}),this.completedTransactionsCount+=1,this.completedTransactionsCount===o.length&&(e1.setRequestId(i.requestId),u.RouterController.push("PayLoading")))}onPayWithExchange(){if(this.exchangeUrlForQuote){let e=T.j.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!e)throw Error("Could not create popup window");e.location.href=this.exchangeUrlForQuote;let t=eO(this.quote);t&&e1.setRequestId(t.requestId),e1.initiatePayment(),u.RouterController.push("PayLoading")}}resetAssetsState(){e1.setSelectedPaymentAsset(null)}resetQuoteState(){e1.resetQuoteState()}};tI.styles=tS,tT([(0,r.SB)()],tI.prototype,"profileName",void 0),tT([(0,r.SB)()],tI.prototype,"paymentAsset",void 0),tT([(0,r.SB)()],tI.prototype,"namespace",void 0),tT([(0,r.SB)()],tI.prototype,"caipAddress",void 0),tT([(0,r.SB)()],tI.prototype,"amount",void 0),tT([(0,r.SB)()],tI.prototype,"recipient",void 0),tT([(0,r.SB)()],tI.prototype,"activeConnectorIds",void 0),tT([(0,r.SB)()],tI.prototype,"selectedPaymentAsset",void 0),tT([(0,r.SB)()],tI.prototype,"selectedExchange",void 0),tT([(0,r.SB)()],tI.prototype,"isFetchingQuote",void 0),tT([(0,r.SB)()],tI.prototype,"quoteError",void 0),tT([(0,r.SB)()],tI.prototype,"quote",void 0),tT([(0,r.SB)()],tI.prototype,"isFetchingTokenBalances",void 0),tT([(0,r.SB)()],tI.prototype,"tokenBalances",void 0),tT([(0,r.SB)()],tI.prototype,"isPaymentInProgress",void 0),tT([(0,r.SB)()],tI.prototype,"exchangeUrlForQuote",void 0),tT([(0,r.SB)()],tI.prototype,"completedTransactionsCount",void 0),tI=tT([(0,U.Mo)("w3m-pay-quote-view")],tI);var tE=(0,U.iv)`
1545  wui-image {
1546    border-radius: ${({borderRadius:e})=>e.round};
1547  }
1548
1549  .transfers-badge {
1550    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1551    border: 1px solid ${({tokens:e})=>e.theme.foregroundSecondary};
1552    border-radius: ${({borderRadius:e})=>e[4]};
1553  }
1554`,tP=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let t$=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.paymentAsset=e1.state.paymentAsset,this.amount=e1.state.amount,this.unsubscribe.push(e1.subscribeKey("paymentAsset",e=>{this.paymentAsset=e}),e1.subscribeKey("amount",e=>{this.amount=e}))}
1554disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=c.R.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===this.paymentAsset.network);return(0,i.dy)`<wui-flex
1555      alignItems="center"
1556      gap="1"
1557      .padding=${["1","2","1","1"]}
1558      class="transfers-badge"
1559    >
1560      <wui-image src=${(0,a.o)(this.paymentAsset.metadata.logoURI)} size="xl"></wui-image>
1561      <wui-text variant="lg-regular" color="primary">
1562        ${this.amount} ${this.paymentAsset.metadata.symbol}
1563      </wui-text>
1564      <wui-text variant="sm-regular" color="secondary">
1565        on ${e?.name??"Unknown"}
1566      </wui-text>
1567    </wui-flex>`}};t$.styles=[tE],tP([(0,r.Cb)()],t$.prototype,"paymentAsset",void 0),tP([(0,r.Cb)()],t$.prototype,"amount",void 0),t$=tP([(0,U.Mo)("w3m-pay-header")],t$);var tN=(0,U.iv)`
1568  :host {
1569    height: 60px;
1570  }
1571
1572  :host > wui-flex {
1573    box-sizing: border-box;
1574    background-color: var(--local-header-background-color);
1575  }
1576
1577  wui-text {
1578    background-color: var(--local-header-background-color);
1579  }
1580
1581  wui-flex.w3m-header-title {
1582    transform: translateY(0);
1583    opacity: 1;
1584  }
1585
1586  wui-flex.w3m-header-title[view-direction='prev'] {
1587    animation:
1588      slide-down-out 120ms forwards ${({easings:e})=>e["ease-out-power-2"]},
1589      slide-down-in 120ms forwards ${({easings:e})=>e["ease-out-power-2"]};
1590    animation-delay: 0ms, 200ms;
1591  }
1592
1593  wui-flex.w3m-header-title[view-direction='next'] {
1594    animation:
1595      slide-up-out 120ms forwards ${({easings:e})=>e["ease-out-power-2"]},
1596      slide-up-in 120ms forwards ${({easings:e})=>e["ease-out-power-2"]};
1597    animation-delay: 0ms, 200ms;
1598  }
1599
1600  wui-icon-button[data-hidden='true'] {
1601    opacity: 0 !important;
1602    pointer-events: none;
1603  }
1604
1605  @keyframes slide-up-out {
1606    from {
1607      transform: translateY(0px);
1608      opacity: 1;
1609    }
1610    to {
1611      transform: translateY(3px);
1612      opacity: 0;
1613    }
1614  }
1615
1616  @keyframes slide-up-in {
1617    from {
1618      transform: translateY(-3px);
1619      opacity: 0;
1620    }
1621    to {
1622      transform: translateY(0);
1623      opacity: 1;
1624    }
1625  }
1626
1627  @keyframes slide-down-out {
1628    from {
1629      transform: translateY(0px);
1630      opacity: 1;
1631    }
1632    to {
1633      transform: translateY(-3px);
1634      opacity: 0;
1635    }
1636  }
1637
1638  @keyframes slide-down-in {
1639    from {
1640      transform: translateY(3px);
1641      opacity: 0;
1642    }
1643    to {
1644      transform: translateY(0);
1645      opacity: 1;
1646    }
1647  }
1648`,tR=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let tO=["SmartSessionList"],t_={PayWithExchange:U.gR.tokens.theme.foregroundPrimary};function tB(){let e=u.RouterController.state.data?.connector?.name,t=u.RouterController.state.data?.wallet?.name,o=u.RouterController.state.data?.network?.name,i=t??e,r=l.ConnectorController.getConnectors(),a=1===r.length&&r[0]?.id==="w3m-email",n=c.R.getAccountData()?.socialProvider;return{Connect:`Connect ${a?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",UsageExceeded:"Usage Exceeded",ConnectingExternal:i??"Connect Wallet",ConnectingWalletConnect:i??"WalletConnect",ConnectingWalletConnectBasic:"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview Convert",Downloads:i?`Get ${i}`:"Downloads",EmailLogin:"Email Login",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a Wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Pay:"How you pay",ProfileWallets:"Wallets",SwitchNetwork:o??"Switch Network",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade Your Wallet",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",WalletSendConfirmed:"Confirmed",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a Wallet?",ConnectWallets:"Connect Wallet",ConnectSocials:"All Socials",ConnectingSocial:n?n.charAt(0).toUpperCase()+n.slice(1):"Connect Social",ConnectingMultiChain:"Select Chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch Chain",SmartSessionCreated:void 0,SmartSessionList:"Smart Sessions",SIWXSignMessage:"Sign In",PayLoading:"Processing payment...",PayQuote:"Payment Quote",DataCapture:"Profile",DataCaptureOtpConfirm:"Confirm Email",FundWallet:"Fund Wallet",PayWithExchange:"Deposit from Exchange",PayWithExchangeSelectAsset:"Select Asset",SmartAccountSettings:"Smart Account Settings"}}let tU=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.heading=tB()[u.RouterController.state.view],this.network=c.R.state.activeCaipNetwork,this.networkImage=Q.f.getNetworkImage(this.network),this.showBack=!1,this.prevHistoryLength=1,this.view=u.RouterController.state.view,this.viewDirection="",this.unsubscribe.push(X.W.subscribeNetworkImages(()=>{this.networkImage=Q.f.getNetworkImage(this.network)}),u.RouterController.subscribeKey("view",e=>{setTimeout(()=>{this.view=e,this.heading=tB()[e]},es.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),c.R.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=Q.f.getNetworkImage(this.network)}))}
1648disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=t_[u.RouterController.state.view]??U.gR.tokens.theme.backgroundPrimary;return this.style.setProperty("--local-header-background-color",e),(0,i.dy)`
1649      <wui-flex
1650        .padding=${["0","4","0","4"]}
1651        justifyContent="space-between"
1652        alignItems="center"
1653      >
1654        ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
1655      </wui-flex>
1656    `}onWalletHelp(){N.X.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),u.RouterController.push("WhatIsAWallet")}async onClose(){await m.safeClose()}rightHeaderTemplate(){let e=n.OptionsController?.state?.features?.smartSessions;return"Account"===u.RouterController.state.view&&e?(0,i.dy)`<wui-flex>
1657      <wui-icon-button
1658        icon="clock"
1659        size="lg"
1660        iconSize="lg"
1661        type="neutral"
1662        variant="primary"
1663        @click=${()=>u.RouterController.push("SmartSessionList")}
1664        data-testid="w3m-header-smart-sessions"
1665      ></wui-icon-button>
1666      ${this.closeButtonTemplate()}
1667    </wui-flex> `:this.closeButtonTemplate()}closeButtonTemplate(){return(0,i.dy)`
1668      <wui-icon-button
1669        icon="close"
1670        size="lg"
1671        type="neutral"
1672        variant="primary"
1673        iconSize="lg"
1674        @click=${this.onClose.bind(this)}
1675        data-testid="w3m-header-close"
1676      ></wui-icon-button>
1677    `}titleTemplate(){if("PayQuote"===this.view)return(0,i.dy)`<w3m-pay-header></w3m-pay-header>`;let e=tO.includes(this.view);return(0,i.dy)`
1678      <wui-flex
1679        view-direction="${this.viewDirection}"
1680        class="w3m-header-title"
1681        alignItems="center"
1682        gap="2"
1683      >
1684        <wui-text
1685          display="inline"
1686          variant="lg-regular"
1687          color="primary"
1688          data-testid="w3m-header-text"
1689        >
1690          ${this.heading}
1691        </wui-text>
1692        ${e?(0,i.dy)`<wui-tag variant="accent" size="md">Beta</wui-tag>`:null}
1693      </wui-flex>
1694    `}leftHeaderTemplate(){let{view:e}=u.RouterController.state,t="Connect"===e,o=n.OptionsController.state.enableEmbedded,r=n.OptionsController.state.enableNetworkSwitch;return"Account"===e&&r?(0,i.dy)`<wui-select
1695        id="dynamic"
1696        data-testid="w3m-account-select-network"
1697        active-network=${(0,a.o)(this.network?.name)}
1698        @click=${this.onNetworks.bind(this)}
1699        imageSrc=${(0,a.o)(this.networkImage)}
1700      ></wui-select>`:this.showBack&&!("ApproveTransaction"===e||"ConnectingSiwe"===e||t&&o)?(0,i.dy)`<wui-icon-button
1701        data-testid="header-back"
1702        id="dynamic"
1703        icon="chevronLeft"
1704        size="lg"
1705        iconSize="lg"
1706        type="neutral"
1707        variant="primary"
1708        @click=${this.onGoBack.bind(this)}
1709      ></wui-icon-button>`:(0,i.dy)`<wui-icon-button
1710      data-hidden=${!t}
1711      id="dynamic"
1712      icon="helpCircle"
1713      size="lg"
1714      iconSize="lg"
1715      type="neutral"
1716      variant="primary"
1717      @click=${this.onWalletHelp.bind(this)}
1718    ></wui-icon-button>`}onNetworks(){this.isAllowedNetworkSwitch()&&(N.X.sendEvent({type:"track",event:"CLICK_NETWORKS"}),u.RouterController.push("Networks"))}isAllowedNetworkSwitch(){let e=c.R.getAllRequestedCaipNetworks(),t=!!e&&e.length>1,o=e?.find(({id:e})=>e===this.network?.id);return t||!o}onViewChange(){let{history:e}=u.RouterController.state,t=es.VIEW_DIRECTION.Next;e.length<this.prevHistoryLength&&(t=es.VIEW_DIRECTION.Prev),this.prevHistoryLength=e.length,this.viewDirection=t}async onHistoryChange(){let{history:e}=u.RouterController.state,t=this.shadowRoot?.querySelector("#dynamic");e.length>1&&!this.showBack&&t?(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){u.RouterController.goBack()}};tU.styles=tN,tR([(0,r.SB)()],tU.prototype,"heading",void 0),tR([(0,r.SB)()],tU.prototype,"network",void 0),tR([(0,r.SB)()],tU.prototype,"networkImage",void 0),tR([(0,r.SB)()],tU.prototype,"showBack",void 0),tR([(0,r.SB)()],tU.prototype,"prevHistoryLength",void 0),tR([(0,r.SB)()],tU.prototype,"view",void 0),tR([(0,r.SB)()],tU.prototype,"viewDirection",void 0),tU=tR([(0,U.Mo)("w3m-header")],tU),o(66903),o(34460);var tD=(0,W.iv)`
1719  :host {
1720    display: flex;
1721    align-items: center;
1722    gap: ${({spacing:e})=>e[1]};
1723    padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]}
1724      ${({spacing:e})=>e[2]} ${({spacing:e})=>e[2]};
1725    border-radius: ${({borderRadius:e})=>e[20]};
1726    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1727    box-shadow:
1728      0px 0px 8px 0px rgba(0, 0, 0, 0.1),
1729      inset 0 0 0 1px ${({tokens:e})=>e.theme.borderPrimary};
1730    max-width: 320px;
1731  }
1732
1733  wui-icon-box {
1734    border-radius: ${({borderRadius:e})=>e.round} !important;
1735    overflow: hidden;
1736  }
1737
1738  wui-loading-spinner {
1739    padding: ${({spacing:e})=>e[1]};
1740    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
1741    border-radius: ${({borderRadius:e})=>e.round} !important;
1742  }
1743`,tL=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let tW=class extends i.oi{constructor(){super(...arguments),this.message="",this.variant="success"}render(){return(0,i.dy)`
1744      ${this.templateIcon()}
1745      <wui-text variant="lg-regular" color="primary" data-testid="wui-snackbar-message"
1746        >${this.message}</wui-text
1747      >
1748    `}templateIcon(){return"loading"===this.variant?(0,i.dy)`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:(0,i.dy)`<wui-icon-box
1749      size="md"
1750      color=${({success:"success",error:"error",warning:"warning",info:"default"})[this.variant]}
1751      icon=${({success:"checkmark",error:"warning",warning:"warningCircle",info:"info"})[this.variant]}
1752    ></wui-icon-box>`}};tW.styles=[D.ET,tD],tL([(0,r.Cb)()],tW.prototype,"message",void 0),tL([(0,r.Cb)()],tW.prototype,"variant",void 0),tW=tL([(0,L.M)("wui-snackbar")],tW);var tz=(0,i.iv)`
1753  :host {
1754    display: block;
1755    position: absolute;
1756    opacity: 0;
1757    pointer-events: none;
1758    top: 11px;
1759    left: 50%;
1760    width: max-content;
1761  }
1762`,tj=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let tF=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=g.SnackController.state.open,this.unsubscribe.push(g.SnackController.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e=>e())}render(){let{message:e,variant:t}=g.SnackController.state;return(0,i.dy)` <wui-snackbar message=${e} variant=${t}></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&&clearTimeout(this.timeout),g.SnackController.state.autoClose&&(this.timeout=setTimeout(()=>g.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"})}};tF.styles=tz,tj([(0,r.SB)()],tF.prototype,"open",void 0),tF=tj([(0,U.Mo)("w3m-snackbar")],tF);let tM=(0,y.sj)({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),tq=(0,E.P)({state:tM,subscribe:e=>(0,y.Ld)(tM,()=>e(tM)),subscribeKey:(e,t)=>(0,f.VW)(tM,e,t),showTooltip({message:e,triggerRect:t,variant:o}){tM.open=!0,tM.message=e,tM.triggerRect=t,tM.variant=o},hide(){tM.open=!1,tM.message="",tM.triggerRect={width:0,height:0,top:0,left:0}}});var tV=(0,i.iv)`
1763  :host {
1764    width: 100%;
1765    display: block;
1766  }
1767`,tG=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let tH=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.text="",this.open=tq.state.open,this.unsubscribe.push(u.RouterController.subscribeKey("view",()=>{tq.hide()}),s.I.subscribeKey("open",e=>{e||tq.hide()}),tq.subscribeKey("open",e=>{this.open=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),tq.hide()}render(){return(0,i.dy)`
1768      <div
1769        @pointermove=${this.onMouseEnter.bind(this)}
1770        @pointerleave=${this.onMouseLeave.bind(this)}
1771      >
1772        ${this.renderChildren()}
1773      </div>
1774    `}renderChildren(){return(0,i.dy)`<slot></slot> `}onMouseEnter(){let e=this.getBoundingClientRect();if(!this.open){let t=document.querySelector("w3m-modal"),o={width:e.width,height:e.height,left:e.left,top:e.top};if(t){let i=t.getBoundingClientRect();o.left=e.left-(window.innerWidth-i.width)/2,o.top=e.top-(window.innerHeight-i.height)/2}tq.showTooltip({message:this.text,triggerRect:o,variant:"shade"})}}onMouseLeave(e){this.contains(e.relatedTarget)||tq.hide()}};tH.styles=[tV],tG([(0,r.Cb)()],tH.prototype,"text",void 0),tG([(0,r.SB)()],tH.prototype,"open",void 0),tH=tG([(0,U.Mo)("w3m-tooltip-trigger")],tH);var tY=(0,U.iv)`
1775  :host {
1776    pointer-events: none;
1777  }
1778
1779  :host > wui-flex {
1780    display: var(--w3m-tooltip-display);
1781    opacity: var(--w3m-tooltip-opacity);
1782    padding: 9px ${({spacing:e})=>e["3"]} 10px ${({spacing:e})=>e["3"]};
1783    border-radius: ${({borderRadius:e})=>e["3"]};
1784    color: ${({tokens:e})=>e.theme.backgroundPrimary};
1785    position: absolute;
1786    top: var(--w3m-tooltip-top);
1787    left: var(--w3m-tooltip-left);
1788    transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
1789    max-width: calc(var(--apkt-modal-width) - ${({spacing:e})=>e["5"]});
1790    transition: opacity ${({durations:e})=>e.lg}
1791      ${({easings:e})=>e["ease-out-power-2"]};
1792    will-change: opacity;
1793    opacity: 0;
1794    animation-duration: ${({durations:e})=>e.xl};
1795    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
1796    animation-name: fade-in;
1797    animation-fill-mode: forwards;
1798  }
1799
1800  :host([data-variant='shade']) > wui-flex {
1801    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1802  }
1803
1804  :host([data-variant='shade']) > wui-flex > wui-text {
1805    color: ${({tokens:e})=>e.theme.textSecondary};
1806  }
1807
1808  :host([data-variant='fill']) > wui-flex {
1809    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
1810    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
1811  }
1812
1813  wui-icon {
1814    position: absolute;
1815    width: 12px !important;
1816    height: 4px !important;
1817    color: ${({tokens:e})=>e.theme.foregroundPrimary};
1818  }
1819
1820  wui-icon[data-placement='top'] {
1821    bottom: 0px;
1822    left: 50%;
1823    transform: translate(-50%, 95%);
1824  }
1825
1826  wui-icon[data-placement='bottom'] {
1827    top: 0;
1828    left: 50%;
1829    transform: translate(-50%, -95%) rotate(180deg);
1830  }
1831
1832  wui-icon[data-placement='right'] {
1833    top: 50%;
1834    left: 0;
1835    transform: translate(-65%, -50%) rotate(90deg);
1836  }
1837
1838  wui-icon[data-placement='left'] {
1839    top: 50%;
1840    right: 0%;
1841    transform: translate(65%, -50%) rotate(270deg);
1842  }
1843
1844  @keyframes fade-in {
1845    from {
1846      opacity: 0;
1847    }
1848    to {
1849      opacity: 1;
1850    }
1851  }
1852`,tK=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let tQ=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.open=tq.state.open,this.message=tq.state.message,this.triggerRect=tq.state.triggerRect,this.variant=tq.state.variant,this.unsubscribe.push(tq.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}
1852disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;let e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=`
1853    --w3m-tooltip-top: ${e}px;
1854    --w3m-tooltip-left: ${t}px;
1855    --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;
1856    --w3m-tooltip-display: ${this.open?"flex":"none"};
1857    --w3m-tooltip-opacity: ${this.open?1:0};
1858    `,(0,i.dy)`<wui-flex>
1859      <wui-icon data-placement="top" size="inherit" name="cursor"></wui-icon>
1860      <wui-text color="primary" variant="sm-regular">${this.message}</wui-text>
1861    </wui-flex>`}};tQ.styles=[tY],tK([(0,r.SB)()],tQ.prototype,"open",void 0),tK([(0,r.SB)()],tQ.prototype,"message",void 0),tK([(0,r.SB)()],tQ.prototype,"triggerRect",void 0),tK([(0,r.SB)()],tQ.prototype,"variant",void 0),tQ=tK([(0,U.Mo)("w3m-tooltip")],tQ);let tX={getTabsByNamespace:e=>e&&e===v.b.CHAIN.EVM?n.OptionsController.state.remoteFeatures?.activity===!1?es.ACCOUNT_TABS.filter(e=>"Activity"!==e.label):es.ACCOUNT_TABS:[],isValidReownName:e=>/^[a-zA-Z0-9]+$/gu.test(e),isValidEmail:e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/gu.test(e),validateReownName:e=>e.replace(/\^/gu,"").toLowerCase().replace(/[^a-zA-Z0-9]/gu,""),hasFooter(){let e=u.RouterController.state.view;if(es.VIEWS_WITH_LEGAL_FOOTER.includes(e)){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.OptionsController.state,o=n.OptionsController.state.features?.legalCheckbox;return(!!e||!!t)&&!o}return es.VIEWS_WITH_DEFAULT_FOOTER.includes(e)}};o(17791);var tZ=(0,U.iv)`
1862  :host wui-ux-by-reown {
1863    padding-top: 0;
1864  }
1865
1866  :host wui-ux-by-reown.branding-only {
1867    padding-top: ${({spacing:e})=>e["3"]};
1868  }
1869
1870  a {
1871    text-decoration: none;
1872    color: ${({tokens:e})=>e.core.textAccentPrimary};
1873    font-weight: 500;
1874  }
1875`,tJ=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let t0=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=n.OptionsController.state.remoteFeatures,this.unsubscribe.push(n.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.OptionsController.state,o=n.OptionsController.state.features?.legalCheckbox;return(e||t)&&!o?(0,i.dy)`
1876      <wui-flex flexDirection="column">
1877        <wui-flex .padding=${["4","3","3","3"]} justifyContent="center">
1878          <wui-text color="secondary" variant="md-regular" align="center">
1879            By connecting your wallet, you agree to our <br />
1880            ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
1881          </wui-text>
1882        </wui-flex>
1883        ${this.reownBrandingTemplate()}
1884      </wui-flex>
1885    `:(0,i.dy)`
1886        <wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex>
1887      `}andTemplate(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.OptionsController.state;return e&&t?"and":""}termsTemplate(){let{termsConditionsUrl:e}=n.OptionsController.state;return e?(0,i.dy)`<a href=${e} target="_blank" rel="noopener noreferrer"
1888      >Terms of Service</a
1889    >`:null}privacyTemplate(){let{privacyPolicyUrl:e}=n.OptionsController.state;return e?(0,i.dy)`<a href=${e} target="_blank" rel="noopener noreferrer"
1890      >Privacy Policy</a
1891    >`:null}reownBrandingTemplate(e=!1){return this.remoteFeatures?.reownBranding?e?(0,i.dy)`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:(0,i.dy)`<wui-ux-by-reown></wui-ux-by-reown>`:null}};t0.styles=[tZ],tJ([(0,r.SB)()],t0.prototype,"remoteFeatures",void 0),t0=tJ([(0,U.Mo)("w3m-legal-footer")],t0),o(76470);var t3=(0,i.iv)``;let t1=class extends i.oi{render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.OptionsController.state;return e||t?(0,i.dy)`
1892      <wui-flex
1893        .padding=${["4","3","3","3"]}
1894        flexDirection="column"
1895        alignItems="center"
1896        justifyContent="center"
1897        gap="3"
1898      >
1899        <wui-text color="secondary" variant="md-regular" align="center">
1900          We work with the best providers to give you the lowest fees and best support. More options
1901          coming soon!
1902        </wui-text>
1903
1904        ${this.howDoesItWorkTemplate()}
1905      </wui-flex>
1906    `:null}howDoesItWorkTemplate(){return(0,i.dy)` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
1907      <wui-icon size="xs" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
1908      How does it work?
1909    </wui-link>`}onWhatIsBuy(){N.X.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:(0,C.r9)(c.R.state.activeChain)===x.y_.ACCOUNT_TYPES.SMART_ACCOUNT}}),u.RouterController.push("WhatIsABuy")}};t1.styles=[t3],t1=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n}([(0,U.Mo)("w3m-onramp-providers-footer")],t1);var t2=(0,U.iv)`
1910  :host {
1911    display: block;
1912  }
1913
1914  div.container {
1915    position: absolute;
1916    bottom: 0;
1917    left: 0;
1918    right: 0;
1919    overflow: hidden;
1920    height: auto;
1921    display: block;
1922  }
1923
1924  div.container[status='hide'] {
1925    animation: fade-out;
1926    animation-duration: var(--apkt-duration-dynamic);
1927    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
1928    animation-fill-mode: both;
1929    animation-delay: 0s;
1930  }
1931
1932  div.container[status='show'] {
1933    animation: fade-in;
1934    animation-duration: var(--apkt-duration-dynamic);
1935    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
1936    animation-fill-mode: both;
1937    animation-delay: var(--apkt-duration-dynamic);
1938  }
1939
1940  @keyframes fade-in {
1941    from {
1942      opacity: 0;
1943      filter: blur(6px);
1944    }
1945    to {
1946      opacity: 1;
1947      filter: blur(0px);
1948    }
1949  }
1950
1951  @keyframes fade-out {
1952    from {
1953      opacity: 1;
1954      filter: blur(0px);
1955    }
1956    to {
1957      opacity: 0;
1958      filter: blur(6px);
1959    }
1960  }
1961`,t5=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let t4=class extends i.oi{constructor(){super(...arguments),this.resizeObserver=void 0,this.unsubscribe=[],this.status="hide",this.view=u.RouterController.state.view}firstUpdated(){this.status=tX.hasFooter()?"show":"hide",this.unsubscribe.push(u.RouterController.subscribeKey("view",e=>{this.view=e,this.status=tX.hasFooter()?"show":"hide","hide"===this.status&&document.documentElement.style.setProperty("--apkt-footer-height","0px")})),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)if(t.target===this.getWrapper()){let e=`${t.contentRect.height}px`;document.documentElement.style.setProperty("--apkt-footer-height",e)}}),this.resizeObserver.observe(this.getWrapper())}render(){return(0,i.dy)`
1962      <div class="container" status=${this.status}>${this.templatePageContainer()}</div>
1963    `}templatePageContainer(){return tX.hasFooter()?(0,i.dy)` ${this.templateFooter()}`:null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return(0,i.dy)`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return(0,i.dy)`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return(0,i.dy)` <wui-flex
1964      class="footer-in"
1965      padding="3"
1966      flexDirection="column"
1967      gap="3"
1968      alignItems="center"
1969    >
1970      <wui-text variant="md-regular" color="secondary" align="center">
1971        Your connected wallet may not support some of the networks available for this dApp
1972      </wui-text>
1973      <wui-link @click=${this.onNetworkHelp.bind(this)}>
1974        <wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
1975        What is a network
1976      </wui-link>
1977    </wui-flex>`}onNetworkHelp(){N.X.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),u.RouterController.push("WhatIsANetwork")}getWrapper(){return this.shadowRoot?.querySelector("div.container")}};t4.styles=[t2],t5([(0,r.SB)()],t4.prototype,"status",void 0),t5([(0,r.SB)()],t4.prototype,"view",void 0),t4=t5([(0,U.Mo)("w3m-footer")],t4);var t6=(0,U.iv)`
1978  :host {
1979    display: block;
1980    width: inherit;
1981  }
1982`,t8=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let t7=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.viewState=u.RouterController.state.view,this.history=u.RouterController.state.history.join(","),this.unsubscribe.push(u.RouterController.subscribeKey("view",()=>{this.history=u.RouterController.state.history.join(","),document.documentElement.style.setProperty("--apkt-duration-dynamic","var(--apkt-durations-lg)")}))}
1982disconnectedCallback(){this.unsubscribe.forEach(e=>e()),document.documentElement.style.setProperty("--apkt-duration-dynamic","0s")}render(){return(0,i.dy)`${this.templatePageContainer()}`}templatePageContainer(){return(0,i.dy)`<w3m-router-container
1983      history=${this.history}
1984      .setView=${()=>{this.viewState=u.RouterController.state.view}}
1985    >
1986      ${this.viewTemplate(this.viewState)}
1987    </w3m-router-container>`}viewTemplate(e){switch(e){case"AccountSettings":return(0,i.dy)`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return(0,i.dy)`<w3m-account-view></w3m-account-view>`;case"AllWallets":return(0,i.dy)`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return(0,i.dy)`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return(0,i.dy)`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return(0,i.dy)`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":default:return(0,i.dy)`<w3m-connect-view></w3m-connect-view>`;case"Create":return(0,i.dy)`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return(0,i.dy)`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return(0,i.dy)`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return(0,i.dy)`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return(0,i.dy)`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return(0,i.dy)`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return(0,i.dy)`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return(0,i.dy)`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return(0,i.dy)`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return(0,i.dy)`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return(0,i.dy)`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return(0,i.dy)`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return(0,i.dy)`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return(0,i.dy)`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return(0,i.dy)`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return(0,i.dy)`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return(0,i.dy)`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return(0,i.dy)`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return(0,i.dy)`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return(0,i.dy)`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return(0,i.dy)`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return(0,i.dy)`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return(0,i.dy)`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return(0,i.dy)`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return(0,i.dy)`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return(0,i.dy)`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return(0,i.dy)`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return(0,i.dy)`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return(0,i.dy)`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return(0,i.dy)`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return(0,i.dy)`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return(0,i.dy)`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return(0,i.dy)`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return(0,i.dy)`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return(0,i.dy)`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return(0,i.dy)`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return(0,i.dy)`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return(0,i.dy)`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return(0,i.dy)`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return(0,i.dy)`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return(0,i.dy)`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return(0,i.dy)`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return(0,i.dy)`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return(0,i.dy)`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return(0,i.dy)`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return(0,i.dy)`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return(0,i.dy)`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return(0,i.dy)`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return(0,i.dy)`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"PayQuote":return(0,i.dy)`<w3m-pay-quote-view></w3m-pay-quote-view>`;case"FundWallet":return(0,i.dy)`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return(0,i.dy)`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return(0,i.dy)`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`;case"UsageExceeded":return(0,i.dy)`<w3m-usage-exceeded-view></w3m-usage-exceeded-view>`;case"SmartAccountSettings":return(0,i.dy)`<w3m-smart-account-settings-view></w3m-smart-account-settings-view>`}}};t7.styles=[t6],t8([(0,r.SB)()],t7.prototype,"viewState",void 0),t8([(0,r.SB)()],t7.prototype,"history",void 0),t7=t8([(0,U.Mo)("w3m-router")],t7);var t9=(0,U.iv)`
1988  :host {
1989    z-index: ${({tokens:e})=>e.core.zIndex};
1990    display: block;
1991    backface-visibility: hidden;
1992    will-change: opacity;
1993    position: fixed;
1994    top: 0;
1995    left: 0;
1996    right: 0;
1997    bottom: 0;
1998    pointer-events: none;
1999    opacity: 0;
2000    background-color: ${({tokens:e})=>e.theme.overlay};
2001    backdrop-filter: blur(0px);
2002    transition:
2003      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2004      backdrop-filter ${({durations:e})=>e.lg}
2005        ${({easings:e})=>e["ease-out-power-2"]};
2006    will-change: opacity;
2007  }
2008
2009  :host(.open) {
2010    opacity: 1;
2011    backdrop-filter: blur(8px);
2012  }
2013
2014  :host(.appkit-modal) {
2015    position: relative;
2016    pointer-events: unset;
2017    background: none;
2018    width: 100%;
2019    opacity: 1;
2020  }
2021
2022  wui-card {
2023    max-width: var(--apkt-modal-width);
2024    width: 100%;
2025    position: relative;
2026    outline: none;
2027    transform: translateY(4px);
2028    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.05);
2029    transition:
2030      transform ${({durations:e})=>e.lg}
2031        ${({easings:e})=>e["ease-out-power-2"]},
2032      border-radius ${({durations:e})=>e.lg}
2033        ${({easings:e})=>e["ease-out-power-1"]},
2034      background-color ${({durations:e})=>e.lg}
2035        ${({easings:e})=>e["ease-out-power-1"]},
2036      box-shadow ${({durations:e})=>e.lg}
2037        ${({easings:e})=>e["ease-out-power-1"]};
2038    will-change: border-radius, background-color, transform, box-shadow;
2039    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
2040    padding: var(--local-modal-padding);
2041    box-sizing: border-box;
2042  }
2043
2044  :host(.open) wui-card {
2045    transform: translateY(0px);
2046  }
2047
2048  wui-card::before {
2049    z-index: 1;
2050    pointer-events: none;
2051    content: '';
2052    position: absolute;
2053    inset: 0;
2054    border-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
2055    transition: box-shadow ${({durations:e})=>e.lg}
2056      ${({easings:e})=>e["ease-out-power-2"]};
2057    transition-delay: ${({durations:e})=>e.md};
2058    will-change: box-shadow;
2059  }
2060
2061  :host([data-mobile-fullscreen='true']) wui-card::before {
2062    border-radius: 0px;
2063  }
2064
2065  :host([data-border='true']) wui-card::before {
2066    box-shadow: inset 0px 0px 0px 4px ${({tokens:e})=>e.theme.foregroundSecondary};
2067  }
2068
2069  :host([data-border='false']) wui-card::before {
2070    box-shadow: inset 0px 0px 0px 1px ${({tokens:e})=>e.theme.borderPrimaryDark};
2071  }
2072
2073  :host([data-border='true']) wui-card {
2074    animation:
2075      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2076      card-background-border var(--apkt-duration-dynamic)
2077        ${({easings:e})=>e["ease-out-power-2"]};
2078    animation-fill-mode: backwards, both;
2079    animation-delay: var(--apkt-duration-dynamic);
2080  }
2081
2082  :host([data-border='false']) wui-card {
2083    animation:
2084      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2085      card-background-default var(--apkt-duration-dynamic)
2086        ${({easings:e})=>e["ease-out-power-2"]};
2087    animation-fill-mode: backwards, both;
2088    animation-delay: 0s;
2089  }
2090
2091  :host(.appkit-modal) wui-card {
2092    max-width: var(--apkt-modal-width);
2093  }
2094
2095  wui-card[shake='true'] {
2096    animation:
2097      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2098      w3m-shake ${({durations:e})=>e.xl}
2099        ${({easings:e})=>e["ease-out-power-2"]};
2100  }
2101
2102  wui-flex {
2103    overflow-x: hidden;
2104    overflow-y: auto;
2105    display: flex;
2106    align-items: center;
2107    justify-content: center;
2108    width: 100%;
2109    height: 100%;
2110  }
2111
2112  @media (max-height: 700px) and (min-width: 431px) {
2113    wui-flex {
2114      align-items: flex-start;
2115    }
2116
2117    wui-card {
2118      margin: var(--apkt-spacing-6) 0px;
2119    }
2120  }
2121
2122  @media (max-width: 430px) {
2123    :host([data-mobile-fullscreen='true']) {
2124      height: 100dvh;
2125    }
2126    :host([data-mobile-fullscreen='true']) wui-flex {
2127      align-items: stretch;
2128    }
2129    :host([data-mobile-fullscreen='true']) wui-card {
2130      max-width: 100%;
2131      height: 100%;
2132      border-radius: 0;
2133      border: none;
2134    }
2135    :host(:not([data-mobile-fullscreen='true'])) wui-flex {
2136      align-items: flex-end;
2137    }
2138
2139    :host(:not([data-mobile-fullscreen='true'])) wui-card {
2140      max-width: 100%;
2141      border-bottom: none;
2142    }
2143
2144    :host(:not([data-mobile-fullscreen='true'])) wui-card[data-embedded='true'] {
2145      border-bottom-left-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
2146      border-bottom-right-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
2147    }
2148
2149    :host(:not([data-mobile-fullscreen='true'])) wui-card:not([data-embedded='true']) {
2150      border-bottom-left-radius: 0px;
2151      border-bottom-right-radius: 0px;
2152    }
2153
2154    wui-card[shake='true'] {
2155      animation: w3m-shake 0.5s ${({easings:e})=>e["ease-out-power-2"]};
2156    }
2157  }
2158
2159  @keyframes fade-in {
2160    0% {
2161      transform: scale(0.99) translateY(4px);
2162    }
2163    100% {
2164      transform: scale(1) translateY(0);
2165    }
2166  }
2167
2168  @keyframes w3m-shake {
2169    0% {
2170      transform: scale(1) rotate(0deg);
2171    }
2172    20% {
2173      transform: scale(1) rotate(-1deg);
2174    }
2175    40% {
2176      transform: scale(1) rotate(1.5deg);
2177    }
2178    60% {
2179      transform: scale(1) rotate(-1.5deg);
2180    }
2181    80% {
2182      transform: scale(1) rotate(1deg);
2183    }
2184    100% {
2185      transform: scale(1) rotate(0deg);
2186    }
2187  }
2188
2189  @keyframes card-background-border {
2190    from {
2191      background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
2192    }
2193    to {
2194      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2195    }
2196  }
2197
2198  @keyframes card-background-default {
2199    from {
2200      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2201    }
2202    to {
2203      background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
2204    }
2205  }
2206`,oe=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ot="scroll-lock",oo={PayWithExchange:"0",PayWithExchangeSelectAsset:"0",Pay:"0",PayQuote:"0",PayLoading:"0"};class oi extends i.oi{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.hasPrefetched=!1,this.enableEmbedded=n.OptionsController.state.enableEmbedded,this.open=s.I.state.open,this.caipAddress=c.R.state.activeCaipAddress,this.caipNetwork=c.R.state.activeCaipNetwork,this.shake=s.I.state.shake,this.filterByNamespace=l.ConnectorController.state.filterByNamespace,this.padding=U.gR.spacing[1],this.mobileFullScreen=n.OptionsController.state.enableMobileFullScreen,this.initializeTheming(),d.ApiController.prefetchAnalyticsConfig(),this.unsubscribe.push(s.I.subscribeKey("open",e=>e?this.onOpen():this.onClose()),s.I.subscribeKey("shake",e=>this.shake=e),c.R.subscribeKey("activeCaipNetwork",e=>this.onNewNetwork(e)),c.R.subscribeKey("activeCaipAddress",e=>this.onNewAddress(e)),n.OptionsController.subscribeKey("enableEmbedded",e=>this.enableEmbedded=e),l.ConnectorController.subscribeKey("filterByNamespace",e=>{this.filterByNamespace===e||c.R.getAccountData(e)?.caipAddress||(d.ApiController.fetchRecommendedWallets(),this.filterByNamespace=e)}),u.RouterController.subscribeKey("view",()=>{this.dataset.border=tX.hasFooter()?"true":"false",this.padding=oo[u.RouterController.state.view]??U.gR.spacing[1]}))}firstUpdated(){if(this.dataset.border=tX.hasFooter()?"true":"false",this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.caipAddress){if(this.enableEmbedded){s.I.close(),this.prefetch();return}this.onNewAddress(this.caipAddress)}this.open&&this.onOpen(),this.enableEmbedded&&this.prefetch()}
2206disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return(this.style.setProperty("--local-modal-padding",this.padding),this.enableEmbedded)?(0,i.dy)`${this.contentTemplate()}
2207        <w3m-tooltip></w3m-tooltip> `:this.open?(0,i.dy)`
2208          <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
2209            ${this.contentTemplate()}
2210          </wui-flex>
2211          <w3m-tooltip></w3m-tooltip>
2212        `:null}contentTemplate(){return(0,i.dy)` <wui-card
2213      shake="${this.shake}"
2214      data-embedded="${(0,a.o)(this.enableEmbedded)}"
2215      role="alertdialog"
2216      aria-modal="true"
2217      tabindex="0"
2218      data-testid="w3m-modal-card"
2219    >
2220      <w3m-header></w3m-header>
2221      <w3m-router></w3m-router>
2222      <w3m-footer></w3m-footer>
2223      <w3m-snackbar></w3m-snackbar>
2224      <w3m-alertbar></w3m-alertbar>
2225    </wui-card>`}async onOverlayClick(e){e.target!==e.currentTarget||this.mobileFullScreen||await this.handleClose()}async handleClose(){await m.safeClose()}initializeTheming(){let{themeVariables:e,themeMode:t}=w.ThemeController.state,o=U.Hg.getColorTheme(t);(0,U.n)(e,o)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),g.SnackController.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){let e=document.createElement("style");e.dataset.w3m=ot,e.textContent=`
2226      body {
2227        touch-action: none;
2228        overflow: hidden;
2229        overscroll-behavior: contain;
2230      }
2231      w3m-modal {
2232        pointer-events: auto;
2233      }
2234    `,document.head.appendChild(e)}onScrollUnlock(){let e=document.head.querySelector(`style[data-w3m="${ot}"]`);e&&e.remove()}onAddKeyboardListener(){this.abortController=new AbortController;let e=this.shadowRoot?.querySelector("wui-card");e?.focus(),window.addEventListener("keydown",t=>{if("Escape"===t.key)this.handleClose();else if("Tab"===t.key){let{tagName:o}=t.target;!o||o.includes("W3M-")||o.includes("WUI-")||e?.focus()}},this.abortController)}onRemoveKeyboardListener(){this.abortController?.abort(),this.abortController=void 0}async onNewAddress(e){let t=c.R.state.isSwitchingNamespace,o="ProfileWallets"===u.RouterController.state.view;e||t||o||s.I.close(),await h.w.initializeIfEnabled(e),this.caipAddress=e,c.R.setIsSwitchingNamespace(!1)}onNewNetwork(e){let t=this.caipNetwork,o=t?.caipNetworkId?.toString(),i=e?.caipNetworkId?.toString(),r="UnsupportedChain"===u.RouterController.state.view,a=s.I.state.open,n=!1;this.enableEmbedded&&"SwitchNetwork"===u.RouterController.state.view&&(n=!0),o!==i&&B.resetState(),a&&r&&(n=!0),n&&"SIWXSignMessage"!==u.RouterController.state.view&&u.RouterController.goBack(),this.caipNetwork=e}prefetch(){this.hasPrefetched||(d.ApiController.prefetch(),d.ApiController.fetchWalletsByPage({page:1}),this.hasPrefetched=!0)}}oi.styles=t9,oe([(0,r.Cb)({type:Boolean})],oi.prototype,"enableEmbedded",void 0),oe([(0,r.SB)()],oi.prototype,"open",void 0),oe([(0,r.SB)()],oi.prototype,"caipAddress",void 0),oe([(0,r.SB)()],oi.prototype,"caipNetwork",void 0),oe([(0,r.SB)()],oi.prototype,"shake",void 0),oe([(0,r.SB)()],oi.prototype,"filterByNamespace",void 0),oe([(0,r.SB)()],oi.prototype,"padding",void 0),oe([(0,r.SB)()],oi.prototype,"mobileFullScreen",void 0);let or=class extends oi{};or=oe([(0,U.Mo)("w3m-modal")],or);let oa=class extends oi{};oa=oe([(0,U.Mo)("appkit-modal")],oa);var on=(0,U.iv)`
2235  .icon-box {
2236    width: 64px;
2237    height: 64px;
2238    border-radius: ${({borderRadius:e})=>e[5]};
2239    background-color: ${({colors:e})=>e.semanticError010};
2240  }
2241`;let os=class extends i.oi{constructor(){super()}render(){return(0,i.dy)`
2242      <wui-flex
2243        flexDirection="column"
2244        alignItems="center"
2245        gap="4"
2246        .padding="${["1","3","4","3"]}"
2247      >
2248        <wui-flex justifyContent="center" alignItems="center" class="icon-box">
2249          <wui-icon size="xxl" color="error" name="warningCircle"></wui-icon>
2250        </wui-flex>
2251
2252        <wui-text variant="lg-medium" color="primary" align="center">
2253          The app isn't responding as expected
2254        </wui-text>
2255        <wui-text variant="md-regular" color="secondary" align="center">
2256          Try again or reach out to the app team for help.
2257        </wui-text>
2258
2259        <wui-button
2260          variant="neutral-secondary"
2261          size="md"
2262          @click=${this.onTryAgainClick.bind(this)}
2263          data-testid="w3m-usage-exceeded-button"
2264        >
2265          <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
2266          Try Again
2267        </wui-button>
2268      </wui-flex>
2269    `}onTryAgainClick(){u.RouterController.goBack()}};os.styles=on,os=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n}([(0,U.Mo)("w3m-usage-exceeded-view")],os);var oc=o(74424);o(967);var ol=(0,U.iv)`
2270  :host {
2271    width: 100%;
2272  }
2273`,od=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ou=class extends i.oi{constructor(){super(...arguments),this.hasImpressionSent=!1,this.walletImages=[],this.imageSrc="",this.name="",this.size="md",this.tabIdx=void 0,this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100",this.rdnsId="",this.displayIndex=void 0,this.walletRank=void 0,this.namespaces=[]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.cleanupIntersectionObserver()}updated(e){super.updated(e),(e.has("name")||e.has("imageSrc")||e.has("walletRank"))&&(this.hasImpressionSent=!1),e.has("walletRank")&&this.walletRank&&!this.intersectionObserver&&this.setupIntersectionObserver()}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(e=>{!e.isIntersecting||this.loading||this.hasImpressionSent||this.sendImpressionEvent()})},{threshold:.1}),this.intersectionObserver.observe(this)}cleanupIntersectionObserver(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=void 0)}sendImpressionEvent(){this.name&&!this.hasImpressionSent&&this.walletRank&&(this.hasImpressionSent=!0,(this.rdnsId||this.name)&&N.X.sendWalletImpressionEvent({name:this.name,walletRank:this.walletRank,rdnsId:this.rdnsId,view:u.RouterController.state.view,displayIndex:this.displayIndex}))}handleGetWalletNamespaces(){return Object.keys(oc.j.state.adapters).length>1?this.namespaces:[]}render(){return(0,i.dy)`
2274      <wui-list-wallet
2275        .walletImages=${this.walletImages}
2276        imageSrc=${(0,a.o)(this.imageSrc)}
2277        name=${this.name}
2278        size=${(0,a.o)(this.size)}
2279        tagLabel=${(0,a.o)(this.tagLabel)}
2280        .tagVariant=${this.tagVariant}
2281        .walletIcon=${this.walletIcon}
2282        .tabIdx=${this.tabIdx}
2283        .disabled=${this.disabled}
2284        .showAllWallets=${this.showAllWallets}
2285        .loading=${this.loading}
2286        loadingSpinnerColor=${this.loadingSpinnerColor}
2287        .namespaces=${this.handleGetWalletNamespaces()}
2288      ></wui-list-wallet>
2289    `}};ou.styles=ol,od([(0,r.Cb)({type:Array})],ou.prototype,"walletImages",void 0),od([(0,r.Cb)()],ou.prototype,"imageSrc",void 0),od([(0,r.Cb)()],ou.prototype,"name",void 0),od([(0,r.Cb)()],ou.prototype,"size",void 0),od([(0,r.Cb)()],ou.prototype,"tagLabel",void 0),od([(0,r.Cb)()],ou.prototype,"tagVariant",void 0),od([(0,r.Cb)()],ou.prototype,"walletIcon",void 0),od([(0,r.Cb)()],ou.prototype,"tabIdx",void 0),od([(0,r.Cb)({type:Boolean})],ou.prototype,"disabled",void 0),od([(0,r.Cb)({type:Boolean})],ou.prototype,"showAllWallets",void 0),od([(0,r.Cb)({type:Boolean})],ou.prototype,"loading",void 0),od([(0,r.Cb)({type:String})],ou.prototype,"loadingSpinnerColor",void 0),od([(0,r.Cb)()],ou.prototype,"rdnsId",void 0),od([(0,r.Cb)()],ou.prototype,"displayIndex",void 0),od([(0,r.Cb)()],ou.prototype,"walletRank",void 0),od([(0,r.Cb)({type:Array})],ou.prototype,"namespaces",void 0),ou=od([(0,U.Mo)("w3m-list-wallet")],ou);var op=(0,U.iv)`
2290  :host {
2291    --local-duration-height: 0s;
2292    --local-duration: ${({durations:e})=>e.lg};
2293    --local-transition: ${({easings:e})=>e["ease-out-power-2"]};
2294  }
2295
2296  .container {
2297    display: block;
2298    overflow: hidden;
2299    overflow: hidden;
2300    position: relative;
2301    height: var(--local-container-height);
2302    transition: height var(--local-duration-height) var(--local-transition);
2303    will-change: height, padding-bottom;
2304  }
2305
2306  .container[data-mobile-fullscreen='true'] {
2307    overflow: scroll;
2308  }
2309
2310  .page {
2311    position: absolute;
2312    top: 0;
2313    left: 0;
2314    right: 0;
2315    width: 100%;
2316    height: auto;
2317    width: inherit;
2318    box-sizing: border-box;
2319    display: flex;
2320    flex-direction: column;
2321    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
2322    border-bottom-left-radius: var(--local-border-bottom-radius);
2323    border-bottom-right-radius: var(--local-border-bottom-radius);
2324    transition: border-bottom-left-radius var(--local-duration) var(--local-transition);
2325  }
2326
2327  .page[data-mobile-fullscreen='true'] {
2328    height: 100%;
2329  }
2330
2331  .page-content {
2332    display: flex;
2333    flex-direction: column;
2334    min-height: 100%;
2335  }
2336
2337  .footer {
2338    height: var(--apkt-footer-height);
2339  }
2340
2341  div.page[view-direction^='prev-'] .page-content {
2342    animation:
2343      slide-left-out var(--local-duration) forwards var(--local-transition),
2344      slide-left-in var(--local-duration) forwards var(--local-transition);
2345    animation-delay: 0ms, var(--local-duration, ${({durations:e})=>e.lg});
2346  }
2347
2348  div.page[view-direction^='next-'] .page-content {
2349    animation:
2350      slide-right-out var(--local-duration) forwards var(--local-transition),
2351      slide-right-in var(--local-duration) forwards var(--local-transition);
2352    animation-delay: 0ms, var(--local-duration, ${({durations:e})=>e.lg});
2353  }
2354
2355  @keyframes slide-left-out {
2356    from {
2357      transform: translateX(0px) scale(1);
2358      opacity: 1;
2359      filter: blur(0px);
2360    }
2361    to {
2362      transform: translateX(8px) scale(0.99);
2363      opacity: 0;
2364      filter: blur(4px);
2365    }
2366  }
2367
2368  @keyframes slide-left-in {
2369    from {
2370      transform: translateX(-8px) scale(0.99);
2371      opacity: 0;
2372      filter: blur(4px);
2373    }
2374    to {
2375      transform: translateX(0) translateY(0) scale(1);
2376      opacity: 1;
2377      filter: blur(0px);
2378    }
2379  }
2380
2381  @keyframes slide-right-out {
2382    from {
2383      transform: translateX(0px) scale(1);
2384      opacity: 1;
2385      filter: blur(0px);
2386    }
2387    to {
2388      transform: translateX(-8px) scale(0.99);
2389      opacity: 0;
2390      filter: blur(4px);
2391    }
2392  }
2393
2394  @keyframes slide-right-in {
2395    from {
2396      transform: translateX(8px) scale(0.99);
2397      opacity: 0;
2398      filter: blur(4px);
2399    }
2400    to {
2401      transform: translateX(0) translateY(0) scale(1);
2402      opacity: 1;
2403      filter: blur(0px);
2404    }
2405  }
2406`,oh=function(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let om=class extends i.oi{constructor(){super(...arguments),this.resizeObserver=void 0,this.transitionDuration="0.15s",this.transitionFunction="",this.history="",this.view="",this.setView=void 0,this.viewDirection="",this.historyState="",this.previousHeight="0px",this.mobileFullScreen=n.OptionsController.state.enableMobileFullScreen,this.onViewportResize=()=>{this.updateContainerHeight()}}updated(e){if(e.has("history")){let e=this.history;""!==this.historyState&&this.historyState!==e&&this.onViewChange(e)}e.has("transitionDuration")&&this.style.setProperty("--local-duration",this.transitionDuration),e.has("transitionFunction")&&this.style.setProperty("--local-transition",this.transitionFunction)}firstUpdated(){this.transitionFunction&&this.style.setProperty("--local-transition",this.transitionFunction),this.style.setProperty("--local-duration",this.transitionDuration),this.historyState=this.history,this.resizeObserver=new ResizeObserver(e=>{for(let t of e)if(t.target===this.getWrapper()){let e=t.contentRect.height,o=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0");
2406this.mobileFullScreen?(e=(window.visualViewport?.height||window.innerHeight)-this.getHeaderHeight()-o,this.style.setProperty("--local-border-bottom-radius","0px")):(e+=o,this.style.setProperty("--local-border-bottom-radius",o?"var(--apkt-borderRadius-5)":"0px")),this.style.setProperty("--local-container-height",`${e}px`),"0px"!==this.previousHeight&&this.style.setProperty("--local-duration-height",this.transitionDuration),this.previousHeight=`${e}px`}}),this.resizeObserver.observe(this.getWrapper()),this.updateContainerHeight(),window.addEventListener("resize",this.onViewportResize),window.visualViewport?.addEventListener("resize",this.onViewportResize)}disconnectedCallback(){let e=this.getWrapper();e&&this.resizeObserver&&this.resizeObserver.unobserve(e),window.removeEventListener("resize",this.onViewportResize),window.visualViewport?.removeEventListener("resize",this.onViewportResize)}render(){return(0,i.dy)`
2407      <div class="container" data-mobile-fullscreen="${(0,a.o)(this.mobileFullScreen)}">
2408        <div
2409          class="page"
2410          data-mobile-fullscreen="${(0,a.o)(this.mobileFullScreen)}"
2411          view-direction="${this.viewDirection}"
2412        >
2413          <div class="page-content">
2414            <slot></slot>
2415          </div>
2416        </div>
2417      </div>
2418    `}onViewChange(e){let t=e.split(",").filter(Boolean),o=this.historyState.split(",").filter(Boolean),i=o.length,r=t.length,a=t[t.length-1]||"",n=U.Hg.cssDurationToNumber(this.transitionDuration),s="";r>i?s="next":r<i?s="prev":r===i&&t[r-1]!==o[i-1]&&(s="next"),this.viewDirection=`${s}-${a}`,setTimeout(()=>{this.historyState=e,this.setView?.(a)},n),setTimeout(()=>{this.viewDirection=""},2*n)}getWrapper(){return this.shadowRoot?.querySelector("div.page")}updateContainerHeight(){let e=this.getWrapper();if(!e)return;let t=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0"),o=0;this.mobileFullScreen?(o=(window.visualViewport?.height||window.innerHeight)-this.getHeaderHeight()-t,this.style.setProperty("--local-border-bottom-radius","0px")):(o=e.getBoundingClientRect().height+t,this.style.setProperty("--local-border-bottom-radius",t?"var(--apkt-borderRadius-5)":"0px")),this.style.setProperty("--local-container-height",`${o}px`),"0px"!==this.previousHeight&&this.style.setProperty("--local-duration-height",this.transitionDuration),this.previousHeight=`${o}px`}getHeaderHeight(){return 60}};om.styles=[op],oh([(0,r.Cb)({type:String})],om.prototype,"transitionDuration",void 0),oh([(0,r.Cb)({type:String})],om.prototype,"transitionFunction",void 0),oh([(0,r.Cb)({type:String})],om.prototype,"history",void 0),oh([(0,r.Cb)({type:String})],om.prototype,"view",void 0),oh([(0,r.Cb)({attribute:!1})],om.prototype,"setView",void 0),oh([(0,r.SB)()],om.prototype,"viewDirection",void 0),oh([(0,r.SB)()],om.prototype,"historyState",void 0),oh([(0,r.SB)()],om.prototype,"previousHeight",void 0),oh([(0,r.SB)()],om.prototype,"mobileFullScreen",void 0),om=oh([(0,U.Mo)("w3m-router-container")],om)}}]);

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.