1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[54706],{54706:(e,t,o)=>{o.r(t),o.d(t,{AppKitModal:()=>ej,W3mListWallet:()=>e_,W3mModal:()=>eU,W3mModalBase:()=>eH,W3mRouterContainer:()=>eG});var i=o(83138),a=o(94738),r=o(78964),n=o(65103),s=o(45553),c=o(67074),l=o(76595),d=o(93481),u=o(10899),p=o(72880),w=o(67869),h=o(27798),m=o(71120);let g={isUnsupportedChainView:()=>"UnsupportedChain"===w.I.state.view||"SwitchNetwork"===w.I.state.view&&w.I.state.history.includes("UnsupportedChain"),async safeClose(){if(this.isUnsupportedChainView()||await m.U.isSIWXCloseDisabled())return void l.W.shake();("DataCapture"===w.I.state.view||"DataCaptureOtpConfirm"===w.I.state.view)&&h.x.disconnect(),l.W.close()}};var y=o(45069),f=o(65374),v=o(12319),b=o(12661),k=o(98866),x=o(31470),T=o(73537),S=o(30982),P=o(71305),C=o(28977),A=o(83941);let $={getGasPriceInEther:(e,t)=>Number(t*e)/1e18,getGasPriceInUSD(e,t,o){let i=$.getGasPriceInEther(t,o);return x.S.bigNumber(e).times(i).toNumber()},getPriceImpact({sourceTokenAmount:e,sourceTokenPriceInUSD:t,toTokenPriceInUSD:o,toTokenAmount:i}){let a=x.S.bigNumber(e).times(t),r=x.S.bigNumber(i).times(o);return a.minus(r).div(a).times(100).toNumber()},getMaxSlippage(e,t){let o=x.S.bigNumber(e).div(100);return x.S.multiply(t,o).toNumber()},getProviderFee:(e,t=.0085)=>x.S.bigNumber(e).times(t).toString(),isInsufficientNetworkTokenForGas:(e,t)=>!!x.S.bigNumber(e).eq(0)||x.S.bigNumber(x.S.bigNumber(t||"0")).gt(e),isInsufficientSourceTokenForSwap(e,t,o){let i=o?.find(e=>e.address===t)?.quantity?.numeric;return x.S.bigNumber(i||"0").lt(e)}};var I=o(36964),W=o(52502),E=o(44826),N=o(70417);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:C.oU.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,b.BX)({...R}),D={state:O,subscribe:e=>(0,b.B1)(O,()=>e(O)),subscribeKey:(e,t)=>(0,k.u$)(O,e,t),getParams(){let e=d.W.state.activeChain,t=d.W.getAccountData(e)?.caipAddress??d.W.state.activeCaipAddress,o=v.w.getPlainAddress(t),i=(0,P.K1)(),a=u.a.getConnectorId(d.W.state.activeChain);if(!o)throw Error("No address found to swap the tokens from.");let r=!O.toToken?.address||!O.toToken?.decimals,n=!O.sourceToken?.address||!O.sourceToken?.decimals||!x.S.bigNumber(O.sourceTokenAmount).gt(0),c=!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:r,invalidSourceToken:n,invalidSourceTokenAmount:c,availableToSwap:t&&!r&&!n&&!c,isAuthConnector:a===s.o.CONNECTOR_ID.AUTH}},async setSourceToken(e){if(!e){O.sourceToken=e,O.sourceTokenAmount="",O.sourceTokenPriceInUSD=0;return}O.sourceToken=e,await q.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 q.setTokenPrice(e.address,"toToken")},setToTokenAmount(e){O.toTokenAmount=e?x.S.toFixed(e,6):""},async setTokenPrice(e,t){let o=O.tokensPriceMap[e]||0;o||(O.loadingPrices=!0,o=await q.getAddressPrice(e)),"sourceToken"===t?O.sourceTokenPriceInUSD=o:"toToken"===t&&(O.toTokenPriceInUSD=o),O.loadingPrices&&(O.loadingPrices=!1),q.getParams().availableToSwap&&!O.switchingTokens&&q.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;q.setSourceTokenAmount(o),q.setToTokenAmount(""),await q.setSourceToken(e),await q.setToToken(t),O.switchingTokens=!1,q.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}=q.getParams(),t=O.tokens?.find(t=>t.address===e);q.setSourceToken(t),q.setToToken(void 0)},getApprovalLoadingState:()=>O.loadingApprovalTransaction,clearError(){O.transactionError=void 0},async initializeState(){if(!O.initializing){if(O.initializing=!0,!O.initialized)try{await q.fetchTokens(),O.initialized=!0}catch(e){O.initialized=!1,f.P.showError("Failed to initialize swap"),w.I.goBack()}O.initializing=!1}},async fetchTokens(){let{networkAddress:e}=q.getParams();await q.getNetworkTokenPrice(),await q.getMyTokensWithBalance();let t=O.myTokensWithBalance?.find(t=>t.address===e);t&&(O.networkTokenSymbol=t.symbol,q.setSourceToken(t),q.setSourceTokenAmount("0"))},async getTokenList(){let e=d.W.state.activeCaipNetwork?.caipNetworkId;if(O.caipNetworkId!==e||!O.tokens)try{O.tokensLoading=!0;let t=await A.s.getTokenList(e);O.tokens=t,O.caipNetworkId=e,O.popularTokens=t.sort((e,t)=>
1e.symbol<t.symbol?-1:+(e.symbol>t.symbol)),O.suggestedTokens=t.filter(e=>!!C.oU.SWAP_SUGGESTED_TOKENS.includes(e.symbol))}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 E.T.fetchTokenPrice({addresses:[e]}),i=o?.fungibles||[],a=[...O.tokens||[],...O.myTokensWithBalance||[]],r=a?.find(t=>t.address===e)?.symbol,n=parseFloat((i.find(e=>e.symbol.toLowerCase()===r?.toLowerCase())?.price||0).toString());return O.tokensPriceMap[e]=n,n},async getNetworkTokenPrice(){let{networkAddress:e}=q.getParams(),t=await E.T.fetchTokenPrice({addresses:[e]}).catch(()=>(f.P.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 S.Z.getMyTokensWithBalance(e),o=A.s.mapBalancesToSwapTokens(t);o&&(await q.getInitialGasPrice(),q.setBalances(o))},setBalances(e){let{networkAddress:t}=q.getParams(),o=d.W.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?x.S.multiply(i.quantity.numeric,i.price).toString():"0"},async getInitialGasPrice(){let e=await A.s.fetchGasPrice();if(!e)return{gasPrice:null,gasPriceInUSD:null};switch(d.W.state?.activeCaipNetwork?.chainNamespace){case s.o.CHAIN.SOLANA:return O.gasFee=e.standard??"0",O.gasPriceInUSD=x.S.multiply(e.standard,O.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(O.gasFee),gasPriceInUSD:Number(O.gasPriceInUSD)};case s.o.CHAIN.EVM:default:let t=e.standard??"0",o=BigInt(t),i=BigInt(15e4),a=$.getGasPriceInUSD(O.networkPrice,i,o);return O.gasFee=t,O.gasPriceInUSD=a,{gasPrice:o,gasPriceInUSD:a}}},async swapTokens(){let e=d.W.getAccountData()?.address,t=O.sourceToken,o=O.toToken,i=x.S.bigNumber(O.sourceTokenAmount).gt(0);if(i||q.setToTokenAmount(""),!o||!t||O.loadingPrices||!i||!e)return;O.loadingQuote=!0;let a=x.S.bigNumber(O.sourceTokenAmount).times(10**t.decimals).round(0);try{let i=await E.T.fetchSwapQuote({userAddress:e,from:t.address,to:o.address,gasPrice:O.gasFee,amount:a.toString()});O.loadingQuote=!1;let r=i?.quotes?.[0]?.toAmount;if(!r)return void W.h.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");let n=x.S.bigNumber(r).div(10**o.decimals).toString();q.setToTokenAmount(n),q.hasInsufficientToken(O.sourceTokenAmount,t.address)?O.inputError="Insufficient balance":(O.inputError=void 0,q.setTransactionDetails())}catch(t){let e=await A.s.handleSwapError(t);O.loadingQuote=!1,O.inputError=e||"Insufficient balance"}},async getTransaction(){let{fromCaipAddress:e,availableToSwap:t}=q.getParams(),o=O.sourceToken,i=O.toToken;if(e&&t&&o&&i&&!O.loadingQuote)try{let t;return O.loadingBuildTransaction=!0,t=await A.s.fetchSwapAllowance({userAddress:e,tokenAddress:o.address,sourceTokenAmount:O.sourceTokenAmount,sourceTokenDecimals:o.decimals})?await q.createSwapTransaction():await q.createAllowanceTransaction(),O.loadingBuildTransaction=!1,O.fetchError=!1,t}catch(e){w.I.goBack(),f.P.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}=q.getParams();if(e&&o){if(!t)throw Error("createAllowanceTransaction - No source token address found.");try{let i=await E.T.generateApproveCalldata({from:t,to:o,userAddress:e}),a=v.w.getPlainAddress(i.tx.from);if(!a)throw Error("SwapController:createAllowanceTransaction - address is required");let r={data:i.tx.data,to:a,gasPrice:BigInt(i.tx.eip155.gasPrice),value:BigInt(i.tx.value),toAmount:O.toTokenAmount};return O.swapTransaction=void 0,O.approvalTransaction={data:r.data,to:r.to,gasPrice:r.gasPrice,value:r.value,toAmount:r.toAmount},{data:r.data,to:r.to,gasPrice:r.gasPrice,value:r.value,toAmount:r.toAmount}}catch(e){w.I.goBack(),f.P.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}=q.getParams(),i=O.sourceToken,a=O.toToken;if(!t||!o||!i||!a)return;let r=h.x.parseUnits(o,i.decimals)?.toString();try{let o=await E.T.generateSwapCalldata({userAddress:t,from:i.address,to:a.address,amount:r,disableEstimate:!0}),n=i.address===e,s=BigInt(o.tx.eip155.gas),c=BigInt(o.tx.eip155.gasPrice),l=v.w.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(r??"0"):BigInt("0"),toAmount:O.toTokenAmount};return O.gasPriceInUSD=$.getGasPriceInUSD(O.networkPrice,s,c),O.approvalTransaction=void 0,O.swapTransaction=d,d}catch(e){w.I.goBack(),f.P.showError("Failed to create transaction"),O.approvalTransaction=void 0,O.swapTransaction=void 0,O.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){f.P.showLoading("Approve limit increase in your wallet"),w.I.replace("SwapPreview")},async sendTransactionForApproval(e){let{fromAddress:t,isAuthConnector:o}=q.getParams();O.loadingApprovalTransaction=!0,o?w.I.pushTransactionStack({onSuccess:q.onEmbeddedWalletApprovalSuccess}):f.P.showLoading("Approve limit increase in your wallet");try{await h.x.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:s.o.CHAIN.EVM}),await q.swapTokens(),await q.getTransaction(),O.approvalTransaction=void 0,O.loadingApprovalTransaction=!1}catch(e){O.transactionError=e?.displayMessage,O.loadingApprovalTransaction=!1,f.P.showError(e?.displayMessage||"Transaction error"),N.E.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:e?.displayMessage||e?.message||"Unknown",network:d.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:q.state.sourceToken?.symbol||"",swapToToken:q.state.toToken?.symbol||"",swapFromAmount:q.state.sourceTokenAmount||"",swapToAmount:q.state.toTokenAmount||"",isSmartAccount:(0,P.lj)(s.o.CHAIN.EVM)===T.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(e){if(!e)return;let{fromAddress:t,toTokenAmount:o,isAuthConnector:i}=q.getParams();O.loadingTransaction=!0;let a=`Swapping ${O.sourceToken?.symbol} to ${x.S.formatNumberToLocalString(o,3)} ${O.toToken?.symbol}`,r=`Swapped ${O.sourceToken?.symbol} to ${x.S.formatNumberToLocalString(o,3)} ${O.toToken?.symbol}`;i?w.I.pushTransactionStack({onSuccess(){w.I.replace("Account"),f.P.showLoading(a),D.resetState()}}
1):f.P.showLoading("Confirm transaction in your wallet");try{let o=[O.sourceToken?.address,O.toToken?.address].join(","),a=await h.x.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:s.o.CHAIN.EVM});return O.loadingTransaction=!1,f.P.showSuccess(r),N.E.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:d.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:q.state.sourceToken?.symbol||"",swapToToken:q.state.toToken?.symbol||"",swapFromAmount:q.state.sourceTokenAmount||"",swapToAmount:q.state.toTokenAmount||"",isSmartAccount:(0,P.lj)(s.o.CHAIN.EVM)===T.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),D.resetState(),i||w.I.replace("Account"),D.getMyTokensWithBalance(o),a}catch(e){O.transactionError=e?.displayMessage,O.loadingTransaction=!1,f.P.showError(e?.displayMessage||"Transaction error"),N.E.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:e?.displayMessage||e?.message||"Unknown",network:d.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:q.state.sourceToken?.symbol||"",swapToToken:q.state.toToken?.symbol||"",swapFromAmount:q.state.sourceTokenAmount||"",swapToAmount:q.state.toTokenAmount||"",isSmartAccount:(0,P.lj)(s.o.CHAIN.EVM)===T.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken:(e,t)=>$.isInsufficientSourceTokenForSwap(e,t,O.myTokensWithBalance),setTransactionDetails(){let{toTokenAddress:e,toTokenDecimals:t}=q.getParams();e&&t&&(O.gasPriceInUSD=$.getGasPriceInUSD(O.networkPrice,BigInt(O.gasFee),BigInt(15e4)),O.priceImpact=$.getPriceImpact({sourceTokenAmount:O.sourceTokenAmount,sourceTokenPriceInUSD:O.sourceTokenPriceInUSD,toTokenPriceInUSD:O.toTokenPriceInUSD,toTokenAmount:O.toTokenAmount}),O.maxSlippage=$.getMaxSlippage(O.slippage,O.toTokenAmount),O.providerFee=$.getProviderFee(O.sourceTokenAmount))}},q=(0,I.X)(D);var z=o(94545),F=o(71084),B=o(47327),M=o(20296);let H=(0,M.AH)` 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`,U=class extends i.WF{render(){return(0,i.qy)`<slot></slot>`}};U.styles=[F.W5,H],U=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n}([(0,B.E)("wui-card")],U),o(62956),o(99691),o(34961),o(38534);let j=(0,M.AH)` 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`;var L=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let V={info:"info",success:"checkmark",warning:"warningCircle",error:"warning"},_=class extends i.WF{constructor(){super(...arguments),this.message="",this.type="info"}render(){return(0,i.qy)` 86 <wui-flex 87 data-type=${(0,r.J)(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=${V[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(){W.h.close()}};_.styles=[F.W5,j],L([(0,a.MZ)()],_.prototype,"message",void 0),L([(0,a.MZ)()],_.prototype,"type",void 0),_=L([(0,B.E)("wui-alertbar")],_);let Z=(0,z.AH)` 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`;var K=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let G={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"}},Y=class extends i.WF{constructor(){super(),this.unsubscribe=[],this.open=W.h.state.open,this.onOpen(!0),this.unsubscribe.push(W.h.subscribeKey("open",e=>{this.open=e,this.onOpen(!1)}))}
124disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{message:e,variant:t}=W.h.state,o=G[t];return(0,i.qy)` 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")}};Y.styles=Z,K([(0,a.wk)()],Y.prototype,"open",void 0),Y=K([(0,z.EM)("w3m-alertbar")],Y);var X=o(14744),J=o(29936);let Q=(0,M.AH)` 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`;var ee=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let et=class extends i.WF{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.qy)`<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,r.J)(this.iconSize)}></wui-icon> 261 </button>`}}
261;et.styles=[F.W5,F.fD,Q],ee([(0,a.MZ)()],et.prototype,"icon",void 0),ee([(0,a.MZ)()],et.prototype,"variant",void 0),ee([(0,a.MZ)()],et.prototype,"type",void 0),ee([(0,a.MZ)()],et.prototype,"size",void 0),ee([(0,a.MZ)()],et.prototype,"iconSize",void 0),ee([(0,a.MZ)({type:Boolean})],et.prototype,"fullWidth",void 0),ee([(0,a.MZ)({type:Boolean})],et.prototype,"disabled",void 0),et=ee([(0,B.E)("wui-icon-button")],et),o(45166);let eo=(0,M.AH)` 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`;var ei=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let ea={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},er={lg:"lg",md:"md",sm:"sm"},en=class extends i.WF{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size="lg",this.type="text-dropdown",this.disabled=!1}render(){return(0,i.qy)`<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=ea[this.size];return this.text?(0,i.qy)`<wui-text color="primary" variant=${e}>${this.text}</wui-text>`:null}imageTemplate(){if(this.imageSrc)return(0,i.qy)`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`;let e=er[this.size];return(0,i.qy)` <wui-flex class="left-icon-container"> 370 <wui-icon size=${e} name="networkPlaceholder"></wui-icon> 371 </wui-flex>`}};en.styles=[F.W5,F.fD,eo],ei([(0,a.MZ)()],en.prototype,"imageSrc",void 0),ei([(0,a.MZ)()],en.prototype,"text",void 0),ei([(0,a.MZ)()],en.prototype,"size",void 0),ei([(0,a.MZ)()],en.prototype,"type",void 0),ei([(0,a.MZ)({type:Boolean})],en.prototype,"disabled",void 0),en=ei([(0,B.E)("wui-select")],en),o(50505),o(41163);var es=o(91867);let ec=(0,z.AH)` 372 :host { 373 height: 60px; 374 } 375 376 :host > wui-flex { 377 box-sizing: border-box; 378 background-color: var(--local-header-background-color); 379 } 380 381 wui-text { 382 background-color: var(--local-header-background-color); 383 } 384 385 wui-flex.w3m-header-title { 386 transform: translateY(0); 387 opacity: 1; 388 } 389 390 wui-flex.w3m-header-title[view-direction='prev'] { 391 animation: 392 slide-down-out 120ms forwards ${({easings:e})=>e["ease-out-power-2"]}, 393 slide-down-in 120ms forwards ${({easings:e})=>e["ease-out-power-2"]}; 394 animation-delay: 0ms, 200ms; 395 } 396 397 wui-flex.w3m-header-title[view-direction='next'] { 398 animation: 399 slide-up-out 120ms forwards ${({easings:e})=>e["ease-out-power-2"]}, 400 slide-up-in 120ms forwards ${({easings:e})=>e["ease-out-power-2"]}; 401 animation-delay: 0ms, 200ms; 402 } 403 404 wui-icon-button[data-hidden='true'] { 405 opacity: 0 !important; 406 pointer-events: none; 407 } 408 409 @keyframes slide-up-out { 410 from { 411 transform: translateY(0px); 412 opacity: 1; 413 } 414 to { 415 transform: translateY(3px); 416 opacity: 0; 417 } 418 } 419 420 @keyframes slide-up-in { 421 from { 422 transform: translateY(-3px); 423 opacity: 0; 424 } 425 to { 426 transform: translateY(0); 427 opacity: 1; 428 } 429 } 430 431 @keyframes slide-down-out { 432 from { 433 transform: translateY(0px); 434 opacity: 1; 435 } 436 to { 437 transform: translateY(-3px); 438 opacity: 0; 439 } 440 } 441 442 @keyframes slide-down-in { 443 from { 444 transform: translateY(3px); 445 opacity: 0; 446 } 447 to { 448 transform: translateY(0); 449 opacity: 1; 450 } 451 } 452`;var el=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let ed=["SmartSessionList"],eu={PayWithExchange:z.f.tokens.theme.foregroundPrimary};function ep(){let e=w.I.state.data?.connector?.name,t=w.I.state.data?.wallet?.name,o=w.I.state.data?.network?.name,i=t??e,a=u.a.getConnectors(),r=1===a.length&&a[0]?.id==="w3m-email",n=d.W.getAccountData()?.socialProvider;return{Connect:`Connect ${r?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExter
452nal: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:"Payment in Progress",DataCapture:"Profile",DataCaptureOtpConfirm:"Confirm Email",FundWallet:"Fund Wallet",PayWithExchange:"Deposit from Exchange",PayWithExchangeSelectAsset:"Select Asset"}}let ew=class extends i.WF{constructor(){super(),this.unsubscribe=[],this.heading=ep()[w.I.state.view],this.network=d.W.state.activeCaipNetwork,this.networkImage=X.$.getNetworkImage(this.network),this.showBack=!1,this.prevHistoryLength=1,this.view=w.I.state.view,this.viewDirection="",this.unsubscribe.push(J.j.subscribeNetworkImages(()=>{this.networkImage=X.$.getNetworkImage(this.network)}),w.I.subscribeKey("view",e=>{setTimeout(()=>{this.view=e,this.heading=ep()[e]},es.o.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),d.W.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=X.$.getNetworkImage(this.network)}))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=eu[w.I.state.view]??z.f.tokens.theme.backgroundPrimary;return this.style.setProperty("--local-header-background-color",e),(0,i.qy)` 453 <wui-flex 454 .padding=${["0","4","0","4"]} 455 justifyContent="space-between" 456 alignItems="center" 457 > 458 ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()} 459 </wui-flex> 460 `}onWalletHelp(){N.E.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),w.I.push("WhatIsAWallet")}async onClose(){await g.safeClose()}rightHeaderTemplate(){let e=c.H?.state?.features?.smartSessions;return"Account"===w.I.state.view&&e?(0,i.qy)`<wui-flex> 461 <wui-icon-button 462 icon="clock" 463 size="lg" 464 iconSize="lg" 465 type="neutral" 466 variant="primary" 467 @click=${()=>w.I.push("SmartSessionList")} 468 data-testid="w3m-header-smart-sessions" 469 ></wui-icon-button> 470 ${this.closeButtonTemplate()} 471 </wui-flex> `:this.closeButtonTemplate()}closeButtonTemplate(){return(0,i.qy)` 472 <wui-icon-button 473 icon="close" 474 size="lg" 475 type="neutral" 476 variant="primary" 477 iconSize="lg" 478 @click=${this.onClose.bind(this)} 479 data-testid="w3m-header-close" 480 ></wui-icon-button> 481 `}titleTemplate(){let e=ed.includes(this.view);return(0,i.qy)` 482 <wui-flex 483 view-direction="${this.viewDirection}" 484 class="w3m-header-title" 485 alignItems="center" 486 gap="2" 487 > 488 <wui-text 489 display="inline" 490 variant="lg-regular" 491 color="primary" 492 data-testid="w3m-header-text" 493 > 494 ${this.heading} 495 </wui-text> 496 ${e?(0,i.qy)`<wui-tag variant="accent" size="md">Beta</wui-tag>`:null} 497 </wui-flex> 498 `}leftHeaderTemplate(){let{view:e}=w.I.state,t="Connect"===e,o=c.H.state.enableEmbedded,a=c.H.state.enableNetworkSwitch;return"Account"===e&&a?(0,i.qy)`<wui-select 499 id="dynamic" 500 data-testid="w3m-account-select-network" 501 active-network=${(0,r.J)(this.network?.name)}
501 502 @click=${this.onNetworks.bind(this)} 503 imageSrc=${(0,r.J)(this.networkImage)} 504 ></wui-select>`:this.showBack&&!("ApproveTransaction"===e||"ConnectingSiwe"===e||t&&o)?(0,i.qy)`<wui-icon-button 505 data-testid="header-back" 506 id="dynamic" 507 icon="chevronLeft" 508 size="lg" 509 iconSize="lg" 510 type="neutral" 511 variant="primary" 512 @click=${this.onGoBack.bind(this)} 513 ></wui-icon-button>`:(0,i.qy)`<wui-icon-button 514 data-hidden=${!t} 515 id="dynamic" 516 icon="helpCircle" 517 size="lg" 518 iconSize="lg" 519 type="neutral" 520 variant="primary" 521 @click=${this.onWalletHelp.bind(this)} 522 ></wui-icon-button>`}onNetworks(){this.isAllowedNetworkSwitch()&&(N.E.sendEvent({type:"track",event:"CLICK_NETWORKS"}),w.I.push("Networks"))}isAllowedNetworkSwitch(){let e=d.W.getAllRequestedCaipNetworks(),t=!!e&&e.length>1,o=e?.find(({id:e})=>e===this.network?.id);return t||!o}onViewChange(){let{history:e}=w.I.state,t=es.o.VIEW_DIRECTION.Next;e.length<this.prevHistoryLength&&(t=es.o.VIEW_DIRECTION.Prev),this.prevHistoryLength=e.length,this.viewDirection=t}async onHistoryChange(){let{history:e}=w.I.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(){w.I.goBack()}};ew.styles=ec,el([(0,a.wk)()],ew.prototype,"heading",void 0),el([(0,a.wk)()],ew.prototype,"network",void 0),el([(0,a.wk)()],ew.prototype,"networkImage",void 0),el([(0,a.wk)()],ew.prototype,"showBack",void 0),el([(0,a.wk)()],ew.prototype,"prevHistoryLength",void 0),el([(0,a.wk)()],ew.prototype,"view",void 0),el([(0,a.wk)()],ew.prototype,"viewDirection",void 0),ew=el([(0,z.EM)("w3m-header")],ew),o(21129),o(84042);let eh=(0,M.AH)` 523 :host { 524 display: flex; 525 align-items: center; 526 gap: ${({spacing:e})=>e[1]}; 527 padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]} 528 ${({spacing:e})=>e[2]} ${({spacing:e})=>e[2]}; 529 border-radius: ${({borderRadius:e})=>e[20]}; 530 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 531 box-shadow: 532 0px 0px 8px 0px rgba(0, 0, 0, 0.1), 533 inset 0 0 0 1px ${({tokens:e})=>e.theme.borderPrimary}; 534 max-width: 320px; 535 } 536 537 wui-icon-box { 538 border-radius: ${({borderRadius:e})=>e.round} !important; 539 overflow: hidden; 540 } 541 542 wui-loading-spinner { 543 padding: ${({spacing:e})=>e[1]}; 544 background-color: ${({tokens:e})=>e.core.foregroundAccent010}; 545 border-radius: ${({borderRadius:e})=>e.round} !important; 546 } 547`;var em=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let eg=class extends i.WF{constructor(){super(...arguments),this.message="",this.variant="success"}render(){return(0,i.qy)` 548 ${this.templateIcon()} 549 <wui-text variant="lg-regular" color="primary" data-testid="wui-snackbar-message" 550 >${this.message}</wui-text 551 > 552 `}templateIcon(){return"loading"===this.variant?(0,i.qy)`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:(0,i.qy)`<wui-icon-box 553 size="md" 554 color=${({success:"success",error:"error",warning:"warning",info:"default"})[this.variant]} 555 icon=${({success:"checkmark",error:"warning",warning:"warningCircle",info:"info"})[this.variant]} 556 ></wui-icon-box>`}};eg.styles=[F.W5,eh],em([(0,a.MZ)()],eg.prototype,"message",void 0),em([(0,a.MZ)()],eg.prototype,"variant",void 0),eg=em([(0,B.E)("wui-snackbar")],eg);let ey=(0,i.AH)` 557 :host { 558 display: block; 559 position: absolute; 560 opacity: 0; 561 pointer-events: none; 562 top: 11px; 563 left: 50%; 564 width: max-content; 565 } 566`;var ef=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let ev=class extends i.WF{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=f.P.state.open,this.unsubscribe.push(f.P.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e
566=>e())}render(){let{message:e,variant:t}=f.P.state;return(0,i.qy)` <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),f.P.state.autoClose&&(this.timeout=setTimeout(()=>f.P.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"})}};ev.styles=ey,ef([(0,a.wk)()],ev.prototype,"open",void 0),ev=ef([(0,z.EM)("w3m-snackbar")],ev);let eb=(0,b.BX)({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),ek=(0,I.X)({state:eb,subscribe:e=>(0,b.B1)(eb,()=>e(eb)),subscribeKey:(e,t)=>(0,k.u$)(eb,e,t),showTooltip({message:e,triggerRect:t,variant:o}){eb.open=!0,eb.message=e,eb.triggerRect=t,eb.variant=o},hide(){eb.open=!1,eb.message="",eb.triggerRect={width:0,height:0,top:0,left:0}}});o(77237);let ex=(0,z.AH)` 567 :host { 568 pointer-events: none; 569 } 570 571 :host > wui-flex { 572 display: var(--w3m-tooltip-display); 573 opacity: var(--w3m-tooltip-opacity); 574 padding: 9px ${({spacing:e})=>e["3"]} 10px ${({spacing:e})=>e["3"]}; 575 border-radius: ${({borderRadius:e})=>e["3"]}; 576 color: ${({tokens:e})=>e.theme.backgroundPrimary}; 577 position: absolute; 578 top: var(--w3m-tooltip-top); 579 left: var(--w3m-tooltip-left); 580 transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px)); 581 max-width: calc(var(--apkt-modal-width) - ${({spacing:e})=>e["5"]}); 582 transition: opacity ${({durations:e})=>e.lg} 583 ${({easings:e})=>e["ease-out-power-2"]}; 584 will-change: opacity; 585 opacity: 0; 586 animation-duration: ${({durations:e})=>e.xl}; 587 animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]}; 588 animation-name: fade-in; 589 animation-fill-mode: forwards; 590 } 591 592 :host([data-variant='shade']) > wui-flex { 593 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 594 } 595 596 :host([data-variant='shade']) > wui-flex > wui-text { 597 color: ${({tokens:e})=>e.theme.textSecondary}; 598 } 599 600 :host([data-variant='fill']) > wui-flex { 601 background-color: ${({tokens:e})=>e.theme.textPrimary}; 602 border: none; 603 } 604 605 wui-icon { 606 position: absolute; 607 width: 12px !important; 608 height: 4px !important; 609 color: ${({tokens:e})=>e.theme.foregroundPrimary}; 610 } 611 612 wui-icon[data-placement='top'] { 613 bottom: 0px; 614 left: 50%; 615 transform: translate(-50%, 95%); 616 } 617 618 wui-icon[data-placement='bottom'] { 619 top: 0; 620 left: 50%; 621 transform: translate(-50%, -95%) rotate(180deg); 622 } 623 624 wui-icon[data-placement='right'] { 625 top: 50%; 626 left: 0; 627 transform: translate(-65%, -50%) rotate(90deg); 628 } 629 630 wui-icon[data-placement='left'] { 631 top: 50%; 632 right: 0%; 633 transform: translate(65%, -50%) rotate(270deg); 634 } 635 636 @keyframes fade-in { 637 from { 638 opacity: 0; 639 } 640 to { 641 opacity: 1; 642 } 643 } 644`;var eT=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let eS=class extends i.WF{constructor(){super(),this.unsubscribe=[],this.open=ek.state.open,this.message=ek.state.message,this.triggerRect=ek.state.triggerRect,this.variant=ek.state.variant,this.unsubscribe.push(ek.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;let e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=` 645 --w3m-tooltip-top: ${e}px; 646 --w3m-tooltip-left: ${t}px; 647 --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px; 648 --w3m-tooltip-display: ${this.open?"flex":"none"}; 649 --w3m-tooltip-opacity: ${+!!this.open}; 650 `,(0,i.qy)`<wui-flex> 651 <wui-icon data-placement="top" size="inherit" name="cursor"></wui-icon> 652 <wui-text color="primary" variant="sm-regular">${this.message}</wui-text> 653 </wui-flex>`}};eS.styles=[ex],eT([(0,a.wk)()],eS.prototype,"open",void 0),eT([(0,a.wk)()],eS.prototype,"message",void 0),eT([(0,a.wk)()],eS.prototype,"triggerRect",void 0),eT([(0,a.wk)()],eS.prototype,"variant",void 0),eS=eT([(0,z.EM)("w3m-tooltip")],eS);let eP={getTabsByNamespace:e=>e&&e===s.o.CHAIN.EVM?c.H.state.remoteFeatures?.activity===!1?es.o.ACCOUNT_TABS.filter(e=>"Activity"!==e.label):es.o.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=w.I.state.view;if(es.o.VIEWS_WITH_LEGAL_FOOTER.includes(e)){let{termsConditionsUrl:e,privacyPolicyUrl:t}=c.H.state,o=c.H.state.features?.legalCheckbox;return(!!e||!!t)&&!o}return es.o.VIEWS_WITH_DEFAULT_FOOTER.includes(e)}};o(55877);let eC=(0,z.AH)` 654 :host wui-ux-by-reown { 655 padding-top: 0; 656 } 657 658 :host wui-ux-by-reown.branding-only { 659 padding-top: ${({spacing:e})=>e["3"]}; 660 } 661 662 a { 663 text-decoration: none; 664 color: ${({tokens:e})=>e.core.textAccentPrimary}; 665 font-weight: 500; 666 } 667`;var eA=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let e$=class extends i.WF{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=c.H.state.remoteFeatures,this.unsubscribe.push(c.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}
667disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=c.H.state,o=c.H.state.features?.legalCheckbox;return(e||t)&&!o?(0,i.qy)` 668 <wui-flex flexDirection="column"> 669 <wui-flex .padding=${["4","3","3","3"]} justifyContent="center"> 670 <wui-text color="secondary" variant="md-regular" align="center"> 671 By connecting your wallet, you agree to our <br /> 672 ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()} 673 </wui-text> 674 </wui-flex> 675 ${this.reownBrandingTemplate()} 676 </wui-flex> 677 `:(0,i.qy)` 678 <wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex> 679 `}andTemplate(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=c.H.state;return e&&t?"and":""}termsTemplate(){let{termsConditionsUrl:e}=c.H.state;return e?(0,i.qy)`<a href=${e} target="_blank" rel="noopener noreferrer" 680 >Terms of Service</a 681 >`:null}privacyTemplate(){let{privacyPolicyUrl:e}=c.H.state;return e?(0,i.qy)`<a href=${e} target="_blank" rel="noopener noreferrer" 682 >Privacy Policy</a 683 >`:null}reownBrandingTemplate(e=!1){return this.remoteFeatures?.reownBranding?e?(0,i.qy)`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:(0,i.qy)`<wui-ux-by-reown></wui-ux-by-reown>`:null}};e$.styles=[eC],eA([(0,a.wk)()],e$.prototype,"remoteFeatures",void 0),e$=eA([(0,z.EM)("w3m-legal-footer")],e$),o(48352);let eI=(0,i.AH)``,eW=class extends i.WF{render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=c.H.state;return e||t?(0,i.qy)` 684 <wui-flex 685 .padding=${["4","3","3","3"]} 686 flexDirection="column" 687 alignItems="center" 688 justifyContent="center" 689 gap="3" 690 > 691 <wui-text color="secondary" variant="md-regular" align="center"> 692 We work with the best providers to give you the lowest fees and best support. More options 693 coming soon! 694 </wui-text> 695 696 ${this.howDoesItWorkTemplate()} 697 </wui-flex> 698 `:null}howDoesItWorkTemplate(){return(0,i.qy)` <wui-link @click=${this.onWhatIsBuy.bind(this)}> 699 <wui-icon size="xs" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon> 700 How does it work? 701 </wui-link>`}onWhatIsBuy(){N.E.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:(0,P.lj)(d.W.state.activeChain)===T.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),w.I.push("WhatIsABuy")}};eW.styles=[eI],eW=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n}([(0,z.EM)("w3m-onramp-providers-footer")],eW);let eE=(0,z.AH)` 702 :host { 703 display: block; 704 } 705 706 div.container { 707 position: absolute; 708 bottom: 0; 709 left: 0; 710 right: 0; 711 overflow: hidden; 712 height: auto; 713 display: block; 714 } 715 716 div.container[status='hide'] { 717 animation: fade-out; 718 animation-duration: var(--apkt-duration-dynamic); 719 animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]}; 720 animation-fill-mode: both; 721 animation-delay: 0s; 722 } 723 724 div.container[status='show'] { 725 animation: fade-in; 726 animation-duration: var(--apkt-duration-dynamic); 727 animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]}; 728 animation-fill-mode: both; 729 animation-delay: var(--apkt-duration-dynamic); 730 } 731 732 @keyframes fade-in { 733 from { 734 opacity: 0; 735 filter: blur(6px); 736 } 737 to { 738 opacity: 1; 739 filter: blur(0px); 740 } 741 } 742 743 @keyframes fade-out { 744 from { 745 opacity: 1; 746 filter: blur(0px); 747 } 748 to { 749 opacity: 0; 750 filter: blur(6px); 751 } 752 } 753`;var eN=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let eR=class extends i.WF{constructor(){super(...arguments),this.resizeObserver=void 0,this.unsubscribe=[],this.status="hide",this.view=w.I.state.view}firstUpdated(){this.status=eP.hasFooter()?"show":"hide",this.unsubscribe.push(w.I.subscribeKey("view",e=>{this.view=e,this.status=eP.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.qy)` 754 <div class="container" status=${this.status}>${this.templatePageContainer()}</div> 755 `}templatePageContainer(){return eP.hasFooter()?(0,i.qy)` ${this.templateFooter()}`:null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return(0,i.qy)`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return(0,i.qy)`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return(0,i.qy)` <wui-flex 756 class="footer-in" 757 padding="3" 758 flexDirection="column" 759 gap="3" 760 alignItems="center" 761 > 762 <wui-text variant="md-regular" color="secondary" align="center"> 763 Your connected wallet may not support some of the networks available for this dApp 764 </wui-text> 765 <wui-link @click=${this.onNetworkHelp.bind(this)}> 766 <wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon> 767 What is a network 768 </wui-link> 769 </wui-flex>`}onNetworkHelp(){N.E.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),w.I.push("WhatIsANetwork")}getWrapper(){return this.shadowRoot?.querySelector("div.container")}};eR.styles=[eE],eN([(0,a.wk)()],eR.prototype,"status",void 0),eN([(0,a.wk)()],eR.prototype,"view",void 0),eR=eN([(0,z.EM)("w3m-footer")],eR);let eO=(0,z.AH)` 770 :host { 771 display: block; 772 width: inherit; 773 } 774`;var eD=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let eq=class extends i.WF{constructor(){super(),this.unsubscribe=[],this.viewState=w.I.state.view,this.history=w.I.state.history.join(","),this.unsubscribe.push(w.I.subscribeKey("view",()=>{this.history=w.I.state.history.join(","),document.documentElement.style.setProperty("--apkt-duration-dynamic","var(--apkt-durations-lg)")}))}
774disconnectedCallback(){this.unsubscribe.forEach(e=>e()),document.documentElement.style.setProperty("--apkt-duration-dynamic","0s")}render(){return(0,i.qy)`${this.templatePageContainer()}`}templatePageContainer(){return(0,i.qy)`<w3m-router-container 775 history=${this.history} 776 .setView=${()=>{this.viewState=w.I.state.view}} 777 > 778 ${this.viewTemplate(this.viewState)} 779 </w3m-router-container>`}viewTemplate(e){switch(e){case"AccountSettings":return(0,i.qy)`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return(0,i.qy)`<w3m-account-view></w3m-account-view>`;case"AllWallets":return(0,i.qy)`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return(0,i.qy)`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return(0,i.qy)`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return(0,i.qy)`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":default:return(0,i.qy)`<w3m-connect-view></w3m-connect-view>`;case"Create":return(0,i.qy)`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return(0,i.qy)`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return(0,i.qy)`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return(0,i.qy)`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return(0,i.qy)`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return(0,i.qy)`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return(0,i.qy)`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return(0,i.qy)`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return(0,i.qy)`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return(0,i.qy)`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return(0,i.qy)`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return(0,i.qy)`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return(0,i.qy)`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return(0,i.qy)`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return(0,i.qy)`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return(0,i.qy)`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return(0,i.qy)`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return(0,i.qy)`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return(0,i.qy)`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return(0,i.qy)`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return(0,i.qy)`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return(0,i.qy)`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return(0,i.qy)`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return(0,i.qy)`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return(0,i.qy)`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return(0,i.qy)`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return(0,i.qy)`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return(0,i.qy)`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return(0,i.qy)`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return(0,i.qy)`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return(0,i.qy)`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return(0,i.qy)`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return(0,i.qy)`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return(0,i.qy)`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return(0,i.qy)`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return(0,i.qy)`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return(0,i.qy)`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return(0,i.qy)`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return(0,i.qy)`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return(0,i.qy)`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return(0,i.qy)`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return(0,i.qy)`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return(0,i.qy)`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return(0,i.qy)`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return(0,i.qy)`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return(0,i.qy)`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return(0,i.qy)`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return(0,i.qy)`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return(0,i.qy)`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"FundWallet":return(0,i.qy)`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return(0,i.qy)`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return(0,i.qy)`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`}}};eq.styles=[eO],eD([(0,a.wk)()],eq.prototype,"viewState",void 0),eD([(0,a.wk)()],eq.prototype,"history",void 0),eq=eD([(0,z.EM)("w3m-router")],eq);let ez=(0,z.AH)` 780 :host { 781 z-index: ${({tokens:e})=>e.core.zIndex}; 782 display: block; 783 backface-visibility: hidden; 784 will-change: opacity; 785 position: fixed; 786 top: 0; 787 left: 0; 788 right: 0; 789 bottom: 0; 790 pointer-events: none; 791 opacity: 0; 792 background-color: ${({tokens:e})=>e.theme.overlay}; 793 backdrop-filter: blur(0px); 794 transition: 795 opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 796 backdrop-filter ${({durations:e})=>e.lg} 797 ${({easings:e})=>e["ease-out-power-2"]}; 798 will-change: opacity; 799 } 800 801 :host(.open) { 802 opacity: 1; 803 backdrop-filter: blur(8px); 804 } 805 806 :host(.appkit-modal) { 807 position: relative; 808 pointer-events: unset; 809 background: none; 810 width: 100%; 811 opacity: 1; 812 } 813 814 wui-card { 815 max-width: var(--apkt-modal-width); 816 width: 100%; 817 position: relative; 818 outline: none; 819 transform: translateY(4px); 820 box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.05); 821 transition: 822 transform ${({durations:e})=>e.lg} 823 ${({easings:e})=>e["ease-out-power-2"]}, 824 border-radius ${({durations:e})=>e.lg} 825 ${({easings:e})=>e["ease-out-power-1"]}, 826 background-color ${({durations:e})=>e.lg} 827 ${({easings:e})=>e["ease-out-power-1"]}, 828 box-shadow ${({durations:e})=>e.lg} 829 ${({easings:e})=>e["ease-out-power-1"]}; 830 will-change: border-radius, background-color, transform, box-shadow; 831 background-color: ${({tokens:e})=>e.theme.backgroundPrimary}; 832 padding: var(--local-modal-padding); 833 box-sizing: border-box; 834 } 835 836 :host(.open) wui-card { 837 transform: translateY(0px); 838 } 839 840 wui-card::before { 841 z-index: 1; 842 pointer-events: none; 843 content: ''; 844 position: absolute; 845 inset: 0; 846 border-radius: clamp(0px, var(--apkt-borderRadius-8), 44px); 847 transition: box-shadow ${({durations:e})=>e.lg} 848 ${({easings:e})=>e["ease-out-power-2"]}; 849 transition-delay: ${({durations:e})=>e.md}; 850 will-change: box-shadow; 851 } 852 853 :host([data-mobile-fullscreen='true']) wui-card::before { 854 border-radius: 0px; 855 } 856 857 :host([data-border='true']) wui-card::before { 858 box-shadow: inset 0px 0px 0px 4px ${({tokens:e})=>e.theme.foregroundSecondary}; 859 } 860 861 :host([data-border='false']) wui-card::before { 862 box-shadow: inset 0px 0px 0px 1px ${({tokens:e})=>e.theme.borderPrimaryDark}; 863 } 864 865 :host([data-border='true']) wui-card { 866 animation: 867 fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 868 card-background-border var(--apkt-duration-dynamic) 869 ${({easings:e})=>e["ease-out-power-2"]}; 870 animation-fill-mode: backwards, both; 871 animation-delay: var(--apkt-duration-dynamic); 872 } 873 874 :host([data-border='false']) wui-card { 875 animation: 876 fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 877 card-background-default var(--apkt-duration-dynamic) 878 ${({easings:e})=>e["ease-out-power-2"]}; 879 animation-fill-mode: backwards, both; 880 animation-delay: 0s; 881 } 882 883 :host(.appkit-modal) wui-card { 884 max-width: var(--apkt-modal-width); 885 } 886 887 wui-card[shake='true'] { 888 animation: 889 fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 890 w3m-shake ${({durations:e})=>e.xl} 891 ${({easings:e})=>e["ease-out-power-2"]}; 892 } 893 894 wui-flex { 895 overflow-x: hidden; 896 overflow-y: auto; 897 display: flex; 898 align-items: center; 899 justify-content: center; 900 width: 100%; 901 height: 100%; 902 } 903 904 @media (max-height: 700px) and (min-width: 431px) { 905 wui-flex { 906 align-items: flex-start; 907 } 908 909 wui-card { 910 margin: var(--apkt-spacing-6) 0px; 911 } 912 } 913 914 @media (max-width: 430px) { 915 :host([data-mobile-fullscreen='true']) { 916 height: 100dvh; 917 } 918 :host([data-mobile-fullscreen='true']) wui-flex { 919 align-items: stretch; 920 } 921 :host([data-mobile-fullscreen='true']) wui-card { 922 max-width: 100%; 923 height: 100%; 924 border-radius: 0; 925 border: none; 926 } 927 :host(:not([data-mobile-fullscreen='true'])) wui-flex { 928 align-items: flex-end; 929 } 930 931 :host(:not([data-mobile-fullscreen='true'])) wui-card { 932 max-width: 100%; 933 border-bottom: none; 934 } 935 936 :host(:not([data-mobile-fullscreen='true'])) wui-card[data-embedded='true'] { 937 border-bottom-left-radius: clamp(0px, var(--apkt-borderRadius-8), 44px); 938 border-bottom-right-radius: clamp(0px, var(--apkt-borderRadius-8), 44px); 939 } 940 941 :host(:not([data-mobile-fullscreen='true'])) wui-card:not([data-embedded='true']) { 942 border-bottom-left-radius: 0px; 943 border-bottom-right-radius: 0px; 944 } 945 946 wui-card[shake='true'] { 947 animation: w3m-shake 0.5s ${({easings:e})=>e["ease-out-power-2"]}; 948 } 949 } 950 951 @keyframes fade-in { 952 0% { 953 transform: scale(0.99) translateY(4px); 954 } 955 100% { 956 transform: scale(1) translateY(0); 957 } 958 } 959 960 @keyframes w3m-shake { 961 0% { 962 transform: scale(1) rotate(0deg); 963 } 964 20% { 965 transform: scale(1) rotate(-1deg); 966 } 967 40% { 968 transform: scale(1) rotate(1.5deg); 969 } 970 60% { 971 transform: scale(1) rotate(-1.5deg); 972 } 973 80% { 974 transform: scale(1) rotate(1deg); 975 } 976 100% { 977 transform: scale(1) rotate(0deg); 978 } 979 } 980 981 @keyframes card-background-border { 982 from { 983 background-color: ${({tokens:e})=>e.theme.backgroundPrimary}; 984 } 985 to { 986 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 987 } 988 } 989 990 @keyframes card-background-default { 991 from { 992 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 993 } 994 to { 995 background-color: ${({tokens:e})=>e.theme.backgroundPrimary}; 996 } 997 } 998`;var eF=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let eB="scroll-lock",eM={PayWithExchange:"0",PayWithExchangeSelectAsset:"0"};class eH extends i.WF{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.hasPrefetched=!1,this.enableEmbedded=c.H.state.enableEmbedded,this.open=l.W.state.open,this.caipAddress=d.W.state.activeCaipAddress,this.caipNetwork=d.W.state.activeCaipNetwork,this.shake=l.W.state.shake,this.filterByNamespace=u.a.state.filterByNamespace,this.padding=z.f.spacing[1],this.mobileFullScreen=c.H.state.enableMobileFullScreen,this.initializeTheming(),p.N.prefetchAnalyticsConfig(),this.unsubscribe.push(l.W.subscribeKey("open",e=>e?this.onOpen():this.onClose()),l.W.subscribeKey("shake",e=>this.shake=e),d.W.subscribeKey("activeCaipNetwork",e=>this.onNewNetwork(e)),d.W.subscribeKey("activeCaipAddress",e=>this.onNewAddress(e)),c.H.subscribeKey("enableEmbedded",e=>this.enableEmbedded=e),u.a.subscribeKey("filterByNamespace",e=>{this.filterByNamespace===e||d.W.getAccountData(e)?.caipAddress||(p.N.fetchRecommendedWallets(),this.filterByNamespace=e)}),w.I.subscribeKey("view",()=>{this.dataset.border=eP.hasFooter()?"true":"false",this.padding=eM[w.I.state.view]??z.f.spacing[1]}))}firstUpdated(){if(this.dataset.border=eP.hasFooter()?"true":"false",this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.caipAddress){if(this.enableEmbedded){l.W.close(),this.prefetch();return}this.onNewAddress(this.caipAddress)}this.open&&this.onOpen(),this.enableEmbedded&&this.prefetch()}
998disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return(this.style.setProperty("--local-modal-padding",this.padding),this.enableEmbedded)?(0,i.qy)`${this.contentTemplate()} 999 <w3m-tooltip></w3m-tooltip> `:this.open?(0,i.qy)` 1000 <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay"> 1001 ${this.contentTemplate()} 1002 </wui-flex> 1003 <w3m-tooltip></w3m-tooltip> 1004 `:null}contentTemplate(){return(0,i.qy)` <wui-card 1005 shake="${this.shake}" 1006 data-embedded="${(0,r.J)(this.enableEmbedded)}" 1007 role="alertdialog" 1008 aria-modal="true" 1009 tabindex="0" 1010 data-testid="w3m-modal-card" 1011 > 1012 <w3m-header></w3m-header> 1013 <w3m-router></w3m-router> 1014 <w3m-footer></w3m-footer> 1015 <w3m-snackbar></w3m-snackbar> 1016 <w3m-alertbar></w3m-alertbar> 1017 </wui-card>`}async onOverlayClick(e){e.target===e.currentTarget&&(this.mobileFullScreen||await this.handleClose())}async handleClose(){await g.safeClose()}initializeTheming(){let{themeVariables:e,themeMode:t}=y.W.state,o=z.Zv.getColorTheme(t);(0,z.RF)(e,o)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),f.P.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){let e=document.createElement("style");e.dataset.w3m=eB,e.textContent=` 1018 body { 1019 touch-action: none; 1020 overflow: hidden; 1021 overscroll-behavior: contain; 1022 } 1023 w3m-modal { 1024 pointer-events: auto; 1025 } 1026 `,document.head.appendChild(e)}onScrollUnlock(){let e=document.head.querySelector(`style[data-w3m="${eB}"]`);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=d.W.state.isSwitchingNamespace,o="ProfileWallets"===w.I.state.view;e?await this.onConnected({caipAddress:e,isSwitchingNamespace:t,isInProfileView:o}):t||this.enableEmbedded||o||l.W.close(),await m.U.initializeIfEnabled(e),this.caipAddress=e,d.W.setIsSwitchingNamespace(!1)}async onConnected(e){if(e.isInProfileView)return;let{chainNamespace:t,chainId:o,address:i}=n.C.parseCaipAddress(e.caipAddress),a=`${t}:${o}`,r=!v.w.getPlainAddress(this.caipAddress),s=await m.U.getSessions({address:i,caipNetworkId:a}),c=!m.U.getSIWX()||s.some(e=>e.data.accountAddress===i),d=e.isSwitchingNamespace&&c&&!this.enableEmbedded,u=this.enableEmbedded&&r;d?w.I.goBack():u&&l.W.close()}onNewNetwork(e){let t=this.caipNetwork,o=t?.caipNetworkId?.toString(),i=t?.chainNamespace,a=e?.caipNetworkId?.toString(),r=e?.chainNamespace,n=o!==a,c=t?.name===s.o.UNSUPPORTED_NETWORK_NAME,u="ConnectingExternal"===w.I.state.view,p="ProfileWallets"===w.I.state.view,h=!d.W.getAccountData(e?.chainNamespace)?.caipAddress,m="UnsupportedChain"===w.I.state.view,g=l.W.state.open,y=!1;this.enableEmbedded&&"SwitchNetwork"===w.I.state.view&&(y=!0),n&&q.resetState(),g&&!u&&!p&&(h?n&&(y=!0):m?y=!0:n&&i===r&&!c&&(y=!0)),y&&"SIWXSignMessage"!==w.I.state.view&&w.I.goBack(),this.caipNetwork=e}prefetch(){this.hasPrefetched||(p.N.prefetch(),p.N.fetchWalletsByPage({page:1}),this.hasPrefetched=!0)}}eH.styles=ez,eF([(0,a.MZ)({type:Boolean})],eH.prototype,"enableEmbedded",void 0),eF([(0,a.wk)()],eH.prototype,"open",void 0),eF([(0,a.wk)()],eH.prototype,"caipAddress",void 0),eF([(0,a.wk)()],eH.prototype,"caipNetwork",void 0),eF([(0,a.wk)()],eH.prototype,"shake",void 0),eF([(0,a.wk)()],eH.prototype,"filterByNamespace",void 0),eF([(0,a.wk)()],eH.prototype,"padding",void 0),eF([(0,a.wk)()],eH.prototype,"mobileFullScreen",void 0);let eU=class extends eH{};eU=eF([(0,z.EM)("w3m-modal")],eU);let ej=class extends eH{};ej=eF([(0,z.EM)("appkit-modal")],ej),o(78790);let eL=(0,z.AH)` 1027 :host { 1028 width: 100%; 1029 } 1030`;var eV=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let e_=class extends i.WF{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}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=>
1030{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.E.sendWalletImpressionEvent({name:this.name,walletRank:this.walletRank,rdnsId:this.rdnsId,view:w.I.state.view,displayIndex:this.displayIndex}))}render(){return(0,i.qy)` 1031 <wui-list-wallet 1032 .walletImages=${this.walletImages} 1033 imageSrc=${(0,r.J)(this.imageSrc)} 1034 name=${this.name} 1035 size=${(0,r.J)(this.size)} 1036 tagLabel=${(0,r.J)(this.tagLabel)} 1037 .tagVariant=${this.tagVariant} 1038 .walletIcon=${this.walletIcon} 1039 .tabIdx=${this.tabIdx} 1040 .disabled=${this.disabled} 1041 .showAllWallets=${this.showAllWallets} 1042 .loading=${this.loading} 1043 loadingSpinnerColor=${this.loadingSpinnerColor} 1044 ></wui-list-wallet> 1045 `}};e_.styles=eL,eV([(0,a.MZ)({type:Array})],e_.prototype,"walletImages",void 0),eV([(0,a.MZ)()],e_.prototype,"imageSrc",void 0),eV([(0,a.MZ)()],e_.prototype,"name",void 0),eV([(0,a.MZ)()],e_.prototype,"size",void 0),eV([(0,a.MZ)()],e_.prototype,"tagLabel",void 0),eV([(0,a.MZ)()],e_.prototype,"tagVariant",void 0),eV([(0,a.MZ)()],e_.prototype,"walletIcon",void 0),eV([(0,a.MZ)()],e_.prototype,"tabIdx",void 0),eV([(0,a.MZ)({type:Boolean})],e_.prototype,"disabled",void 0),eV([(0,a.MZ)({type:Boolean})],e_.prototype,"showAllWallets",void 0),eV([(0,a.MZ)({type:Boolean})],e_.prototype,"loading",void 0),eV([(0,a.MZ)({type:String})],e_.prototype,"loadingSpinnerColor",void 0),eV([(0,a.MZ)()],e_.prototype,"rdnsId",void 0),eV([(0,a.MZ)()],e_.prototype,"displayIndex",void 0),eV([(0,a.MZ)()],e_.prototype,"walletRank",void 0),e_=eV([(0,z.EM)("w3m-list-wallet")],e_);let eZ=(0,z.AH)` 1046 :host { 1047 --local-duration-height: 0s; 1048 --local-duration: ${({durations:e})=>e.lg}; 1049 --local-transition: ${({easings:e})=>e["ease-out-power-2"]}; 1050 } 1051 1052 .container { 1053 display: block; 1054 overflow: hidden; 1055 overflow: hidden; 1056 position: relative; 1057 height: var(--local-container-height); 1058 transition: height var(--local-duration-height) var(--local-transition); 1059 will-change: height, padding-bottom; 1060 } 1061 1062 .container[data-mobile-fullscreen='true'] { 1063 overflow: scroll; 1064 } 1065 1066 .page { 1067 position: absolute; 1068 top: 0; 1069 left: 0; 1070 right: 0; 1071 width: 100%; 1072 height: auto; 1073 width: inherit; 1074 box-sizing: border-box; 1075 display: flex; 1076 flex-direction: column; 1077 background-color: ${({tokens:e})=>e.theme.backgroundPrimary}; 1078 border-bottom-left-radius: var(--local-border-bottom-radius); 1079 border-bottom-right-radius: var(--local-border-bottom-radius); 1080 transition: border-bottom-left-radius var(--local-duration) var(--local-transition); 1081 } 1082 1083 .page[data-mobile-fullscreen='true'] { 1084 height: 100%; 1085 } 1086 1087 .page-content { 1088 display: flex; 1089 flex-direction: column; 1090 min-height: 100%; 1091 } 1092 1093 .footer { 1094 height: var(--apkt-footer-height); 1095 } 1096 1097 div.page[view-direction^='prev-'] .page-content { 1098 animation: 1099 slide-left-out var(--local-duration) forwards var(--local-transition), 1100 slide-left-in var(--local-duration) forwards var(--local-transition); 1101 animation-delay: 0ms, var(--local-duration, ${({durations:e})=>e.lg}); 1102 } 1103 1104 div.page[view-direction^='next-'] .page-content { 1105 animation: 1106 slide-right-out var(--local-duration) forwards var(--local-transition), 1107 slide-right-in var(--local-duration) forwards var(--local-transition); 1108 animation-delay: 0ms, var(--local-duration, ${({durations:e})=>e.lg}); 1109 } 1110 1111 @keyframes slide-left-out { 1112 from { 1113 transform: translateX(0px) scale(1); 1114 opacity: 1; 1115 filter: blur(0px); 1116 } 1117 to { 1118 transform: translateX(8px) scale(0.99); 1119 opacity: 0; 1120 filter: blur(4px); 1121 } 1122 } 1123 1124 @keyframes slide-left-in { 1125 from { 1126 transform: translateX(-8px) scale(0.99); 1127 opacity: 0; 1128 filter: blur(4px); 1129 } 1130 to { 1131 transform: translateX(0) translateY(0) scale(1); 1132 opacity: 1; 1133 filter: blur(0px); 1134 } 1135 } 1136 1137 @keyframes slide-right-out { 1138 from { 1139 transform: translateX(0px) scale(1); 1140 opacity: 1; 1141 filter: blur(0px); 1142 } 1143 to { 1144 transform: translateX(-8px) scale(0.99); 1145 opacity: 0; 1146 filter: blur(4px); 1147 } 1148 } 1149 1150 @keyframes slide-right-in { 1151 from { 1152 transform: translateX(8px) scale(0.99); 1153 opacity: 0; 1154 filter: blur(4px); 1155 } 1156 to { 1157 transform: translateX(0) translateY(0) scale(1); 1158 opacity: 1; 1159 filter: blur(0px); 1160 } 1161 } 1162`;var eK=function(e,t,o,i){var a,r=arguments.length,n=r<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--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,o,n):a(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};let eG=class extends i.WF{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=c.H.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");
1162this.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.qy)` 1163 <div class="container" data-mobile-fullscreen="${(0,r.J)(this.mobileFullScreen)}"> 1164 <div 1165 class="page" 1166 data-mobile-fullscreen="${(0,r.J)(this.mobileFullScreen)}" 1167 view-direction="${this.viewDirection}" 1168 > 1169 <div class="page-content"> 1170 <slot></slot> 1171 </div> 1172 </div> 1173 </div> 1174 `}onViewChange(e){let t=e.split(",").filter(Boolean),o=this.historyState.split(",").filter(Boolean),i=o.length,a=t.length,r=t[t.length-1]||"",n=z.Zv.cssDurationToNumber(this.transitionDuration),s="";a>i?s="next":a<i?s="prev":a===i&&t[a-1]!==o[i-1]&&(s="next"),this.viewDirection=`${s}-${r}`,setTimeout(()=>{this.historyState=e,this.setView?.(r)},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}};eG.styles=[eZ],eK([(0,a.MZ)({type:String})],eG.prototype,"transitionDuration",void 0),eK([(0,a.MZ)({type:String})],eG.prototype,"transitionFunction",void 0),eK([(0,a.MZ)({type:String})],eG.prototype,"history",void 0),eK([(0,a.MZ)({type:String})],eG.prototype,"view",void 0),eK([(0,a.MZ)({attribute:!1})],eG.prototype,"setView",void 0),eK([(0,a.wk)()],eG.prototype,"viewDirection",void 0),eK([(0,a.wk)()],eG.prototype,"historyState",void 0),eK([(0,a.wk)()],eG.prototype,"previousHeight",void 0),eK([(0,a.wk)()],eG.prototype,"mobileFullScreen",void 0),eG=eK([(0,z.EM)("w3m-router-container")],eG)}}]);
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.