1import{i as pe,p as me,s as he,j as ve,M as g,S as ee,R as l,k as v,l as E,m as f,x as a,A as j,n as te,o as ie,C as m,q as H,u as fe,v as k,E as q,O as T,y as M,z as F,B as $,D,T as ge,F as be,G as ye,I as xe}from"./core-DAMXu4d2.js";import{c as u,n as d,r as w,o as V,U as Ce}from"./index-BIt6o_gw.js";import"./index-BH-aDHIo.js";import"./index.es-JxxiwQc7.js";import"./events-DQ172AOg.js";import"./index-nibyPLVP.js";const p=me({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),ke={state:p,subscribe(r){return ve(p,()=>r(p))},subscribeKey(r,e){return he(p,r,e)},showTooltip({message:r,triggerRect:e,variant:t}){p.open=!0,p.message=r,p.triggerRect=e,p.variant=t},hide(){p.open=!1,p.message="",p.triggerRect={width:0,height:0,top:0,left:0}}},A=pe(ke),oe={isUnsupportedChainView(){return l.state.view==="UnsupportedChain"||l.state.view==="SwitchNetwork"&&l.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){g.shake();return}if(await ee.isSIWXCloseDisabled()){g.shake();return}g.close()}},Se=v` 2 :host { 3 display: block; 4 border-radius: clamp(0px, var(--wui-border-radius-l), 44px); 5 box-shadow: 0 0 0 1px var(--wui-color-gray-glass-005); 6 background-color: var(--wui-color-modal-bg); 7 overflow: hidden; 8 } 9 10 :host([data-embedded='true']) { 11 box-shadow: 12 0 0 0 1px var(--wui-color-gray-glass-005), 13 0px 4px 12px 4px var(--w3m-card-embedded-shadow-color); 14 } 15`;var Ne=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};let X=class extends f{render(){return a`<slot></slot>`}};X.styles=[E,Se];X=Ne([u("wui-card")],X);const We=v` 16 :host { 17 display: flex; 18 align-items: center; 19 justify-content: center; 20 padding: var(--wui-spacing-s); 21 border-radius: var(--wui-border-radius-s); 22 border: 1px solid var(--wui-color-dark-glass-100); 23 box-sizing: border-box; 24 background-color: var(--wui-color-bg-325); 25 box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25); 26 } 27 28 wui-flex { 29 width: 100%; 30 } 31 32 wui-text { 33 word-break: break-word; 34 flex: 1; 35 } 36 37 .close { 38 cursor: pointer; 39 } 40 41 .icon-box { 42 height: 40px; 43 width: 40px; 44 border-radius: var(--wui-border-radius-3xs); 45 background-color: var(--local-icon-bg-value); 46 } 47`;var I=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};let S=class extends f{constructor(){super(...arguments),this.message="",this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="info"}render(){return this.style.cssText=` 48 --local-icon-bg-value: var(--wui-color-${this.backgroundColor}); 49 `,a` 50 <wui-flex flexDirection="row" justifyContent="space-between" alignItems="center"> 51 <wui-flex columnGap="xs" flexDirection="row" alignItems="center"> 52 <wui-flex 53 flexDirection="row" 54 alignItems="center" 55 justifyContent="center" 56 class="icon-box" 57 > 58 <wui-icon color=${this.iconColor} size="md" name=${this.icon}></wui-icon> 59 </wui-flex> 60 <wui-text variant="small-500" color="bg-350" data-testid="wui-alertbar-text" 61 >${this.message}</wui-text 62 > 63 </wui-flex> 64 <wui-icon 65 class="close" 66 color="bg-350" 67 size="sm" 68 name="close" 69 @click=${this.onClose} 70 ></wui-icon> 71 </wui-flex> 72 `}onClose(){j.close()}};S.styles=[E,We];I([d()],S.prototype,"message",void 0);I([d()],S.prototype,"backgroundColor",void 0);I([d()],S.prototype,"iconColor",void 0);I([d()],S.prototype,"icon",void 0);S=I([u("wui-alertbar")],S);const Re=v` 73 :host { 74 display: block; 75 position: absolute; 76 top: var(--wui-spacing-s); 77 left: var(--wui-spacing-l); 78 right: var(--wui-spacing-l); 79 opacity: 0; 80 pointer-events: none; 81 } 82`;var ae=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};const $e={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:"exclamationTriangle"}};let L=class extends f{constructor(){super(),this.unsubscribe=[],this.open=j.state.open,this.onOpen(!0),this.unsubscribe.push(j.subscribeKey("open",e=>{this.open=e,this.onOpen(!1)}))}
82disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:t}=j.state,o=$e[t];return a` 83 <wui-alertbar 84 message=${e} 85 backgroundColor=${o?.backgroundColor} 86 iconColor=${o?.iconColor} 87 icon=${o?.icon} 88 ></wui-alertbar> 89 `}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")}};L.styles=Re;ae([w()],L.prototype,"open",void 0);L=ae([u("w3m-alertbar")],L);const Ae=v` 90 button { 91 border-radius: var(--local-border-radius); 92 color: var(--wui-color-fg-100); 93 padding: var(--local-padding); 94 } 95 96 @media (max-width: 700px) { 97 button { 98 padding: var(--wui-spacing-s); 99 } 100 } 101 102 button > wui-icon { 103 pointer-events: none; 104 } 105 106 button:disabled > wui-icon { 107 color: var(--wui-color-bg-300) !important; 108 } 109 110 button:disabled { 111 background-color: transparent; 112 } 113`;var P=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};let N=class extends f{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="inherit"}render(){const e=this.size==="lg"?"--wui-border-radius-xs":"--wui-border-radius-xxs",t=this.size==="lg"?"--wui-spacing-1xs":"--wui-spacing-2xs";return this.style.cssText=` 114 --local-border-radius: var(${e}); 115 --local-padding: var(${t}); 116`,a` 117 <button ?disabled=${this.disabled}> 118 <wui-icon color=${this.iconColor} size=${this.size} name=${this.icon}></wui-icon> 119 </button> 120 `}};N.styles=[E,te,ie,Ae];P([d()],N.prototype,"size",void 0);P([d({type:Boolean})],N.prototype,"disabled",void 0);P([d()],N.prototype,"icon",void 0);P([d()],N.prototype,"iconColor",void 0);N=P([u("wui-icon-link")],N);const Te=v` 121 button { 122 display: block; 123 display: flex; 124 align-items: center; 125 padding: var(--wui-spacing-xxs); 126 gap: var(--wui-spacing-xxs); 127 transition: all var(--wui-ease-out-power-1) var(--wui-duration-md); 128 border-radius: var(--wui-border-radius-xxs); 129 } 130 131 wui-image { 132 border-radius: 100%; 133 width: var(--wui-spacing-xl); 134 height: var(--wui-spacing-xl); 135 } 136 137 wui-icon-box { 138 width: var(--wui-spacing-xl); 139 height: var(--wui-spacing-xl); 140 } 141 142 button:hover { 143 background-color: var(--wui-color-gray-glass-002); 144 } 145 146 button:active { 147 background-color: var(--wui-color-gray-glass-005); 148 } 149`;var ne=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};let U=class extends f{constructor(){super(...arguments),this.imageSrc=""}render(){return a`<button> 150 ${this.imageTemplate()} 151 <wui-icon size="xs" color="fg-200" name="chevronBottom"></wui-icon> 152 </button>`}imageTemplate(){return this.imageSrc?a`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`:a`<wui-icon-box 153 size="xxs" 154 iconColor="fg-200" 155 backgroundColor="fg-100" 156 background="opaque" 157 icon="networkPlaceholder" 158 ></wui-icon-box>`}};U.styles=[E,te,ie,Te];ne([d()],U.prototype,"imageSrc",void 0);U=ne([u("wui-select")],U);const Oe=v` 159 :host { 160 height: 64px; 161 } 162 163 wui-text { 164 text-transform: capitalize; 165 } 166 167 wui-flex.w3m-header-title { 168 transform: translateY(0); 169 opacity: 1; 170 } 171 172 wui-flex.w3m-header-title[view-direction='prev'] { 173 animation: 174 slide-down-out 120ms forwards var(--wui-ease-out-power-2), 175 slide-down-in 120ms forwards var(--wui-ease-out-power-2); 176 animation-delay: 0ms, 200ms; 177 } 178 179 wui-flex.w3m-header-title[view-direction='next'] { 180 animation: 181 slide-up-out 120ms forwards var(--wui-ease-out-power-2), 182 slide-up-in 120ms forwards var(--wui-ease-out-power-2); 183 animation-delay: 0ms, 200ms; 184 } 185 186 wui-icon-link[data-hidden='true'] { 187 opacity: 0 !important; 188 pointer-events: none; 189 } 190 191 @keyframes slide-up-out { 192 from { 193 transform: translateY(0px); 194 opacity: 1; 195 } 196 to { 197 transform: translateY(3px); 198 opacity: 0; 199 } 200 } 201 202 @keyframes slide-up-in { 203 from { 204 transform: translateY(-3px); 205 opacity: 0; 206 } 207 to { 208 transform: translateY(0); 209 opacity: 1; 210 } 211 } 212 213 @keyframes slide-down-out { 214 from { 215 transform: translateY(0px); 216 opacity: 1; 217 } 218 to { 219 transform: translateY(-3px); 220 opacity: 0; 221 } 222 } 223 224 @keyframes slide-down-in { 225 from { 226 transform: translateY(3px); 227 opacity: 0; 228 } 229 to { 230 transform: translateY(0); 231 opacity: 1; 232 } 233 } 234`;var y=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};const Ee=["SmartSessionList"];function K(){const r=l.state.data?.connector?.name,e=l.state.data?.wallet?.name,t=l.state.data?.network?.name,o=e??r,n=M.getConnectors();return{Connect:`Connect ${n.length===1&&n[0]?.id==="w3m-email"?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExter
234nal:o??"Connect Wallet",ConnectingWalletConnect:o??"WalletConnect",ConnectingWalletConnectBasic:"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview convert",Downloads:o?`Get ${o}`:"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",Profile:void 0,SwitchNetwork:t??"Switch Network",SwitchAddress:"Switch Address",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",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",ConnectWallets:"Connect wallet",ConnectSocials:"All socials",ConnectingSocial:F.state.socialProvider?F.state.socialProvider:"Connect Social",ConnectingMultiChain:"Select chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch chain",SmartSessionCreated:void 0,SmartSessionList:"Smart Sessions",SIWXSignMessage:"Sign In",PayLoading:"Payment in progress"}}let h=class extends f{constructor(){super(),this.unsubscribe=[],this.heading=K()[l.state.view],this.network=m.state.activeCaipNetwork,this.networkImage=H.getNetworkImage(this.network),this.showBack=!1,this.prevHistoryLength=1,this.view=l.state.view,this.viewDirection="",this.headerText=K()[l.state.view],this.unsubscribe.push(fe.subscribeNetworkImages(()=>{this.networkImage=H.getNetworkImage(this.network)}),l.subscribeKey("view",e=>{setTimeout(()=>{this.view=e,this.headerText=K()[e]},k.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),m.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=H.getNetworkImage(this.network)}))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){return a` 235 <wui-flex .padding=${this.getPadding()} justifyContent="space-between" alignItems="center"> 236 ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()} 237 </wui-flex> 238 `}onWalletHelp(){q.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),l.push("WhatIsAWallet")}async onClose(){await oe.safeClose()}rightHeaderTemplate(){const e=T?.state?.features?.smartSessions;return l.state.view!=="Account"||!e?this.closeButtonTemplate():a`<wui-flex> 239 <wui-icon-link 240 icon="clock" 241 @click=${()=>l.push("SmartSessionList")} 242 data-testid="w3m-header-smart-sessions" 243 ></wui-icon-link> 244 ${this.closeButtonTemplate()} 245 </wui-flex> `}closeButtonTemplate(){return a` 246 <wui-icon-link 247 icon="close" 248 @click=${this.onClose.bind(this)} 249 data-testid="w3m-header-close" 250 ></wui-icon-link> 251 `}titleTemplate(){const e=Ee.includes(this.view);return a` 252 <wui-flex 253 view-direction="${this.viewDirection}" 254 class="w3m-header-title" 255 alignItems="center" 256 gap="xs" 257 > 258 <wui-text variant="paragraph-700" color="fg-100" data-testid="w3m-header-text" 259 >${this.headerText}</wui-text 260 > 261 ${e?a`<wui-tag variant="main">Beta</wui-tag>`:null} 262 </wui-flex> 263 `}leftHeaderTemplate(){const{view:e}=l.state,t=e==="Connect",o=T.state.enableEmbedded,n=e==="ApproveTransaction",i=e==="ConnectingSiwe",s=e==="Account",c=T.state.enableNetworkSwitch,G=n||i||t&&o;return s&&c?a`<wui-select 264 id="dynamic" 265 data-testid="w3m-account-select-network" 266 active-network=${V(this.network?.name)} 267 @click=${this.onNetworks.bind(this)} 268 imageSrc=${V(this.networkImage)} 269 ></wui-select>`:this.showBack&&!G?a`<wui-icon-link 270 data-testid="header-back" 271 id="dynamic" 272 icon="chevronLeft" 273 @click=${this.onGoBack.bind(this)} 274 ></wui-icon-link>`:a`<wui-icon-link 275 data-hidden=${!t} 276 id="dynamic" 277 icon="helpCircle" 278 @click=${this.onWalletHelp.bind(this)} 279 ></wui-icon-link>`}onNetworks(){this.isAllowedNetworkSwitch()&&(q.sendEvent({type:"track",event:"CLICK_NETWORKS"}),l.push("Networks"))}isAllowedNetworkSwitch(){const e=m.getAllRequestedCaipNetworks(),t=e?e.length>1:!1,o=e?.find(({id:n})=>n===this.network?.id);return t||!o}getPadding(){return this.heading?["l","2l","l","2l"]:["0","2l","0","2l"]}onViewChange(){const{history:e}=l.state;let t=k.VIEW_DIRECTION.Next;e.length<this.prevHistoryLength&&(t=k.VIEW_DIRECTION.Prev),this.prevHistoryLength=e.length,this.viewDirection=t}async onHistoryChange(){const{history:e}=l.state,t=this.shadowRoot?.querySelector("#dynamic");e.length>1&&!this.showBack&&t?(await t.animate([{opacity:1},{opacity:0}
279],{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(){l.goBack()}};h.styles=Oe;y([w()],h.prototype,"heading",void 0);y([w()],h.prototype,"network",void 0);y([w()],h.prototype,"networkImage",void 0);y([w()],h.prototype,"showBack",void 0);y([w()],h.prototype,"prevHistoryLength",void 0);y([w()],h.prototype,"view",void 0);y([w()],h.prototype,"viewDirection",void 0);y([w()],h.prototype,"headerText",void 0);h=y([u("w3m-header")],h);const Ie=v` 280 :host { 281 display: flex; 282 column-gap: var(--wui-spacing-s); 283 align-items: center; 284 padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs); 285 border-radius: var(--wui-border-radius-s); 286 border: 1px solid var(--wui-color-gray-glass-005); 287 box-sizing: border-box; 288 background-color: var(--wui-color-bg-175); 289 box-shadow: 290 0px 14px 64px -4px rgba(0, 0, 0, 0.15), 291 0px 8px 22px -6px rgba(0, 0, 0, 0.15); 292 293 max-width: 300px; 294 } 295 296 :host wui-loading-spinner { 297 margin-left: var(--wui-spacing-3xs); 298 } 299`;var R=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};let b=class extends f{constructor(){super(...arguments),this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="checkmark",this.message="",this.loading=!1,this.iconType="default"}render(){return a` 300 ${this.templateIcon()} 301 <wui-text variant="paragraph-500" color="fg-100" data-testid="wui-snackbar-message" 302 >${this.message}</wui-text 303 > 304 `}templateIcon(){return this.loading?a`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:this.iconType==="default"?a`<wui-icon size="xl" color=${this.iconColor} name=${this.icon}></wui-icon>`:a`<wui-icon-box 305 size="sm" 306 iconSize="xs" 307 iconColor=${this.iconColor} 308 backgroundColor=${this.backgroundColor} 309 icon=${this.icon} 310 background="opaque" 311 ></wui-icon-box>`}};b.styles=[E,Ie];R([d()],b.prototype,"backgroundColor",void 0);R([d()],b.prototype,"iconColor",void 0);R([d()],b.prototype,"icon",void 0);R([d()],b.prototype,"message",void 0);R([d()],b.prototype,"loading",void 0);R([d()],b.prototype,"iconType",void 0);b=R([u("wui-snackbar")],b);const Pe=v` 312 :host { 313 display: block; 314 position: absolute; 315 opacity: 0; 316 pointer-events: none; 317 top: 11px; 318 left: 50%; 319 width: max-content; 320 } 321`;var re=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};const _e={loading:void 0,success:{backgroundColor:"success-100",iconColor:"success-100",icon:"checkmark"},error:{backgroundColor:"error-100",iconColor:"error-100",icon:"close"}};let z=class extends f{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=$.state.open,this.unsubscribe.push($.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:t,svg:o}=$.state,n=_e[t],{icon:i,iconColor:s}=o??n??{};return a` 322 <wui-snackbar 323 message=${e} 324 backgroundColor=${n?.backgroundColor} 325 iconColor=${s} 326 icon=${i} 327 .loading=${t==="loading"} 328 ></wui-snackbar> 329 `}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),$.state.autoClose&&(this.timeout=setTimeout(()=>$.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"})}};z.styles=Pe;re([w()],z.prototype,"open",void 0);z=re([u("w3m-snackbar")],z);const Be=v` 330 :host { 331 pointer-events: none; 332 } 333 334 :host > wui-flex { 335 display: var(--w3m-tooltip-display); 336 opacity: var(--w3m-tooltip-opacity); 337 padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); 338 border-radius: var(--wui-border-radius-xxs); 339 color: var(--wui-color-bg-100); 340 position: fixed; 341 top: var(--w3m-tooltip-top); 342 left: var(--w3m-tooltip-left); 343 transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px)); 344 max-width: calc(var(--w3m-modal-width) - var(--wui-spacing-xl)); 345 transition: opacity 0.2s var(--wui-ease-out-power-2); 346 will-change: opacity; 347 } 348 349 :host([data-variant='shade']) > wui-flex { 350 background-color: var(--wui-color-bg-150); 351 border: 1px solid var(--wui-color-gray-glass-005); 352 } 353 354 :host([data-variant='shade']) > wui-flex > wui-text { 355 color: var(--wui-color-fg-150); 356 } 357 358 :host([data-variant='fill']) > wui-flex { 359 background-color: var(--wui-color-fg-100); 360 border: none; 361 } 362 363 wui-icon { 364 position: absolute; 365 width: 12px !important; 366 height: 4px !important; 367 color: var(--wui-color-bg-150); 368 } 369 370 wui-icon[data-placement='top'] { 371 bottom: 0px; 372 left: 50%; 373 transform: translate(-50%, 95%); 374 } 375 376 wui-icon[data-placement='bottom'] { 377 top: 0; 378 left: 50%; 379 transform: translate(-50%, -95%) rotate(180deg); 380 } 381 382 wui-icon[data-placement='right'] { 383 top: 50%; 384 left: 0; 385 transform: translate(-65%, -50%) rotate(90deg); 386 } 387 388 wui-icon[data-placement='left'] { 389 top: 50%; 390 right: 0%; 391 transform: translate(65%, -50%) rotate(270deg); 392 } 393`;var _=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};let W=class extends f{constructor(){super(),this.unsubscribe=[],this.open=A.state.open,this.message=A.state.message,this.triggerRect=A.state.triggerRect,this.variant=A.state.variant,this.unsubscribe.push(A.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}
393disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;const e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=` 394 --w3m-tooltip-top: ${e}px; 395 --w3m-tooltip-left: ${t}px; 396 --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px; 397 --w3m-tooltip-display: ${this.open?"flex":"none"}; 398 --w3m-tooltip-opacity: ${this.open?1:0}; 399 `,a`<wui-flex> 400 <wui-icon data-placement="top" color="fg-100" size="inherit" name="cursor"></wui-icon> 401 <wui-text color="inherit" variant="small-500">${this.message}</wui-text> 402 </wui-flex>`}};W.styles=[Be];_([w()],W.prototype,"open",void 0);_([w()],W.prototype,"message",void 0);_([w()],W.prototype,"triggerRect",void 0);_([w()],W.prototype,"variant",void 0);W=_([u("w3m-tooltip"),u("w3m-tooltip")],W);const De=v` 403 :host { 404 --prev-height: 0px; 405 --new-height: 0px; 406 display: block; 407 } 408 409 div.w3m-router-container { 410 transform: translateY(0); 411 opacity: 1; 412 } 413 414 div.w3m-router-container[view-direction='prev'] { 415 animation: 416 slide-left-out 150ms forwards ease, 417 slide-left-in 150ms forwards ease; 418 animation-delay: 0ms, 200ms; 419 } 420 421 div.w3m-router-container[view-direction='next'] { 422 animation: 423 slide-right-out 150ms forwards ease, 424 slide-right-in 150ms forwards ease; 425 animation-delay: 0ms, 200ms; 426 } 427 428 @keyframes slide-left-out { 429 from { 430 transform: translateX(0px); 431 opacity: 1; 432 } 433 to { 434 transform: translateX(10px); 435 opacity: 0; 436 } 437 } 438 439 @keyframes slide-left-in { 440 from { 441 transform: translateX(-10px); 442 opacity: 0; 443 } 444 to { 445 transform: translateX(0); 446 opacity: 1; 447 } 448 } 449 450 @keyframes slide-right-out { 451 from { 452 transform: translateX(0px); 453 opacity: 1; 454 } 455 to { 456 transform: translateX(-10px); 457 opacity: 0; 458 } 459 } 460 461 @keyframes slide-right-in { 462 from { 463 transform: translateX(10px); 464 opacity: 0; 465 } 466 to { 467 transform: translateX(0); 468 opacity: 1; 469 } 470 } 471`;var Y=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};let O=class extends f{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=l.state.view,this.viewDirection="",this.unsubscribe.push(l.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){this.resizeObserver=new ResizeObserver(([e])=>{const t=`${e?.contentRect.height}px`;this.prevHeight!=="0px"&&(this.style.setProperty("--prev-height",this.prevHeight),this.style.setProperty("--new-height",t),this.style.animation="w3m-view-height 150ms forwards ease",this.style.height="auto"),setTimeout(()=>{this.prevHeight=t,this.style.animation="unset"},k.ANIMATION_DURATIONS.ModalHeight)}),this.resizeObserver?.observe(this.getWrapper())}disconnectedCallback(){this.resizeObserver?.unobserve(this.getWrapper()),this.unsubscribe.forEach(e=>e())}render(){return a`<div class="w3m-router-container" view-direction="${this.viewDirection}"> 472 ${this.viewTemplate()} 473 </div>`}viewTemplate(){switch(this.view){case"AccountSettings":return a`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return a`<w3m-account-view></w3m-account-view>`;case"AllWallets":return a`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return a`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return a`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return a`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":return a`<w3m-connect-view></w3m-connect-view>`;case"Create":return a`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return a`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return a`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;
473case"ConnectingExternal":return a`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return a`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return a`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return a`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return a`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"Downloads":return a`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return a`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return a`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return a`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return a`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return a`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return a`<w3m-network-switch-view></w3m-network-switch-view>`;case"Profile":return a`<w3m-profile-view></w3m-profile-view>`;case"SwitchAddress":return a`<w3m-switch-address-view></w3m-switch-address-view>`;case"Transactions":return a`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return a`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampActivity":return a`<w3m-onramp-activity-view></w3m-onramp-activity-view>`;case"OnRampTokenSelect":return a`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return a`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return a`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return a`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return a`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return a`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return a`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return a`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return a`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return a`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return a`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return a`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return a`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WhatIsABuy":return a`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return a`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return a`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return a`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return a`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return a`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return a`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return a`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return a`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return a`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return a`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return a`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return a`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return a`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return a`<w3m-pay-loading-view></w3m-pay-loading-view>`;default:return a`<w3m-connect-view></w3m-connect-view>`}}onViewChange(e){A.hide();let t=k.VIEW_DIRECTION.Next;const{history:o}=l.state;o.length<this.prevHistoryLength&&(t=k.VIEW_DIRECTION.Prev),this.prevHistoryLength=o.length,this.viewDirection=t,setTimeout(()=>{this.view=e},k.ANIMATION_DURATIONS.ViewTransition)}getWrapper(){return this.shadowRoot?.querySelector("div")}};O.styles=De;Y([w()],O.prototype,"view",void 0);Y([w()],O.prototype,"viewDirection",void 0);O=Y([u("w3m-router")],O);const je=v` 474 :host { 475 z-index: var(--w3m-z-index); 476 display: block; 477 backface-visibility: hidden; 478 will-change: opacity; 479 position: fixed; 480 top: 0; 481 left: 0; 482 right: 0; 483 bottom: 0; 484 pointer-events: none; 485 opacity: 0; 486 background-color: var(--wui-cover); 487 transition: opacity 0.2s var(--wui-ease-out-power-2); 488 will-change: opacity; 489 } 490 491 :host(.open) { 492 opacity: 1; 493 } 494 495 :host(.appkit-modal) { 496 position: relative; 497 pointer-events: unset; 498 background: none; 499 width: 100%; 500 opacity: 1; 501 } 502 503 wui-card { 504 max-width: var(--w3m-modal-width); 505 width: 100%; 506 position: relative; 507 animation: zoom-in 0.2s var(--wui-ease-out-power-2); 508 animation-fill-mode: backwards; 509 outline: none; 510 transition: 511 border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1), 512 background-color var(--wui-duration-lg) var(--wui-ease-out-power-1); 513 will-change: border-radius, background-color; 514 } 515 516 :host(.appkit-modal) wui-card { 517 max-width: 400px; 518 } 519 520 wui-card[shake='true'] { 521 animation: 522 zoom-in 0.2s var(--wui-ease-out-power-2), 523 w3m-shake 0.5s var(--wui-ease-out-power-2); 524 } 525 526 wui-flex { 527 overflow-x: hidden; 528 overflow-y: auto; 529 display: flex; 530 align-items: center; 531 justify-content: center; 532 width: 100%; 533 height: 100%; 534 } 535 536 @media (max-height: 700px) and (min-width: 431px) { 537 wui-flex { 538 align-items: flex-start; 539 } 540 541 wui-card { 542 margin: var(--wui-spacing-xxl) 0px; 543 } 544 } 545 546 @media (max-width: 430px) { 547 wui-flex { 548 align-items: flex-end; 549 } 550 551 wui-card { 552 max-width: 100%; 553 border-bottom-left-radius: var(--local-border-bottom-mobile-radius); 554 border-bottom-right-radius: var(--local-border-bottom-mobile-radius); 555 border-bottom: none; 556 animation: slide-in 0.2s var(--wui-ease-out-power-2); 557 } 558 559 wui-card[shake='true'] { 560 animation: 561 slide-in 0.2s var(--wui-ease-out-power-2), 562 w3m-shake 0.5s var(--wui-ease-out-power-2); 563 } 564 } 565 566 @keyframes zoom-in { 567 0% { 568 transform: scale(0.95) translateY(0); 569 } 570 100% { 571 transform: scale(1) translateY(0); 572 } 573 } 574 575 @keyframes slide-in { 576 0% { 577 transform: scale(1) translateY(50px); 578 } 579 100% { 580 transform: scale(1) translateY(0); 581 } 582 } 583 584 @keyframes w3m-shake { 585 0% { 586 transform: scale(1) rotate(0deg); 587 } 588 20% { 589 transform: scale(1) rotate(-1deg); 590 } 591 40% { 592 transform: scale(1) rotate(1.5deg); 593 } 594 60% { 595 transform: scale(1) rotate(-1.5deg); 596 } 597 80% { 598 transform: scale(1) rotate(1deg); 599 } 600 100% { 601 transform: scale(1) rotate(0deg); 602 } 603 } 604 605 @keyframes w3m-view-height { 606 from { 607 height: var(--prev-height); 608 } 609 to { 610 height: var(--new-height); 611 } 612 } 613`;var C=function(r,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,o);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};const J="scroll-lock";class x extends f{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.hasPrefetched=!1,this.enableEmbedded=T.state.enableEmbedded,this.open=g.state.open,this.caipAddress=m.state.activeCaipAddress,this.caipNetwork=m.state.activeCaipNetwork,this.shake=g.state.shake,this.filterByNamespace=M.state.filterByNamespace,this.initializeTheming(),D.prefetchAnalyticsConfig(),this.unsubscribe.push(g.subscribeKey("open",e=>e?this.onOpen():this.onClose()),g.subscribeKey("shake",e=>this.shake=e),m.subscribeKey("activeCaipNetwork",e=>this.onNewNetwork(e)),m.subscribeKey("activeCaipAddress",e=>this.onNewAddress(e)),T.subscribeKey("enableEmbedded",e=>this.enableEmbedded=e),M.subscribeKey("filterByNamespace",e=>{this.filterByNamespace!==e&&!m.getAccountData(e)?.caipAddress&&(D.fetchRecommendedWallets(),this.filterByNamespace=e)}))}firstUpdated(){if(this.caipAddress){if(this.enableEmbedded){g.close(),this.prefetch();return}this.onNewAddress(this.caipAddress)}this.open&&this.onOpen(),this.enableEmbedded&&this.prefetch()}
613disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return this.style.cssText=` 614 --local-border-bottom-mobile-radius: ${this.enableEmbedded?"clamp(0px, var(--wui-border-radius-l), 44px)":"0px"}; 615 `,this.enableEmbedded?a`${this.contentTemplate()} 616 <w3m-tooltip></w3m-tooltip> `:this.open?a` 617 <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay"> 618 ${this.contentTemplate()} 619 </wui-flex> 620 <w3m-tooltip></w3m-tooltip> 621 `:null}contentTemplate(){return a` <wui-card 622 shake="${this.shake}" 623 data-embedded="${V(this.enableEmbedded)}" 624 role="alertdialog" 625 aria-modal="true" 626 tabindex="0" 627 data-testid="w3m-modal-card" 628 > 629 <w3m-header></w3m-header> 630 <w3m-router></w3m-router> 631 <w3m-snackbar></w3m-snackbar> 632 <w3m-alertbar></w3m-alertbar> 633 </wui-card>`}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){await oe.safeClose()}initializeTheming(){const{themeVariables:e,themeMode:t}=ge.state,o=Ce.getColorTheme(t);be(e,o)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),$.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=J,e.textContent=` 634 body { 635 touch-action: none; 636 overflow: hidden; 637 overscroll-behavior: contain; 638 } 639 w3m-modal { 640 pointer-events: auto; 641 } 642 `,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${J}"]`);e&&e.remove()}onAddKeyboardListener(){this.abortController=new AbortController;const e=this.shadowRoot?.querySelector("wui-card");e?.focus(),window.addEventListener("keydown",t=>{if(t.key==="Escape")this.handleClose();else if(t.key==="Tab"){const{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){const t=m.state.isSwitchingNamespace,o=ye.getPlainAddress(e);!o&&!t?g.close():t&&o&&l.goBack(),await ee.initializeIfEnabled(),this.caipAddress=e,m.setIsSwitchingNamespace(!1)}onNewNetwork(e){const t=this.caipNetwork,o=t?.caipNetworkId?.toString(),n=t?.chainNamespace,i=e?.caipNetworkId?.toString(),s=e?.chainNamespace,c=o!==i,se=c&&!(n!==s),ce=t?.name===xe.UNSUPPORTED_NETWORK_NAME,le=l.state.view==="ConnectingExternal",we=!m.getAccountData(e?.chainNamespace)?.caipAddress,de=l.state.view==="UnsupportedChain",ue=g.state.open;let B=!1;ue&&!le&&(we?c&&(B=!0):(de||se&&!ce)&&(B=!0)),B&&l.state.view!=="SIWXSignMessage"&&l.goBack(),this.caipNetwork=e}prefetch(){this.hasPrefetched||(D.prefetch(),D.fetchWalletsByPage({page:1}),this.hasPrefetched=!0)}}x.styles=je;C([d({type:Boolean})],x.prototype,"enableEmbedded",void 0);C([w()],x.prototype,"open",void 0);C([w()],x.prototype,"caipAddress",void 0);C([w()],x.prototype,"caipNetwork",void 0);C([w()],x.prototype,"shake",void 0);C([w()],x.prototype,"filterByNamespace",void 0);let Q=class extends x{};Q=C([u("w3m-modal")],Q);let Z=class extends x{};Z=C([u("appkit-modal")],Z);export{Z as AppKitModal,Q as W3mModal,x as W3mModalBase};
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.