UNPKG

@web3-onboard/core

Version:

Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, mul

1,558 lines (1,360 loc) 131 kB
import { S as SvelteComponent, i as init, s as safe_not_equal, a as append_styles, e as empty, b as insert, n as noop, d as detach, c as component_subscribe, w as wallets$, f as setChain, g as binding_callbacks, h as connectedToValidAppChain, j as element, k as attr, l as null_to_empty, m as append, o as select_option, p as listen, u as update_keyed_each, q as destroy_block, t as text, r as chainIdToLabel, v as set_data, x as transition_in, y as group_outros, z as check_outros, A as transition_out, B as destroy_each, C as en, D as shortenDomain, E as shortenAddress, W as WalletAppBadge, F as create_component, G as space, H as toggle_class, I as mount_component, J as stop_propagation, K as destroy_component, L as run_all, M as selectAccounts, N as connectWallet$, O as setPrimaryWallet, P as disconnect, Q as copyWalletAddress, R as SuccessStatusIcon, T as set_style, U as add_render_callback, V as create_in_transition, X as fade, Y as Modal, Z as is_function, _ as handle_promise, $ as update_await_block_branch, a0 as isSVG, a1 as src_url_equal, a2 as HtmlTag, a3 as state, a4 as getDefaultChainStyles, a5 as BN_BOOST_INFO_URL, a6 as unrecognizedChainStyle, a7 as poweredByThirdweb, a8 as outro_and_destroy_block, a9 as create_bidirectional_transition, aa as quartOut, ab as fly, ac as bind, ad as add_flush_callback, ae as questionIcon, af as configuration, ag as updateChainRPC, ah as BN_BOOST_RPC_URL, ai as bubble, aj as connect, ak as create_out_transition, al as onDestroy, am as updateAccountCenter } from './index-10054806.js'; import { skip, debounceTime, distinctUntilChanged, startWith as startWith$1, shareReplay as shareReplay$1 } from 'rxjs/operators'; import { _ } from 'svelte-i18n'; import { BehaviorSubject, merge, startWith, shareReplay } from 'rxjs'; import { ProviderRpcErrorCode } from '@web3-onboard/common'; import 'bowser'; import 'lodash.partition'; import 'nanoid'; import 'viem'; import 'joi'; import 'lodash.merge'; import 'eventemitter3'; var caretIcon = `<svg width="100%" height="24" viewBox="0 5 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 10L12 15L17 10H7Z" fill="currentColor"/></svg>`; var warningIcon = ` <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1 21H23L12 2L1 21ZM13 18H11V16H13V18ZM13 14H11V10H13V14Z" fill="currentColor"/> </svg> `; /* src/views/shared/NetworkSelector.svelte generated by Svelte v3.59.2 */ function add_css$8(target) { append_styles(target, "svelte-1uqued6", "select.svelte-1uqued6{border:none;background-image:none;background-color:transparent;-webkit-appearance:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;appearance:none;font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));transition:width 250ms ease-in-out;background-repeat:no-repeat, repeat;background-position:right 0px top 0px, 0 0;scrollbar-width:none;-ms-overflow-style:none;padding:0 14px 0 0;white-space:nowrap;text-overflow:ellipsis}select.minimized_ac.svelte-1uqued6{min-width:80px;max-width:80px}select.maximized_ac.svelte-1uqued6{width:auto !important}select.svelte-1uqued6:focus{outline:none}span.switching-placeholder.svelte-1uqued6{font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));min-width:80px;max-width:80px;padding:0 8px 0 4px}"); } function get_each_context$3(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[15] = list[i]; return child_ctx; } // (92:0) {#if wallet} function create_if_block$5(ctx) { let if_block_anchor; function select_block_type(ctx, dirty) { if (/*$switching$*/ ctx[7]) return create_if_block_1$4; return create_else_block$2; } let current_block_type = select_block_type(ctx); let if_block = current_block_type(ctx); return { c() { if_block.c(); if_block_anchor = empty(); }, m(target, anchor) { if_block.m(target, anchor); insert(target, if_block_anchor, anchor); }, p(ctx, dirty) { if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) { if_block.p(ctx, dirty); } else { if_block.d(1); if_block = current_block_type(ctx); if (if_block) { if_block.c(); if_block.m(if_block_anchor.parentNode, if_block_anchor); } } }, d(detaching) { if_block.d(detaching); if (detaching) detach(if_block_anchor); } }; } // (101:2) {:else} function create_else_block$2(ctx) { let select; let show_if = !connectedToValidAppChain(/*wallet*/ ctx[6].chains[0], /*chains*/ ctx[2]); let if_block_anchor; let each_blocks = []; let each_1_lookup = new Map(); let select_class_value; let select_value_value; let select_style_value; let mounted; let dispose; let if_block = show_if && create_if_block_2$4(ctx); let each_value = /*chains*/ ctx[2]; const get_key = ctx => /*chain*/ ctx[15].id; for (let i = 0; i < each_value.length; i += 1) { let child_ctx = get_each_context$3(ctx, each_value, i); let key = get_key(child_ctx); each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx)); } return { c() { select = element("select"); if (if_block) if_block.c(); if_block_anchor = empty(); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } attr(select, "class", select_class_value = "" + (null_to_empty(`flex justify-center items-center pointer ${/*parentCSSId*/ ctx[4]}`) + " svelte-1uqued6")); attr(select, "style", select_style_value = ` color: var(${/*colorVar*/ ctx[1]}, var(--account-center-network-selector-color, var(--gray-500))); background-image: url('data:image/svg+xml;utf8,${/*selectIcon*/ ctx[0]}'); ${/*bold*/ ctx[3] ? 'font-weight: 600;' : ''}`); }, m(target, anchor) { insert(target, select, anchor); if (if_block) if_block.m(select, null); append(select, if_block_anchor); for (let i = 0; i < each_blocks.length; i += 1) { if (each_blocks[i]) { each_blocks[i].m(select, null); } } select_option(select, /*wallet*/ ctx[6].chains[0].id); /*select_binding*/ ctx[13](select); if (!mounted) { dispose = listen(select, "change", /*handleSelect*/ ctx[10]); mounted = true; } }, p(ctx, dirty) { if (dirty & /*wallet, chains*/ 68) show_if = !connectedToValidAppChain(/*wallet*/ ctx[6].chains[0], /*chains*/ ctx[2]); if (show_if) { if (if_block) { if_block.p(ctx, dirty); } else { if_block = create_if_block_2$4(ctx); if_block.c(); if_block.m(select, if_block_anchor); } } else if (if_block) { if_block.d(1); if_block = null; } if (dirty & /*chains, chainIdToLabel*/ 4) { each_value = /*chains*/ ctx[2]; each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, select, destroy_block, create_each_block$3, null, get_each_context$3); } if (dirty & /*parentCSSId*/ 16 && select_class_value !== (select_class_value = "" + (null_to_empty(`flex justify-center items-center pointer ${/*parentCSSId*/ ctx[4]}`) + " svelte-1uqued6"))) { attr(select, "class", select_class_value); } if (dirty & /*wallet*/ 64 && select_value_value !== (select_value_value = /*wallet*/ ctx[6].chains[0].id)) { select_option(select, /*wallet*/ ctx[6].chains[0].id); } if (dirty & /*colorVar, selectIcon, bold*/ 11 && select_style_value !== (select_style_value = ` color: var(${/*colorVar*/ ctx[1]}, var(--account-center-network-selector-color, var(--gray-500))); background-image: url('data:image/svg+xml;utf8,${/*selectIcon*/ ctx[0]}'); ${/*bold*/ ctx[3] ? 'font-weight: 600;' : ''}`)) { attr(select, "style", select_style_value); } }, d(detaching) { if (detaching) detach(select); if (if_block) if_block.d(); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].d(); } /*select_binding*/ ctx[13](null); mounted = false; dispose(); } }; } // (93:2) {#if $switching$} function create_if_block_1$4(ctx) { let span; let t; let span_class_value; let span_style_value; return { c() { span = element("span"); t = text("switching..."); attr(span, "class", span_class_value = "" + (null_to_empty(`switching-placeholder ${/*parentCSSId*/ ctx[4]}`) + " svelte-1uqued6")); attr(span, "style", span_style_value = ` color: var(${/*colorVar*/ ctx[1]}, var(--account-center-network-selector-color, var(--gray-500))); `); }, m(target, anchor) { insert(target, span, anchor); append(span, t); }, p(ctx, dirty) { if (dirty & /*parentCSSId*/ 16 && span_class_value !== (span_class_value = "" + (null_to_empty(`switching-placeholder ${/*parentCSSId*/ ctx[4]}`) + " svelte-1uqued6"))) { attr(span, "class", span_class_value); } if (dirty & /*colorVar*/ 2 && span_style_value !== (span_style_value = ` color: var(${/*colorVar*/ ctx[1]}, var(--account-center-network-selector-color, var(--gray-500))); `)) { attr(span, "style", span_style_value); } }, d(detaching) { if (detaching) detach(span); } }; } // (114:6) {#if !connectedToValidAppChain(wallet.chains[0], chains)} function create_if_block_2$4(ctx) { let option; let t_value = (chainIdToLabel[/*wallet*/ ctx[6].chains[0].id] || 'unrecognized') + ""; let t; let option_value_value; return { c() { option = element("option"); t = text(t_value); option.__value = option_value_value = /*wallet*/ ctx[6].chains[0].id; option.value = option.__value; }, m(target, anchor) { insert(target, option, anchor); append(option, t); }, p(ctx, dirty) { if (dirty & /*wallet*/ 64 && t_value !== (t_value = (chainIdToLabel[/*wallet*/ ctx[6].chains[0].id] || 'unrecognized') + "")) set_data(t, t_value); if (dirty & /*wallet*/ 64 && option_value_value !== (option_value_value = /*wallet*/ ctx[6].chains[0].id)) { option.__value = option_value_value; option.value = option.__value; } }, d(detaching) { if (detaching) detach(option); } }; } // (119:6) {#each chains as chain (chain.id)} function create_each_block$3(key_1, ctx) { let option; let t_value = (/*chain*/ ctx[15].label || chainIdToLabel[/*chain*/ ctx[15].id] || /*chain*/ ctx[15].id) + ""; let t; let option_value_value; return { key: key_1, first: null, c() { option = element("option"); t = text(t_value); option.__value = option_value_value = /*chain*/ ctx[15].id; option.value = option.__value; this.first = option; }, m(target, anchor) { insert(target, option, anchor); append(option, t); }, p(new_ctx, dirty) { ctx = new_ctx; if (dirty & /*chains*/ 4 && t_value !== (t_value = (/*chain*/ ctx[15].label || chainIdToLabel[/*chain*/ ctx[15].id] || /*chain*/ ctx[15].id) + "")) set_data(t, t_value); if (dirty & /*chains*/ 4 && option_value_value !== (option_value_value = /*chain*/ ctx[15].id)) { option.__value = option_value_value; option.value = option.__value; } }, d(detaching) { if (detaching) detach(option); } }; } function create_fragment$8(ctx) { let if_block_anchor; let if_block = /*wallet*/ ctx[6] && create_if_block$5(ctx); return { c() { if (if_block) if_block.c(); if_block_anchor = empty(); }, m(target, anchor) { if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); }, p(ctx, [dirty]) { if (/*wallet*/ ctx[6]) { if (if_block) { if_block.p(ctx, dirty); } else { if_block = create_if_block$5(ctx); if_block.c(); if_block.m(if_block_anchor.parentNode, if_block_anchor); } } else if (if_block) { if_block.d(1); if_block = null; } }, i: noop, o: noop, d(detaching) { if (if_block) if_block.d(detaching); if (detaching) detach(if_block_anchor); } }; } function instance$8($$self, $$props, $$invalidate) { let wallet; let $resize$; let $wallets$; let $switching$; component_subscribe($$self, wallets$, $$value => $$invalidate(12, $wallets$ = $$value)); let { selectIcon = caretIcon } = $$props; let { colorVar } = $$props; let { chains } = $$props; let { bold = false } = $$props; let { parentCSSId = '' } = $$props; const switching$ = new BehaviorSubject(false); component_subscribe($$self, switching$, value => $$invalidate(7, $switching$ = value)); let selectElement; const resize$ = merge(wallets$, switching$.pipe(skip(1))).pipe(debounceTime(50), distinctUntilChanged((prev, next) => typeof prev === 'boolean' || typeof next === 'boolean' ? false : prev[0] && next[0] && prev[0].chains[0].id === next[0].chains[0].id)); component_subscribe($$self, resize$, value => $$invalidate(11, $resize$ = value)); async function handleSelect() { const selectedChain = selectElement.selectedOptions[0].value; if (selectedChain !== wallet.chains[0].id) { switching$.next(true); await setChain({ chainId: selectedChain, chainNamespace: 'evm', wallet: wallet.label }); switching$.next(false); } } function resizeSelect() { if (!selectElement) return; let tempOption = document.createElement('option'); tempOption.textContent = selectElement.selectedOptions[0].textContent; let tempSelect = document.createElement('select'); tempSelect.style.visibility = 'hidden'; tempSelect.style.position = 'fixed'; tempSelect.appendChild(tempOption); selectElement.after(tempSelect); $$invalidate(5, selectElement.style.width = `${tempSelect.clientWidth - 22}px`, selectElement); tempSelect.remove(); } function select_binding($$value) { binding_callbacks[$$value ? 'unshift' : 'push'](() => { selectElement = $$value; $$invalidate(5, selectElement); $$invalidate(2, chains); ($$invalidate(6, wallet), $$invalidate(12, $wallets$)); }); } $$self.$$set = $$props => { if ('selectIcon' in $$props) $$invalidate(0, selectIcon = $$props.selectIcon); if ('colorVar' in $$props) $$invalidate(1, colorVar = $$props.colorVar); if ('chains' in $$props) $$invalidate(2, chains = $$props.chains); if ('bold' in $$props) $$invalidate(3, bold = $$props.bold); if ('parentCSSId' in $$props) $$invalidate(4, parentCSSId = $$props.parentCSSId); }; $$self.$$.update = () => { if ($$self.$$.dirty & /*$wallets$*/ 4096) { $$invalidate(6, [wallet] = $wallets$, wallet); } if ($$self.$$.dirty & /*$resize$*/ 2048) { if ($resize$) { resizeSelect(); } } }; return [ selectIcon, colorVar, chains, bold, parentCSSId, selectElement, wallet, $switching$, switching$, resize$, handleSelect, $resize$, $wallets$, select_binding ]; } class NetworkSelector extends SvelteComponent { constructor(options) { super(); init( this, options, instance$8, create_fragment$8, safe_not_equal, { selectIcon: 0, colorVar: 1, chains: 2, bold: 3, parentCSSId: 4 }, add_css$8 ); } } var elipsisIcon = ` <svg width="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12 8C13.1 8 14 7.1 14 6C14 4.9 13.1 4 12 4C10.9 4 10 4.9 10 6C10 7.1 10.9 8 12 8ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10ZM12 16C10.9 16 10 16.9 10 18C10 19.1 10.9 20 12 20C13.1 20 14 19.1 14 18C14 16.9 13.1 16 12 16Z" fill="currentColor"/> </svg> `; /* src/views/account-center/WalletRow.svelte generated by Svelte v3.59.2 */ function add_css$7(target) { append_styles(target, "svelte-hb2n95", ".container.svelte-hb2n95.svelte-hb2n95{display:flex;align-items:center;gap:0.5rem;cursor:pointer;position:relative;z-index:0;width:100%;padding:0.25rem;margin-bottom:0.25rem;border-radius:12px;transition:background-color 150ms ease-in-out}.container.svelte-hb2n95.svelte-hb2n95::before{content:'';display:block;position:absolute;top:0;bottom:0;left:0;right:0;height:100%;width:100%;background:var(--action-color);border-radius:12px;z-index:-1;opacity:0}.container.svelte-hb2n95.svelte-hb2n95:hover::before{opacity:0.2}.container.svelte-hb2n95:hover .balance.svelte-hb2n95,.container.svelte-hb2n95:hover .elipsis-container.svelte-hb2n95{opacity:1}.container.svelte-hb2n95:hover .balance.svelte-hb2n95{color:var(--account-center-maximized-balance-color, inherit)}.container.primary.svelte-hb2n95.svelte-hb2n95:hover{background-color:var(\n --account-center-maximized-account-section-background-hover\n )}.account-details.svelte-hb2n95.svelte-hb2n95{flex:1 1;display:flex;gap:inherit;overflow:hidden}.address-domain.svelte-hb2n95.svelte-hb2n95{flex:1 0 auto;max-width:70%;white-space:nowrap;font-weight:600;color:var(--account-center-maximized-address-color, inherit);overflow:scroll;scrollbar-width:none;-ms-overflow-style:none}.address-domain.svelte-hb2n95.svelte-hb2n95::-webkit-scrollbar{display:none}.balance.svelte-hb2n95.svelte-hb2n95{flex:1 1 auto;max-width:70%;white-space:nowrap;text-align:end;opacity:0.4;transition:color 150ms ease-in-out, background-color 150ms ease-in-out;overflow:scroll;scrollbar-width:none;-ms-overflow-style:none}.balance.svelte-hb2n95.svelte-hb2n95::-webkit-scrollbar{display:none}.elipsis-container.svelte-hb2n95.svelte-hb2n95{flex:0;padding:0.25rem;border-radius:24px;transition:color 150ms ease-in-out, background-color 150ms ease-in-out;background-color:transparent;opacity:0.4}.elipsis-container.svelte-hb2n95.svelte-hb2n95:hover{color:var(--text-color)}.elipsis-container.active.svelte-hb2n95.svelte-hb2n95{color:var(--text-color)}.elipsis.svelte-hb2n95.svelte-hb2n95{width:24px}.menu.svelte-hb2n95.svelte-hb2n95{background:var(--onboard-white, var(--white));border:1px solid var(--onboard-gray-100, var(--gray-100));border-radius:8px;list-style-type:none;right:0.25rem;top:2.25rem;margin:0;padding:0;border:none;overflow:hidden;z-index:1}.menu.svelte-hb2n95 li.svelte-hb2n95{color:var(--onboard-primary-500, var(--primary-500));font-size:var(--onboard-font-size-5, var(--font-size-5));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));padding:12px 16px;background:var(--onboard-white, var(--white));transition:background-color 150ms ease-in-out;cursor:pointer}.menu.svelte-hb2n95 li.svelte-hb2n95:hover{background:var(--onboard-primary-200, var(--primary-200))}"); } function get_each_context$2(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[14] = list[i].address; child_ctx[15] = list[i].ens; child_ctx[16] = list[i].uns; child_ctx[17] = list[i].balance; child_ctx[19] = i; return child_ctx; } // (203:8) {#if primary && i === 0} function create_if_block_3$1(ctx) { let div; let successstatusicon; let current; successstatusicon = new SuccessStatusIcon({ props: { size: 14 } }); return { c() { div = element("div"); create_component(successstatusicon.$$.fragment); set_style(div, "right", "-5px"); set_style(div, "bottom", "-5px"); attr(div, "class", "drop-shadow absolute"); }, m(target, anchor) { insert(target, div, anchor); mount_component(successstatusicon, div, null); current = true; }, i(local) { if (current) return; transition_in(successstatusicon.$$.fragment, local); current = true; }, o(local) { transition_out(successstatusicon.$$.fragment, local); current = false; }, d(detaching) { if (detaching) detach(div); destroy_component(successstatusicon); } }; } // (221:8) {#if balance} function create_if_block_2$3(ctx) { let div; let t_value = formatBalance(/*balance*/ ctx[17]) + ""; let t; let div_intro; return { c() { div = element("div"); t = text(t_value); attr(div, "class", "balance svelte-hb2n95"); }, m(target, anchor) { insert(target, div, anchor); append(div, t); }, p(ctx, dirty) { if (dirty & /*wallet*/ 1 && t_value !== (t_value = formatBalance(/*balance*/ ctx[17]) + "")) set_data(t, t_value); }, i(local) { if (local) { if (!div_intro) { add_render_callback(() => { div_intro = create_in_transition(div, fade, {}); div_intro.start(); }); } } }, o: noop, d(detaching) { if (detaching) detach(div); } }; } // (240:4) {#if showMenu === address} function create_if_block$4(ctx) { let ul; let li0; let t0_value = /*$_*/ ctx[4]('accountCenter.addAccount', { default: /*en*/ ctx[2].accountCenter.addAccount }) + ""; let t0; let t1; let t2; let li1; let t3_value = /*$_*/ ctx[4]('accountCenter.disconnectWallet', { default: /*en*/ ctx[2].accountCenter.disconnectWallet }) + ""; let t3; let t4; let li2; let t5_value = /*en*/ ctx[2].accountCenter.copyAddress + ""; let t5; let ul_intro; let mounted; let dispose; let if_block = !(/*primary*/ ctx[1] && /*i*/ ctx[19] === 0) && create_if_block_1$3(ctx); function click_handler_5() { return /*click_handler_5*/ ctx[13](/*ens*/ ctx[15], /*uns*/ ctx[16], /*address*/ ctx[14]); } return { c() { ul = element("ul"); li0 = element("li"); t0 = text(t0_value); t1 = space(); if (if_block) if_block.c(); t2 = space(); li1 = element("li"); t3 = text(t3_value); t4 = space(); li2 = element("li"); t5 = text(t5_value); attr(li0, "class", "svelte-hb2n95"); attr(li1, "class", "svelte-hb2n95"); attr(li2, "class", "svelte-hb2n95"); attr(ul, "class", "menu absolute svelte-hb2n95"); }, m(target, anchor) { insert(target, ul, anchor); append(ul, li0); append(li0, t0); append(ul, t1); if (if_block) if_block.m(ul, null); append(ul, t2); append(ul, li1); append(li1, t3); append(ul, t4); append(ul, li2); append(li2, t5); if (!mounted) { dispose = [ listen(li0, "click", stop_propagation(/*click_handler_2*/ ctx[10])), listen(li1, "click", stop_propagation(/*click_handler_4*/ ctx[12])), listen(li2, "click", stop_propagation(click_handler_5)) ]; mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; if (dirty & /*$_, en*/ 20 && t0_value !== (t0_value = /*$_*/ ctx[4]('accountCenter.addAccount', { default: /*en*/ ctx[2].accountCenter.addAccount }) + "")) set_data(t0, t0_value); if (!(/*primary*/ ctx[1] && /*i*/ ctx[19] === 0)) { if (if_block) { if_block.p(ctx, dirty); } else { if_block = create_if_block_1$3(ctx); if_block.c(); if_block.m(ul, t2); } } else if (if_block) { if_block.d(1); if_block = null; } if (dirty & /*$_, en*/ 20 && t3_value !== (t3_value = /*$_*/ ctx[4]('accountCenter.disconnectWallet', { default: /*en*/ ctx[2].accountCenter.disconnectWallet }) + "")) set_data(t3, t3_value); if (dirty & /*en*/ 4 && t5_value !== (t5_value = /*en*/ ctx[2].accountCenter.copyAddress + "")) set_data(t5, t5_value); }, i(local) { if (local) { if (!ul_intro) { add_render_callback(() => { ul_intro = create_in_transition(ul, fade, {}); ul_intro.start(); }); } } }, o: noop, d(detaching) { if (detaching) detach(ul); if (if_block) if_block.d(); mounted = false; run_all(dispose); } }; } // (252:8) {#if !(primary && i === 0)} function create_if_block_1$3(ctx) { let li; let t_value = /*$_*/ ctx[4]('accountCenter.setPrimaryAccount', { default: /*en*/ ctx[2].accountCenter.setPrimaryAccount }) + ""; let t; let mounted; let dispose; function click_handler_3() { return /*click_handler_3*/ ctx[11](/*address*/ ctx[14]); } return { c() { li = element("li"); t = text(t_value); attr(li, "class", "svelte-hb2n95"); }, m(target, anchor) { insert(target, li, anchor); append(li, t); if (!mounted) { dispose = listen(li, "click", stop_propagation(click_handler_3)); mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; if (dirty & /*$_, en*/ 20 && t_value !== (t_value = /*$_*/ ctx[4]('accountCenter.setPrimaryAccount', { default: /*en*/ ctx[2].accountCenter.setPrimaryAccount }) + "")) set_data(t, t_value); }, d(detaching) { if (detaching) detach(li); mounted = false; dispose(); } }; } // (182:0) {#each wallet.accounts as { address, ens, uns, balance } function create_each_block$2(ctx) { let div6; let div5; let div0; let walletappbadge; let t0; let t1; let div2; let div1; let t2_value = (/*ens*/ ctx[15] ? shortenDomain(/*ens*/ ctx[15].name) : /*uns*/ ctx[16] ? shortenDomain(/*uns*/ ctx[16].name) : shortenAddress(/*address*/ ctx[14])) + ""; let t2; let t3; let t4; let div4; let div3; let t5; let t6; let current; let mounted; let dispose; walletappbadge = new WalletAppBadge({ props: { size: 32, padding: 4, background: "custom", color: "#EFF1FC", customBackgroundColor: /*primary*/ ctx[1] && /*i*/ ctx[19] === 0 ? 'rgba(24, 206, 102, 0.2)' : 'rgba(235, 235, 237, 0.1)', border: /*primary*/ ctx[1] && /*i*/ ctx[19] === 0 ? 'green' : 'gray', radius: 8, icon: /*wallet*/ ctx[0].icon } }); let if_block0 = /*primary*/ ctx[1] && /*i*/ ctx[19] === 0 && create_if_block_3$1(); let if_block1 = /*balance*/ ctx[17] && create_if_block_2$3(ctx); function click_handler() { return /*click_handler*/ ctx[8](/*address*/ ctx[14]); } function click_handler_1() { return /*click_handler_1*/ ctx[9](/*address*/ ctx[14]); } let if_block2 = /*showMenu*/ ctx[3] === /*address*/ ctx[14] && create_if_block$4(ctx); return { c() { div6 = element("div"); div5 = element("div"); div0 = element("div"); create_component(walletappbadge.$$.fragment); t0 = space(); if (if_block0) if_block0.c(); t1 = space(); div2 = element("div"); div1 = element("div"); t2 = text(t2_value); t3 = space(); if (if_block1) if_block1.c(); t4 = space(); div4 = element("div"); div3 = element("div"); t5 = space(); if (if_block2) if_block2.c(); t6 = space(); attr(div0, "class", "flex items-center relative"); attr(div1, "class", "address-domain svelte-hb2n95"); attr(div2, "class", "account-details svelte-hb2n95"); attr(div3, "class", "elipsis pointer flex items-center justify-center relative svelte-hb2n95"); attr(div4, "class", "elipsis-container svelte-hb2n95"); toggle_class(div4, "active", /*showMenu*/ ctx[3] === /*address*/ ctx[14]); attr(div5, "class", "container svelte-hb2n95"); toggle_class(div5, "primary", /*primary*/ ctx[1] && /*i*/ ctx[19] === 0); attr(div6, "class", "relative"); }, m(target, anchor) { insert(target, div6, anchor); append(div6, div5); append(div5, div0); mount_component(walletappbadge, div0, null); append(div0, t0); if (if_block0) if_block0.m(div0, null); append(div5, t1); append(div5, div2); append(div2, div1); append(div1, t2); append(div2, t3); if (if_block1) if_block1.m(div2, null); append(div5, t4); append(div5, div4); append(div4, div3); div3.innerHTML = elipsisIcon; append(div6, t5); if (if_block2) if_block2.m(div6, null); append(div6, t6); current = true; if (!mounted) { dispose = [ listen(div3, "click", stop_propagation(click_handler)), listen(div5, "click", click_handler_1) ]; mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; const walletappbadge_changes = {}; if (dirty & /*primary*/ 2) walletappbadge_changes.customBackgroundColor = /*primary*/ ctx[1] && /*i*/ ctx[19] === 0 ? 'rgba(24, 206, 102, 0.2)' : 'rgba(235, 235, 237, 0.1)'; if (dirty & /*primary*/ 2) walletappbadge_changes.border = /*primary*/ ctx[1] && /*i*/ ctx[19] === 0 ? 'green' : 'gray'; if (dirty & /*wallet*/ 1) walletappbadge_changes.icon = /*wallet*/ ctx[0].icon; walletappbadge.$set(walletappbadge_changes); if (/*primary*/ ctx[1] && /*i*/ ctx[19] === 0) { if (if_block0) { if (dirty & /*primary*/ 2) { transition_in(if_block0, 1); } } else { if_block0 = create_if_block_3$1(); if_block0.c(); transition_in(if_block0, 1); if_block0.m(div0, null); } } else if (if_block0) { group_outros(); transition_out(if_block0, 1, 1, () => { if_block0 = null; }); check_outros(); } if ((!current || dirty & /*wallet*/ 1) && t2_value !== (t2_value = (/*ens*/ ctx[15] ? shortenDomain(/*ens*/ ctx[15].name) : /*uns*/ ctx[16] ? shortenDomain(/*uns*/ ctx[16].name) : shortenAddress(/*address*/ ctx[14])) + "")) set_data(t2, t2_value); if (/*balance*/ ctx[17]) { if (if_block1) { if_block1.p(ctx, dirty); if (dirty & /*wallet*/ 1) { transition_in(if_block1, 1); } } else { if_block1 = create_if_block_2$3(ctx); if_block1.c(); transition_in(if_block1, 1); if_block1.m(div2, null); } } else if (if_block1) { if_block1.d(1); if_block1 = null; } if (!current || dirty & /*showMenu, wallet*/ 9) { toggle_class(div4, "active", /*showMenu*/ ctx[3] === /*address*/ ctx[14]); } if (!current || dirty & /*primary*/ 2) { toggle_class(div5, "primary", /*primary*/ ctx[1] && /*i*/ ctx[19] === 0); } if (/*showMenu*/ ctx[3] === /*address*/ ctx[14]) { if (if_block2) { if_block2.p(ctx, dirty); if (dirty & /*showMenu, wallet*/ 9) { transition_in(if_block2, 1); } } else { if_block2 = create_if_block$4(ctx); if_block2.c(); transition_in(if_block2, 1); if_block2.m(div6, t6); } } else if (if_block2) { if_block2.d(1); if_block2 = null; } }, i(local) { if (current) return; transition_in(walletappbadge.$$.fragment, local); transition_in(if_block0); transition_in(if_block1); transition_in(if_block2); current = true; }, o(local) { transition_out(walletappbadge.$$.fragment, local); transition_out(if_block0); current = false; }, d(detaching) { if (detaching) detach(div6); destroy_component(walletappbadge); if (if_block0) if_block0.d(); if (if_block1) if_block1.d(); if (if_block2) if_block2.d(); mounted = false; run_all(dispose); } }; } function create_fragment$7(ctx) { let each_1_anchor; let current; let each_value = /*wallet*/ ctx[0].accounts; let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i)); } const out = i => transition_out(each_blocks[i], 1, 1, () => { each_blocks[i] = null; }); return { c() { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } each_1_anchor = empty(); }, m(target, anchor) { for (let i = 0; i < each_blocks.length; i += 1) { if (each_blocks[i]) { each_blocks[i].m(target, anchor); } } insert(target, each_1_anchor, anchor); current = true; }, p(ctx, [dirty]) { if (dirty & /*copyWalletAddress, wallet, changeText, en, showMenu, disconnect, $_, setPrimaryWallet, primary, selectAnotherAccount, elipsisIcon, formatBalance, shortenDomain, shortenAddress*/ 127) { each_value = /*wallet*/ ctx[0].accounts; let i; for (i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context$2(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { each_blocks[i] = create_each_block$2(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } } group_outros(); for (i = each_value.length; i < each_blocks.length; i += 1) { out(i); } check_outros(); } }, i(local) { if (current) return; for (let i = 0; i < each_value.length; i += 1) { transition_in(each_blocks[i]); } current = true; }, o(local) { each_blocks = each_blocks.filter(Boolean); for (let i = 0; i < each_blocks.length; i += 1) { transition_out(each_blocks[i]); } current = false; }, d(detaching) { destroy_each(each_blocks, detaching); if (detaching) detach(each_1_anchor); } }; } function formatBalance(balance) { const [asset] = Object.keys(balance); return `${balance[asset].length > 7 ? balance[asset].slice(0, 7) : balance[asset]} ${asset}`; } function instance$7($$self, $$props, $$invalidate) { let $_; component_subscribe($$self, _, $$value => $$invalidate(4, $_ = $$value)); let { wallet } = $$props; let { primary } = $$props; function hideMenu() { $$invalidate(3, showMenu = ''); } let showMenu = ''; async function selectAnotherAccount(wallet) { try { await selectAccounts(wallet.provider); } catch(error) { const { code } = error; if (code === ProviderRpcErrorCode.UNSUPPORTED_METHOD || code === ProviderRpcErrorCode.DOES_NOT_EXIST) { connectWallet$.next({ inProgress: false, actionRequired: wallet.label }); } } } function changeText() { $$invalidate(2, en.accountCenter.copyAddress = 'Copied Successfully', en); setTimeout(hideMenu, 500); setTimeout( () => { $$invalidate(2, en.accountCenter.copyAddress = 'Copy Wallet address', en); }, 700 ); } const click_handler = address => $$invalidate(3, showMenu = showMenu === address ? '' : address); const click_handler_1 = address => setPrimaryWallet(wallet, address); const click_handler_2 = () => { $$invalidate(3, showMenu = ''); selectAnotherAccount(wallet); }; const click_handler_3 = address => { $$invalidate(3, showMenu = ''); setPrimaryWallet(wallet, address); }; const click_handler_4 = () => { $$invalidate(3, showMenu = ''); disconnect({ label: wallet.label }); }; const click_handler_5 = (ens, uns, address) => { copyWalletAddress(ens ? ens.name : uns ? uns.name : address).then(() => { changeText(); }); }; $$self.$$set = $$props => { if ('wallet' in $$props) $$invalidate(0, wallet = $$props.wallet); if ('primary' in $$props) $$invalidate(1, primary = $$props.primary); }; return [ wallet, primary, en, showMenu, $_, selectAnotherAccount, changeText, hideMenu, click_handler, click_handler_1, click_handler_2, click_handler_3, click_handler_4, click_handler_5 ]; } class WalletRow extends SvelteComponent { constructor(options) { super(); init(this, options, instance$7, create_fragment$7, safe_not_equal, { wallet: 0, primary: 1, hideMenu: 7 }, add_css$7); } get hideMenu() { return this.$$.ctx[7]; } } var plusCircleIcon = ` <svg width="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13 7H11V11H7V13H11V17H13V13H17V11H13V7ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20Z" fill="currentColor"/> </svg> `; var arrowForwardIcon = ` <svg width="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M10.09 15.59L11.5 17L16.5 12L11.5 7L10.09 8.41L12.67 11H3V13H12.67L10.09 15.59ZM19 3H5C3.89 3 3 3.9 3 5V9H5V5H19V19H5V15H3V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z" fill="currentColor"/> </svg> `; var caretLightIcon = `<svg width="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z" fill="grey"/></svg>`; var shieldIcon = `<svg width="14" height="18" viewBox="0 0 14 18" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M6.99998 17.3125C5.05553 16.8264 3.45831 15.6979 2.20831 13.9271C0.958313 12.1562 0.333313 10.2153 0.333313 8.10417V3.14583L6.99998 0.645833L13.6666 3.14583V8.10417C13.6666 10.2153 13.0416 12.1562 11.7916 13.9271C10.5416 15.6979 8.94442 16.8264 6.99998 17.3125ZM5.12498 12.3333H8.87498C9.05553 12.3333 9.20484 12.2743 9.3229 12.1562C9.44095 12.0382 9.49998 11.8889 9.49998 11.7083V8.79167C9.49998 8.61111 9.44095 8.46181 9.3229 8.34375C9.20484 8.22569 9.05553 8.16667 8.87498 8.16667H8.66665V7.33333C8.66665 6.875 8.50345 6.48264 8.17706 6.15625C7.85067 5.82986 7.45831 5.66667 6.99998 5.66667C6.54165 5.66667 6.14928 5.82986 5.8229 6.15625C5.49651 6.48264 5.33331 6.875 5.33331 7.33333V8.16667H5.12498C4.94442 8.16667 4.79512 8.22569 4.67706 8.34375C4.55901 8.46181 4.49998 8.61111 4.49998 8.79167V11.7083C4.49998 11.8889 4.55901 12.0382 4.67706 12.1562C4.79512 12.2743 4.94442 12.3333 5.12498 12.3333ZM5.95831 8.16667V7.33333C5.95831 7.05556 6.06248 6.82292 6.27081 6.63542C6.47915 6.44792 6.7222 6.35417 6.99998 6.35417C7.27776 6.35417 7.52081 6.44792 7.72915 6.63542C7.93748 6.82292 8.04165 7.05556 8.04165 7.33333V8.16667H5.95831Z" fill="#929BED"/> </svg> `; /* src/views/account-center/DisconnectAllConfirm.svelte generated by Svelte v3.59.2 */ function add_css$6(target) { append_styles(target, "svelte-1ubxcdp", ".content.svelte-1ubxcdp{padding:1rem;width:300px;font-family:var(--onboard-font-family-normal, var(--font-family-normal));font-size:var(--onboard-font-size-5, var(--font-size-5));line-height:24px}.icon-container.svelte-1ubxcdp{width:3rem;height:3rem;background:var(--onboard-warning-100, var(--warning-100));border-radius:24px;padding:12px;color:var(--onboard-warning-500, var(--warning-500))}h4.svelte-1ubxcdp{margin:1.5rem 0 0.5rem 0;font-weight:600}p.svelte-1ubxcdp{margin:0;font-weight:400}button.svelte-1ubxcdp{margin-top:1.5rem;width:50%;font-weight:600}.right.svelte-1ubxcdp{margin-left:0.5rem;width:60%}"); } // (49:0) <Modal close={onClose}> function create_default_slot$1(ctx) { let div2; let div0; let t0; let h4; let t1_value = /*$_*/ ctx[2]('modals.confirmDisconnectAll.heading', { default: en.modals.confirmDisconnectAll.heading }) + ""; let t1; let t2; let p; let t3_value = /*$_*/ ctx[2]('modals.confirmDisconnectAll.description') + ""; let t3; let t4; let div1; let button0; let t5_value = /*$_*/ ctx[2]('modals.confirmDisconnectAll.cancel', { default: en.modals.confirmDisconnectAll.cancel }) + ""; let t5; let t6; let button1; let t7_value = /*$_*/ ctx[2]('modals.confirmDisconnectAll.confirm', { default: en.modals.confirmDisconnectAll.confirm }) + ""; let t7; let mounted; let dispose; return { c() { div2 = element("div"); div0 = element("div"); t0 = space(); h4 = element("h4"); t1 = text(t1_value); t2 = space(); p = element("p"); t3 = text(t3_value); t4 = space(); div1 = element("div"); button0 = element("button"); t5 = text(t5_value); t6 = space(); button1 = element("button"); t7 = text(t7_value); attr(div0, "class", "icon-container flex justify-center items-center svelte-1ubxcdp"); attr(h4, "class", "svelte-1ubxcdp"); attr(p, "class", "svelte-1ubxcdp"); attr(button0, "class", "button-neutral-solid-b rounded svelte-1ubxcdp"); attr(button1, "class", "right button-neutral-solid rounded svelte-1ubxcdp"); attr(div1, "class", "flex justify-between items-center w-100"); attr(div2, "class", "content svelte-1ubxcdp"); }, m(target, anchor) { insert(target, div2, anchor); append(div2, div0); div0.innerHTML = warningIcon; append(div2, t0); append(div2, h4); append(h4, t1); append(div2, t2); append(div2, p); append(p, t3); append(div2, t4); append(div2, div1); append(div1, button0); append(button0, t5); append(div1, t6); append(div1, button1); append(button1, t7); if (!mounted) { dispose = [ listen(button0, "click", function () { if (is_function(/*onClose*/ ctx[1])) /*onClose*/ ctx[1].apply(this, arguments); }), listen(button1, "click", function () { if (is_function(/*onConfirm*/ ctx[0])) /*onConfirm*/ ctx[0].apply(this, arguments); }) ]; mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; if (dirty & /*$_*/ 4 && t1_value !== (t1_value = /*$_*/ ctx[2]('modals.confirmDisconnectAll.heading', { default: en.modals.confirmDisconnectAll.heading }) + "")) set_data(t1, t1_value); if (dirty & /*$_*/ 4 && t3_value !== (t3_value = /*$_*/ ctx[2]('modals.confirmDisconnectAll.description') + "")) set_data(t3, t3_value); if (dirty & /*$_*/ 4 && t5_value !== (t5_value = /*$_*/ ctx[2]('modals.confirmDisconnectAll.cancel', { default: en.modals.confirmDisconnectAll.cancel }) + "")) set_data(t5, t5_value); if (dirty & /*$_*/ 4 && t7_value !== (t7_value = /*$_*/ ctx[2]('modals.confirmDisconnectAll.confirm', { default: en.modals.confirmDisconnectAll.confirm }) + "")) set_data(t7, t7_value); }, d(detaching) { if (detaching) detach(div2); mounted = false; run_all(dispose); } }; } function create_fragment$6(ctx) { let modal; let current; modal = new Modal({ props: { close: /*onClose*/ ctx[1], $$slots: { default: [create_default_slot$1] }, $$scope: { ctx } } }); return { c() { create_component(modal.$$.fragment); }, m(target, anchor) { mount_component(modal, target, anchor); current = true; }, p(ctx, [dirty]) { const modal_changes = {}; if (dirty & /*onClose*/ 2) modal_changes.close = /*onClose*/ ctx[1]; if (dirty & /*$$scope, onConfirm, $_, onClose*/ 15) { modal_changes.$$scope = { dirty, ctx }; } modal.$set(modal_changes); }, i(local) { if (current) return; transition_in(modal.$$.fragment, local); current = true; }, o(local) { transition_out(modal.$$.fragment, local); current = false; }, d(detaching) { destroy_component(modal, detaching); } }; } function instance$6($$self, $$props, $$invalidate) { let $_; component_subscribe($$self, _, $$value => $$invalidate(2, $_ = $$value)); let { onConfirm } = $$props; let { onClose } = $$props; $$self.$$set = $$props => { if ('onConfirm' in $$props) $$invalidate(0, onConfirm = $$props.onConfirm); if ('onClose' in $$props) $$invalidate(1, onClose = $$props.onClose); }; return [onConfirm, onClose, $_]; } class DisconnectAllConfirm extends SvelteComponent { constructor(options) { super(); init(this, options, instance$6, create_fragment$6, safe_not_equal, { onConfirm: 0, onClose: 1 }, add_css$6); } } /* src/views/account-center/EnableTransactionProtectionModal.svelte generated by Svelte v3.59.2 */ function add_css$5(target) { append_styles(target, "svelte-ruodf3", ".content.svelte-ruodf3{--background-color:var(--w3o-background-color);--text-color:var(--w3o-text-color);--action-color:var(--w3o-action-color, var(--primary-500));font-size:1rem;line-height:1.5rem;display:flex;flex-flow:column;gap:1.5rem;padding:1rem;max-width:320px;background:var(--background-color);color:var(--text-color)}.icon-container.svelte-ruodf3{position:relative;overflow:hidden;width:3rem;height:3rem;border-radius:24px;padding:0.75rem;background:none}.icon-container.svelte-ruodf3::before{content:'';position:absolute;height:100%;width:100%;opacity:0.2;background:var(--action-color)}.text-container.svelte-ruodf3{display:flex;flex-flow:column;gap:0.5rem;padding:0 0.5rem}.actions-container.svelte-ruodf3{display:flex;flex-flow:row nowrap;gap:1rem}.heading.svelte-ruodf3{font-weight:600}button.svelte-ruodf3{font-weight:600}button.primary.svelte-ruodf3{background:var(--action-color)}"); } // (73:0) <Modal close={onDismiss}> function create_default_slot(ctx) { let div5; let div0; let t0; let div3; let div1; let t1_value = /*$_*/ ctx[3]('modals.confirmTransactionProtection.heading', { default: en.modals.confirmTransactionProtection.heading }) + ""; let t1; let t2; let div2; let t3_value = /*$_*/ ctx[3]('modals.confirmTransactionProtection.description') + ""; let t3; let t4; let a; let t5_value = /*$_*/ ctx[3]('modals.confirmTransactionProtection.link', { default: en.modals.confirmTransactionProtection.link }) + ""; let t5; let t6; let div4; let button0; let t7_value = /*$_*/ ctx[3]('modals.confirmTransactionProtection.dismiss', { default: en.modals.confirmTransactionProtection.dismiss }) + ""; let t7; let t8; let button1; let t9_value = /*$_*/ ctx[3]('modals.confirmTransactionProtection.enable', { default: en.modals.confirmTransactionProtection.enable }) + ""; let t9; let mounted; let dispose; return { c() { div5 = element("div"); div0 = element("div"); t0 = space(); div3 = element("div"); div1 = element("div"); t1 = text(t1_value); t2 = space(); div2 = element("div"); t3 = text(t3_value); t4 = space(); a = element("a"); t5 = text(t5_value); t6 = space(); div4 = element("div"); button0 = element("button"); t7 = text(t7_value); t8 = space(); button1 = element("button"); t9 = text(t9_value); attr(div0, "class", "icon-container flex justify-center items-center svelte-ruodf3"); attr(div1, "class", "heading svelte-ruodf3"); attr(a, "href", /*infoLink*/ ctx[2]); attr(a, "target", "_blank"); attr(a, "rel", "noreferrer noopener"); attr(a, "class", "no-link"); attr(div3, "class", "text-container svelte-ruodf3"); attr(button0, "class", "button-neutral-solid-b svelte-ruodf3"); attr(button1, "class", "button-neutral-solid rounded primary svelte-ruodf3"); attr(div4, "class", "actions-container svelte-ruodf3"); attr(div5, "class", "content svelte-ruodf3"); }, m(target, anchor) { insert(target, div5, anchor); append(div5, div0); div0.innerHTML = shieldIcon; append(div5, t0); append(div5, div3); append(div3, div1); append(div1, t1); append(div3, t2); append(div3, div2); append(div2, t3); append(div3, t4); append(div3, a); append(a, t5); append(div5, t6); append(div5, div4); append(div4, button0); append(button0, t7); append(div4, t8); append(div4, button1); append(button1, t9); if (!mounted) { dispose = [ listen(button0, "click", function () { if (is_function(/*onDismiss*/ ctx[1])) /*onDismiss*/ ctx[1].apply(this, arguments); }), listen(button1, "click", function () { if (is_function(/*onEnable*/ ctx[0])) /*onEnable*/ ctx[0].apply(this, arguments); }) ]; mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; if (dirty & /*$_*/ 8 && t1_value !== (t1_value = /*$_*/ ctx[3]('modals.confirmTransactionProtection.heading', { default: en.modals.confirmTransactionProtection.heading }) + "")) set_data(t1, t1_value); if (dirty & /*$_*/ 8 && t3_value !== (t3_value = /*$_*/ ctx[3]('modals.confirmTransactionProtection.description') + "")) set_data(t3, t3_value); if (dirty & /*$_*/ 8 && t5_value !== (t5_value = /*$_*/ ctx[3]('modals.confirmTransactionProtection.link', { default: en.modals.confirmTransactionProtection.link }) + "")) set_data(t5, t5_value); if (dirty & /*infoLink*/ 4) { attr(a, "href", /*infoLink*/ ctx[2]); } if (dirty & /*$_*/ 8 && t7_value !== (t7_value = /*$_*/ ctx[3]('modals.confirmTransactionProtection.dismiss', { default: en.modals.confirmTransactionProtection.dismiss }) + "")) set_data(t7, t7_value); if (dirty & /*$_*/ 8 && t9_value !== (t9_value = /*$_*/ ctx[3]('modals.confirmTransactionProtection.enable', { default: en.modals.confirmTransactionProtection.enable }) + "")) set_data(t9, t9_value); }, d(detaching) { if (detaching) detach(div5); mounted = false; run_all(dispose); } }; } function create_fragment$5(ctx) { let modal; let current; modal = new Modal({ props: { close: /*onDismiss*/ ctx[1], $$slots: { default: [create_default_slot] }, $$scope: { ctx } } }); return { c() { create_component(modal.$$.fragment); }, m(target, anchor) { mount_component(modal, target, anchor); current = true; }, p(ctx, [dirty]) { const modal_changes = {}; if (dirty & /*onDismiss*/ 2) modal_changes.close = /*onDismiss*/ ctx[1]; if (dirty & /*$$scope, onEnable, $_, onDismiss, infoLink*/ 31) { modal_changes.$$scope = { dirty, ctx }; } modal.$set(modal_changes); }, i(local) { if (current) return; transition_in(modal.$$.fragment, local); current = true; }, o(local) { transition_out(modal.$$.fragment, local); current = false; }, d(detaching) { destroy_component(modal, detaching); } }; } function instance$5($$self, $$props, $$invalidate) { let $_; component_subscribe($$self, _, $$value => $$invalidate(3, $_ = $$value)); let { onEnable } = $$props; let { onDismiss } = $$props; let { infoLink } = $$props; $$self.$$set = $$props => { if ('onEnable' in $$props) $$invalidate(0, onEnable = $$props.onEnable); if ('onDismiss' in $$props) $$invalidate(1, onDismiss = $$props.onDismiss); if ('infoLink' in $$props) $$invalidate(2, infoLink = $$props.infoLink); }; return [onEnable, onDismiss, infoLink, $_]; } class EnableTransactionProtectionModal extends SvelteComponent { constructor(options) { super(); init(this, options, instance$5, create_fragment$5, safe_not_equal, { onEnable: 0, onDismiss: 1, infoLink: 2 }, add_css$5); } } /* src/views/account-center/SecondaryTokenTable.svelte generated by Svelte v3.59.2 */ function add_css$4(target) { append_styles(target, "svelte-b848yl", ".secondary-token-container.svelte-b848yl.svelte-b848yl{width:100%}table.svelte-b848yl.svelte-b848yl{width:100%}tr.svelte-b848yl.svelte-b848yl{padding:0.25rem 1rem;line-height:1rem;border-bottom:1px solid var(--border-color);display:flex;flex-direction:row;align-items:flex-start;gap:1rem}thead.svelte-b848yl .secondary-token-table-header.svelte-b848yl{text-align:inherit;font-size:var(--onboard-font-size-7, var(--font-size-7))}.token-icon.svelte-b848yl.svelte-b848yl{width:30%;font-weight:700;font-size:var(--onboard-font-size-6, var(--font-size-6));color:var(--text-color)}.icon-name-container.svelte-b848yl.svelte-b848yl{display:flex;flex-direction:row;align-items:flex-start;padding:0px;gap:0.5rem}.icon.svelte-b848yl.svelte-b848yl{width:1rem;height:1rem}img.svelte-b848yl.svelte-b848yl{height:100%;width:100%}.token-balance.svelte-b848yl.svelte-b848yl{width:70%;font-weight:200;font-size:var(--onboard-font-size-6, var