import { b as TailwindStyledElement, x, E } from './index-5X9ujrWL.js';
import { n } from './property-DfumgIL6.js';
import { c as ce } from './index-B9iart53.js';
import { s as safeCustomElement } from './safe-custom-element-qdGIR_v6.js';
import { c as customStyleMap } from './index-CZGvLdJ0.js';
import '../tailwind-config.js';
import { c as cn } from './axe-DJKac19y.js';
import { i as isAddress$1 } from './isAddress-BUdSrCaY.js';

const sliceAddress = (address, startSliceBy = 6, endSliceBy) => {
  if (!address || typeof address !== "string") {
    return "";
  }
  let sliceAddress2 = "";
  const effectiveEndSliceBy = endSliceBy || startSliceBy;
  if (address.length < startSliceBy + effectiveEndSliceBy) {
    return address;
  }
  sliceAddress2 = address.length > startSliceBy + 2 ? `${address.slice(0, startSliceBy + 2)}...${address.slice(
    -effectiveEndSliceBy
  )}` : address;
  return sliceAddress2;
};

function number(n) {
    if (!Number.isSafeInteger(n) || n < 0)
        throw new Error(`positive integer expected, not ${n}`);
}
function bool(b) {
    if (typeof b !== 'boolean')
        throw new Error(`boolean expected, not ${b}`);
}
// copied from utils
function isBytes(a) {
    return (a instanceof Uint8Array ||
        (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array'));
}
function bytes(b, ...lengths) {
    if (!isBytes(b))
        throw new Error('Uint8Array expected');
    if (lengths.length > 0 && !lengths.includes(b.length))
        throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`);
}
function hash(h) {
    if (typeof h !== 'function' || typeof h.create !== 'function')
        throw new Error('Hash should be wrapped by utils.wrapConstructor');
    number(h.outputLen);
    number(h.blockLen);
}
function exists(instance, checkFinished = true) {
    if (instance.destroyed)
        throw new Error('Hash instance has been destroyed');
    if (checkFinished && instance.finished)
        throw new Error('Hash#digest() has already been called');
}
function output(out, instance) {
    bytes(out);
    const min = instance.outputLen;
    if (out.length < min) {
        throw new Error(`digestInto() expects output buffer of length at least ${min}`);
    }
}
const assert = { number, bool, bytes, hash, exists, output };

const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
const _32n = /* @__PURE__ */ BigInt(32);
// We are not using BigUint64Array, because they are extremely slow as per 2022
function fromBig(n, le = false) {
    if (le)
        return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };
    return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
}
function split(lst, le = false) {
    let Ah = new Uint32Array(lst.length);
    let Al = new Uint32Array(lst.length);
    for (let i = 0; i < lst.length; i++) {
        const { h, l } = fromBig(lst[i], le);
        [Ah[i], Al[i]] = [h, l];
    }
    return [Ah, Al];
}
// Left rotate for Shift in [1, 32)
const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));
const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));
// Left rotate for Shift in (32, 64), NOTE: 32 is special case.
const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));
const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));

/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.
// node.js versions earlier than v19 don't declare it in global scope.
// For node.js, package.json#exports field mapping rewrites import
// from `crypto` to `cryptoNode`, which imports native module.
// Makes the utils un-importable in browsers without a bundler.
// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.
const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;
// The byte swap operation for uint32
const byteSwap = (word) => ((word << 24) & 0xff000000) |
    ((word << 8) & 0xff0000) |
    ((word >>> 8) & 0xff00) |
    ((word >>> 24) & 0xff);
// In place byte swap for Uint32Array
function byteSwap32(arr) {
    for (let i = 0; i < arr.length; i++) {
        arr[i] = byteSwap(arr[i]);
    }
}
/**
 * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])
 */
function utf8ToBytes$1(str) {
    if (typeof str !== 'string')
        throw new Error(`utf8ToBytes expected string, got ${typeof str}`);
    return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809
}
/**
 * Normalizes (non-hex) string or Uint8Array to Uint8Array.
 * Warning: when Uint8Array is passed, it would NOT get copied.
 * Keep in mind for future mutable operations.
 */
function toBytes(data) {
    if (typeof data === 'string')
        data = utf8ToBytes$1(data);
    bytes(data);
    return data;
}
// For runtime check if class implements interface
class Hash {
    // Safe version that clones internal state
    clone() {
        return this._cloneInto();
    }
}
function wrapConstructor(hashCons) {
    const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
    const tmp = hashCons();
    hashC.outputLen = tmp.outputLen;
    hashC.blockLen = tmp.blockLen;
    hashC.create = () => hashCons();
    return hashC;
}

// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.
// It's called a sponge function.
// Various per round constants calculations
const SHA3_PI = [];
const SHA3_ROTL = [];
const _SHA3_IOTA = [];
const _0n = /* @__PURE__ */ BigInt(0);
const _1n = /* @__PURE__ */ BigInt(1);
const _2n = /* @__PURE__ */ BigInt(2);
const _7n = /* @__PURE__ */ BigInt(7);
const _256n = /* @__PURE__ */ BigInt(256);
const _0x71n = /* @__PURE__ */ BigInt(0x71);
for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
    // Pi
    [x, y] = [y, (2 * x + 3 * y) % 5];
    SHA3_PI.push(2 * (5 * y + x));
    // Rotational
    SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);
    // Iota
    let t = _0n;
    for (let j = 0; j < 7; j++) {
        R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;
        if (R & _2n)
            t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);
    }
    _SHA3_IOTA.push(t);
}
const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true);
// Left rotation (without 0, 32, 64)
const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));
const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));
// Same as keccakf1600, but allows to skip some rounds
function keccakP(s, rounds = 24) {
    const B = new Uint32Array(5 * 2);
    // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)
    for (let round = 24 - rounds; round < 24; round++) {
        // Theta θ
        for (let x = 0; x < 10; x++)
            B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
        for (let x = 0; x < 10; x += 2) {
            const idx1 = (x + 8) % 10;
            const idx0 = (x + 2) % 10;
            const B0 = B[idx0];
            const B1 = B[idx0 + 1];
            const Th = rotlH(B0, B1, 1) ^ B[idx1];
            const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
            for (let y = 0; y < 50; y += 10) {
                s[x + y] ^= Th;
                s[x + y + 1] ^= Tl;
            }
        }
        // Rho (ρ) and Pi (π)
        let curH = s[2];
        let curL = s[3];
        for (let t = 0; t < 24; t++) {
            const shift = SHA3_ROTL[t];
            const Th = rotlH(curH, curL, shift);
            const Tl = rotlL(curH, curL, shift);
            const PI = SHA3_PI[t];
            curH = s[PI];
            curL = s[PI + 1];
            s[PI] = Th;
            s[PI + 1] = Tl;
        }
        // Chi (χ)
        for (let y = 0; y < 50; y += 10) {
            for (let x = 0; x < 10; x++)
                B[x] = s[y + x];
            for (let x = 0; x < 10; x++)
                s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
        }
        // Iota (ι)
        s[0] ^= SHA3_IOTA_H[round];
        s[1] ^= SHA3_IOTA_L[round];
    }
    B.fill(0);
}
class Keccak extends Hash {
    // NOTE: we accept arguments in bytes instead of bits here.
    constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
        super();
        this.blockLen = blockLen;
        this.suffix = suffix;
        this.outputLen = outputLen;
        this.enableXOF = enableXOF;
        this.rounds = rounds;
        this.pos = 0;
        this.posOut = 0;
        this.finished = false;
        this.destroyed = false;
        // Can be passed from user as dkLen
        number(outputLen);
        // 1600 = 5x5 matrix of 64bit.  1600 bits === 200 bytes
        if (0 >= this.blockLen || this.blockLen >= 200)
            throw new Error('Sha3 supports only keccak-f1600 function');
        this.state = new Uint8Array(200);
        this.state32 = u32(this.state);
    }
    keccak() {
        if (!isLE)
            byteSwap32(this.state32);
        keccakP(this.state32, this.rounds);
        if (!isLE)
            byteSwap32(this.state32);
        this.posOut = 0;
        this.pos = 0;
    }
    update(data) {
        exists(this);
        const { blockLen, state } = this;
        data = toBytes(data);
        const len = data.length;
        for (let pos = 0; pos < len;) {
            const take = Math.min(blockLen - this.pos, len - pos);
            for (let i = 0; i < take; i++)
                state[this.pos++] ^= data[pos++];
            if (this.pos === blockLen)
                this.keccak();
        }
        return this;
    }
    finish() {
        if (this.finished)
            return;
        this.finished = true;
        const { state, suffix, pos, blockLen } = this;
        // Do the padding
        state[pos] ^= suffix;
        if ((suffix & 0x80) !== 0 && pos === blockLen - 1)
            this.keccak();
        state[blockLen - 1] ^= 0x80;
        this.keccak();
    }
    writeInto(out) {
        exists(this, false);
        bytes(out);
        this.finish();
        const bufferOut = this.state;
        const { blockLen } = this;
        for (let pos = 0, len = out.length; pos < len;) {
            if (this.posOut >= blockLen)
                this.keccak();
            const take = Math.min(blockLen - this.posOut, len - pos);
            out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
            this.posOut += take;
            pos += take;
        }
        return out;
    }
    xofInto(out) {
        // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF
        if (!this.enableXOF)
            throw new Error('XOF is not possible for this instance');
        return this.writeInto(out);
    }
    xof(bytes) {
        number(bytes);
        return this.xofInto(new Uint8Array(bytes));
    }
    digestInto(out) {
        output(out, this);
        if (this.finished)
            throw new Error('digest() was already called');
        this.writeInto(out);
        this.destroy();
        return out;
    }
    digest() {
        return this.digestInto(new Uint8Array(this.outputLen));
    }
    destroy() {
        this.destroyed = true;
        this.state.fill(0);
    }
    _cloneInto(to) {
        const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
        to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
        to.state32.set(this.state32);
        to.pos = this.pos;
        to.posOut = this.posOut;
        to.finished = this.finished;
        to.rounds = rounds;
        // Suffix can change in cSHAKE
        to.suffix = suffix;
        to.outputLen = outputLen;
        to.enableXOF = enableXOF;
        to.destroyed = this.destroyed;
        return to;
    }
}
const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));
/**
 * keccak-256 hash function. Different from SHA3-256.
 * @param message - that would be hashed
 */
const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8);

// Internal utils
function wrapHash(hash) {
    return (msg) => {
        assert.bytes(msg);
        return hash(msg);
    };
}
// TODO(v3): switch away from node crypto, remove this unnecessary variable.
(() => {
    const webCrypto = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : undefined;
    const nodeRequire = typeof module !== "undefined" &&
        typeof module.require === "function" &&
        module.require.bind(module);
    return {
        node: nodeRequire && !webCrypto ? nodeRequire("crypto") : undefined,
        web: webCrypto
    };
})();

const keccak256 = (() => {
    const k = wrapHash(keccak_256);
    k.create = keccak_256.create;
    return k;
})();

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
// Response error
const ERR_MULTIPLE_ERRORS = 208;
// RPC error codes (EIP-1193)
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md#provider-errors
const JSONRPC_ERR_REJECTED_REQUEST = 4001;
const JSONRPC_ERR_UNAUTHORIZED = 4100;
const JSONRPC_ERR_UNSUPPORTED_METHOD = 4200;
const JSONRPC_ERR_DISCONNECTED = 4900;
const JSONRPC_ERR_CHAIN_DISCONNECTED = 4901;
const ERR_INVALID_ADDRESS = 1005;
// RPC error codes (EIP-1474)
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md
const ERR_RPC_INVALID_JSON = -32700;
const ERR_RPC_INVALID_REQUEST = -32600;
const ERR_RPC_INVALID_METHOD = -32601;
const ERR_RPC_INVALID_PARAMS = -32602;
const ERR_RPC_INTERNAL_ERROR = -32603;
const ERR_RPC_INVALID_INPUT = -32e3;
const ERR_RPC_MISSING_RESOURCE = -32001;
const ERR_RPC_UNAVAILABLE_RESOURCE = -32002;
const ERR_RPC_TRANSACTION_REJECTED = -32003;
const ERR_RPC_UNSUPPORTED_METHOD = -32004;
const ERR_RPC_LIMIT_EXCEEDED = -32005;
const ERR_RPC_NOT_SUPPORTED = -32006;

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
/**
 * Base class for Web3 errors.
 */
class BaseWeb3Error extends Error {
    /**
     * @deprecated Use the `cause` property instead.
     */
    get innerError() {
        // eslint-disable-next-line no-use-before-define
        if (this.cause instanceof MultipleErrors) {
            return this.cause.errors;
        }
        return this.cause;
    }
    /**
     * @deprecated Use the `cause` property instead.
     */
    set innerError(cause) {
        if (Array.isArray(cause)) {
            // eslint-disable-next-line no-use-before-define
            this.cause = new MultipleErrors(cause);
        }
        else {
            this.cause = cause;
        }
    }
    constructor(msg, cause) {
        super(msg);
        if (Array.isArray(cause)) {
            // eslint-disable-next-line no-use-before-define
            this.cause = new MultipleErrors(cause);
        }
        else {
            this.cause = cause;
        }
        this.name = this.constructor.name;
        if (typeof Error.captureStackTrace === 'function') {
            Error.captureStackTrace(new.target.constructor);
        }
        else {
            this.stack = new Error().stack;
        }
    }
    static convertToString(value, unquotValue = false) {
        // Using "null" value intentionally for validation
        // eslint-disable-next-line no-null/no-null
        if (value === null || value === undefined)
            return 'undefined';
        const result = JSON.stringify(value, (_, v) => (typeof v === 'bigint' ? v.toString() : v));
        return unquotValue && ['bigint', 'string'].includes(typeof value)
            ? result.replace(/['\\"]+/g, '')
            : result;
    }
    toJSON() {
        return {
            name: this.name,
            code: this.code,
            message: this.message,
            cause: this.cause,
            // deprecated
            innerError: this.cause,
        };
    }
}
class MultipleErrors extends BaseWeb3Error {
    constructor(errors) {
        super(`Multiple errors occurred: [${errors.map(e => e.message).join('], [')}]`);
        this.code = ERR_MULTIPLE_ERRORS;
        this.errors = errors;
    }
}
class InvalidValueError extends BaseWeb3Error {
    constructor(value, msg) {
        super(`Invalid value given "${BaseWeb3Error.convertToString(value, true)}". Error: ${msg}.`);
        this.name = this.constructor.name;
    }
}

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
/* eslint-disable max-classes-per-file */
class InvalidAddressError extends InvalidValueError {
    constructor(value) {
        super(value, 'invalid ethereum address');
        this.code = ERR_INVALID_ADDRESS;
    }
}

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
/**
 * A template string for a generic Rpc Error. The `*code*` will be replaced with the code number.
 * Note: consider in next version that a spelling mistake could be corrected for `occured` and the value could be:
 * 	`An Rpc error has occurred with a code of *code*`
 */
const genericRpcErrorMessageTemplate = 'An Rpc error has occured with a code of *code*';
/* eslint-disable @typescript-eslint/naming-convention */
const RpcErrorMessages = {
    //  EIP-1474 & JSON RPC 2.0
    // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md
    [ERR_RPC_INVALID_JSON]: {
        message: 'Parse error',
        description: 'Invalid JSON',
    },
    [ERR_RPC_INVALID_REQUEST]: {
        message: 'Invalid request',
        description: 'JSON is not a valid request object	',
    },
    [ERR_RPC_INVALID_METHOD]: {
        message: 'Method not found',
        description: 'Method does not exist	',
    },
    [ERR_RPC_INVALID_PARAMS]: {
        message: 'Invalid params',
        description: 'Invalid method parameters',
    },
    [ERR_RPC_INTERNAL_ERROR]: {
        message: 'Internal error',
        description: 'Internal JSON-RPC error',
    },
    [ERR_RPC_INVALID_INPUT]: {
        message: 'Invalid input',
        description: 'Missing or invalid parameters',
    },
    [ERR_RPC_MISSING_RESOURCE]: {
        message: 'Resource not found',
        description: 'Requested resource not found',
    },
    [ERR_RPC_UNAVAILABLE_RESOURCE]: {
        message: 'Resource unavailable',
        description: 'Requested resource not available',
    },
    [ERR_RPC_TRANSACTION_REJECTED]: {
        message: 'Transaction rejected',
        description: 'Transaction creation failed',
    },
    [ERR_RPC_UNSUPPORTED_METHOD]: {
        message: 'Method not supported',
        description: 'Method is not implemented',
    },
    [ERR_RPC_LIMIT_EXCEEDED]: {
        message: 'Limit exceeded',
        description: 'Request exceeds defined limit',
    },
    [ERR_RPC_NOT_SUPPORTED]: {
        message: 'JSON-RPC version not supported',
        description: 'Version of JSON-RPC protocol is not supported',
    },
    // EIP-1193
    // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md#provider-errors
    [JSONRPC_ERR_REJECTED_REQUEST]: {
        name: 'User Rejected Request',
        message: 'The user rejected the request.',
    },
    [JSONRPC_ERR_UNAUTHORIZED]: {
        name: 'Unauthorized',
        message: 'The requested method and/or account has not been authorized by the user.',
    },
    [JSONRPC_ERR_UNSUPPORTED_METHOD]: {
        name: 'Unsupported Method',
        message: 'The Provider does not support the requested method.',
    },
    [JSONRPC_ERR_DISCONNECTED]: {
        name: 'Disconnected',
        message: 'The Provider is disconnected from all chains.',
    },
    [JSONRPC_ERR_CHAIN_DISCONNECTED]: {
        name: 'Chain Disconnected',
        message: 'The Provider is not connected to the requested chain.',
    },
    // EIP-1193 - CloseEvent
    // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code
    '0-999': {
        name: '',
        message: 'Not used.',
    },
    1000: {
        name: 'Normal Closure',
        message: 'The connection successfully completed the purpose for which it was created.',
    },
    1001: {
        name: 'Going Away',
        message: 'The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.',
    },
    1002: {
        name: 'Protocol error',
        message: 'The endpoint is terminating the connection due to a protocol error.',
    },
    1003: {
        name: 'Unsupported Data',
        message: 'The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)',
    },
    1004: {
        name: 'Reserved',
        message: 'Reserved. A meaning might be defined in the future.',
    },
    1005: {
        name: 'No Status Rcvd',
        message: 'Reserved. Indicates that no status code was provided even though one was expected.',
    },
    1006: {
        name: 'Abnormal Closure',
        message: 'Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected.',
    },
    1007: {
        name: 'Invalid frame payload data',
        message: 'The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message).',
    },
    1008: {
        name: 'Policy Violation',
        message: 'The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable.',
    },
    1009: {
        name: 'Message Too Big',
        message: 'The endpoint is terminating the connection because a data frame was received that is too large.',
    },
    1010: {
        name: 'Mandatory Ext.',
        message: "The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't.",
    },
    1011: {
        name: 'Internal Error',
        message: 'The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.',
    },
    1012: {
        name: 'Service Restart',
        message: 'The server is terminating the connection because it is restarting.',
    },
    1013: {
        name: 'Try Again Later',
        message: 'The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients.',
    },
    1014: {
        name: 'Bad Gateway',
        message: 'The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code.',
    },
    1015: {
        name: 'TLS handshake',
        message: "Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).",
    },
    '1016-2999': {
        name: '',
        message: 'For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications.',
    },
    '3000-3999': {
        name: '',
        message: 'For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol.',
    },
    '4000-4999': {
        name: '',
        message: "For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol.",
    },
};

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
class RpcError extends BaseWeb3Error {
    constructor(rpcError, message) {
        super(message !== null && message !== void 0 ? message : genericRpcErrorMessageTemplate.replace('*code*', rpcError.error.code.toString()));
        this.code = rpcError.error.code;
        this.id = rpcError.id;
        this.jsonrpc = rpcError.jsonrpc;
        this.jsonRpcError = rpcError.error;
    }
    toJSON() {
        return Object.assign(Object.assign({}, super.toJSON()), { error: this.jsonRpcError, id: this.id, jsonRpc: this.jsonrpc });
    }
}
class ParseError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_JSON].message);
        this.code = ERR_RPC_INVALID_JSON;
    }
}
class InvalidRequestError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_REQUEST].message);
        this.code = ERR_RPC_INVALID_REQUEST;
    }
}
class MethodNotFoundError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_METHOD].message);
        this.code = ERR_RPC_INVALID_METHOD;
    }
}
class InvalidParamsError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_PARAMS].message);
        this.code = ERR_RPC_INVALID_PARAMS;
    }
}
class InternalError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_INTERNAL_ERROR].message);
        this.code = ERR_RPC_INTERNAL_ERROR;
    }
}
class InvalidInputError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_INPUT].message);
        this.code = ERR_RPC_INVALID_INPUT;
    }
}
class MethodNotSupported extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_UNSUPPORTED_METHOD].message);
        this.code = ERR_RPC_UNSUPPORTED_METHOD;
    }
}
class ResourceUnavailableError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_UNAVAILABLE_RESOURCE].message);
        this.code = ERR_RPC_UNAVAILABLE_RESOURCE;
    }
}
class ResourcesNotFoundError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_MISSING_RESOURCE].message);
        this.code = ERR_RPC_MISSING_RESOURCE;
    }
}
class VersionNotSupportedError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_NOT_SUPPORTED].message);
        this.code = ERR_RPC_NOT_SUPPORTED;
    }
}
class TransactionRejectedError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_TRANSACTION_REJECTED].message);
        this.code = ERR_RPC_TRANSACTION_REJECTED;
    }
}
class LimitExceededError extends RpcError {
    constructor(rpcError) {
        super(rpcError, RpcErrorMessages[ERR_RPC_LIMIT_EXCEEDED].message);
        this.code = ERR_RPC_LIMIT_EXCEEDED;
    }
}
const rpcErrorsMap = new Map();
rpcErrorsMap.set(ERR_RPC_INVALID_JSON, { error: ParseError });
rpcErrorsMap.set(ERR_RPC_INVALID_REQUEST, {
    error: InvalidRequestError,
});
rpcErrorsMap.set(ERR_RPC_INVALID_METHOD, {
    error: MethodNotFoundError,
});
rpcErrorsMap.set(ERR_RPC_INVALID_PARAMS, { error: InvalidParamsError });
rpcErrorsMap.set(ERR_RPC_INTERNAL_ERROR, { error: InternalError });
rpcErrorsMap.set(ERR_RPC_INVALID_INPUT, { error: InvalidInputError });
rpcErrorsMap.set(ERR_RPC_UNSUPPORTED_METHOD, {
    error: MethodNotSupported,
});
rpcErrorsMap.set(ERR_RPC_UNAVAILABLE_RESOURCE, {
    error: ResourceUnavailableError,
});
rpcErrorsMap.set(ERR_RPC_TRANSACTION_REJECTED, {
    error: TransactionRejectedError,
});
rpcErrorsMap.set(ERR_RPC_MISSING_RESOURCE, {
    error: ResourcesNotFoundError,
});
rpcErrorsMap.set(ERR_RPC_NOT_SUPPORTED, {
    error: VersionNotSupportedError,
});
rpcErrorsMap.set(ERR_RPC_LIMIT_EXCEEDED, { error: LimitExceededError });

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
/**
 * checks input if typeof data is valid string input
 */
const isHexStrict = (hex) => typeof hex === 'string' && /^((-)?0x[0-9a-f]+|(0x))$/i.test(hex);

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
function uint8ArrayToHexString(uint8Array) {
    let hexString = '0x';
    for (const e of uint8Array) {
        const hex = e.toString(16);
        hexString += hex.length === 1 ? `0${hex}` : hex;
    }
    return hexString;
}
// @TODO: Remove this function and its usages once all sub dependencies uses version 1.3.3 or above of @noble/hashes
function ensureIfUint8Array(data) {
    var _a;
    if (!(data instanceof Uint8Array) &&
        ((_a = data === null || data === void 0 ? void 0 : data.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Uint8Array') {
        return Uint8Array.from(data);
    }
    return data;
}

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
/**
 * checks input if typeof data is valid Uint8Array input
 */
const isUint8Array = (data) => { var _a, _b; return data instanceof Uint8Array || ((_a = data === null || data === void 0 ? void 0 : data.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Uint8Array' || ((_b = data === null || data === void 0 ? void 0 : data.constructor) === null || _b === void 0 ? void 0 : _b.name) === 'Buffer'; };

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
/**
 * Checks the checksum of a given address. Will also return false on non-checksum addresses.
 */
const checkAddressCheckSum = (data) => {
    if (!/^(0x)?[0-9a-f]{40}$/i.test(data))
        return false;
    const address = data.slice(2);
    const updatedData = utf8ToBytes$1(address.toLowerCase());
    const addressHash = uint8ArrayToHexString(keccak256(ensureIfUint8Array(updatedData))).slice(2);
    for (let i = 0; i < 40; i += 1) {
        // the nth letter should be uppercase if the nth digit of casemap is 1
        if ((parseInt(addressHash[i], 16) > 7 && address[i].toUpperCase() !== address[i]) ||
            (parseInt(addressHash[i], 16) <= 7 && address[i].toLowerCase() !== address[i])) {
            return false;
        }
    }
    return true;
};
/**
 * Checks if a given string is a valid Ethereum address. It will also check the checksum, if the address has upper and lowercase letters.
 */
const isAddress = (value, checkChecksum = true) => {
    if (typeof value !== 'string' && !isUint8Array(value)) {
        return false;
    }
    let valueToCheck;
    if (isUint8Array(value)) {
        valueToCheck = uint8ArrayToHexString(value);
    }
    else if (typeof value === 'string' && !isHexStrict(value)) {
        valueToCheck = value.toLowerCase().startsWith('0x') ? value : `0x${value}`;
    }
    else {
        valueToCheck = value;
    }
    // check if it has the basic requirements of an address
    if (!/^(0x)?[0-9a-f]{40}$/i.test(valueToCheck)) {
        return false;
    }
    // If it's ALL lowercase or ALL upppercase
    if (/^(0x|0X)?[0-9a-f]{40}$/.test(valueToCheck) ||
        /^(0x|0X)?[0-9A-F]{40}$/.test(valueToCheck)) {
        return true;
        // Otherwise check each case
    }
    return checkChecksum ? checkAddressCheckSum(valueToCheck) : true;
};

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
var FMT_NUMBER;
(function (FMT_NUMBER) {
    FMT_NUMBER["NUMBER"] = "NUMBER_NUMBER";
    FMT_NUMBER["HEX"] = "NUMBER_HEX";
    FMT_NUMBER["STR"] = "NUMBER_STR";
    FMT_NUMBER["BIGINT"] = "NUMBER_BIGINT";
})(FMT_NUMBER || (FMT_NUMBER = {}));
var FMT_BYTES;
(function (FMT_BYTES) {
    FMT_BYTES["HEX"] = "BYTES_HEX";
    FMT_BYTES["UINT8ARRAY"] = "BYTES_UINT8ARRAY";
})(FMT_BYTES || (FMT_BYTES = {}));
({
    number: FMT_NUMBER.BIGINT,
    bytes: FMT_BYTES.HEX,
});
({ number: FMT_NUMBER.HEX, bytes: FMT_BYTES.HEX });

var BlockTags;
(function (BlockTags) {
    BlockTags["EARLIEST"] = "earliest";
    BlockTags["LATEST"] = "latest";
    BlockTags["PENDING"] = "pending";
    BlockTags["SAFE"] = "safe";
    BlockTags["FINALIZED"] = "finalized";
    BlockTags["COMMITTED"] = "committed";
})(BlockTags || (BlockTags = {}));
// This list of hardforks is expected to be in order
// keep this in mind when making changes to it
var HardforksOrdered;
(function (HardforksOrdered) {
    HardforksOrdered["chainstart"] = "chainstart";
    HardforksOrdered["frontier"] = "frontier";
    HardforksOrdered["homestead"] = "homestead";
    HardforksOrdered["dao"] = "dao";
    HardforksOrdered["tangerineWhistle"] = "tangerineWhistle";
    HardforksOrdered["spuriousDragon"] = "spuriousDragon";
    HardforksOrdered["byzantium"] = "byzantium";
    HardforksOrdered["constantinople"] = "constantinople";
    HardforksOrdered["petersburg"] = "petersburg";
    HardforksOrdered["istanbul"] = "istanbul";
    HardforksOrdered["muirGlacier"] = "muirGlacier";
    HardforksOrdered["berlin"] = "berlin";
    HardforksOrdered["london"] = "london";
    HardforksOrdered["altair"] = "altair";
    HardforksOrdered["arrowGlacier"] = "arrowGlacier";
    HardforksOrdered["grayGlacier"] = "grayGlacier";
    HardforksOrdered["bellatrix"] = "bellatrix";
    HardforksOrdered["merge"] = "merge";
    HardforksOrdered["capella"] = "capella";
    HardforksOrdered["shanghai"] = "shanghai";
})(HardforksOrdered || (HardforksOrdered = {}));

(undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
// Explicitly check for the
// eslint-disable-next-line @typescript-eslint/ban-types
const isNullish = (item) => 
// Using "null" value intentionally for validation
// eslint-disable-next-line no-null/no-null
item === undefined || item === null;

/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
*/
/**
 * @module Utils
 */
// Ref: https://ethdocs.org/en/latest/ether.html
// Note: this could be simplified using ** operator, but babel does not handle it well (https://github.com/babel/babel/issues/13109)
/** @internal */
({
    noether: BigInt(0),
    wei: BigInt(1),
    kwei: BigInt(1000),
    Kwei: BigInt(1000),
    babbage: BigInt(1000),
    femtoether: BigInt(1000),
    mwei: BigInt(1000000),
    Mwei: BigInt(1000000),
    lovelace: BigInt(1000000),
    picoether: BigInt(1000000),
    gwei: BigInt(1000000000),
    Gwei: BigInt(1000000000),
    shannon: BigInt(1000000000),
    nanoether: BigInt(1000000000),
    nano: BigInt(1000000000),
    szabo: BigInt(1000000000000),
    microether: BigInt(1000000000000),
    micro: BigInt(1000000000000),
    finney: BigInt(1000000000000000),
    milliether: BigInt(1000000000000000),
    milli: BigInt(1000000000000000),
    ether: BigInt('1000000000000000000'),
    kether: BigInt('1000000000000000000000'),
    grand: BigInt('1000000000000000000000'),
    mether: BigInt('1000000000000000000000000'),
    gether: BigInt('1000000000000000000000000000'),
    tether: BigInt('1000000000000000000000000000000'),
});
const utf8ToBytes = utf8ToBytes$1;
/**
 * Will convert an upper or lowercase Ethereum address to a checksum address.
 * @param address - An address string
 * @returns	The checksum address
 * @example
 * ```ts
 * web3.utils.toChecksumAddress('0xc1912fee45d61c87cc5ea59dae31190fffff232d');
 * > "0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d"
 * ```
 */
const toChecksumAddress = (address) => {
    if (!isAddress(address, false)) {
        throw new InvalidAddressError(address);
    }
    const lowerCaseAddress = address.toLowerCase().replace(/^0x/i, '');
    // calling `Uint8Array.from` because `noble-hashes` checks with `instanceof Uint8Array` that fails in some edge cases:
    // 	https://github.com/paulmillr/noble-hashes/issues/25#issuecomment-1750106284
    const hash = uint8ArrayToHexString(keccak256(ensureIfUint8Array(utf8ToBytes(lowerCaseAddress))));
    if (isNullish(hash) ||
        hash === '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470')
        return ''; // // EIP-1052 if hash is equal to c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470, keccak was given empty data
    let checksumAddress = '0x';
    const addressHash = hash.replace(/^0x/i, '');
    for (let i = 0; i < lowerCaseAddress.length; i += 1) {
        // If ith character is 8 to f then make it uppercase
        if (parseInt(addressHash[i], 16) > 7) {
            checksumAddress += lowerCaseAddress[i].toUpperCase();
        }
        else {
            checksumAddress += lowerCaseAddress[i];
        }
    }
    return checksumAddress;
};

const style = ":host {\n    display: inline-flex\n}";

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result) __defProp(target, key, result);
  return result;
};
let LuksoUsername = class extends TailwindStyledElement(style) {
  constructor() {
    super(...arguments);
    this.name = "";
    this.address = "";
    this.maxWidth = 200;
    this.size = "large";
    this.sliceBy = 8;
    this.addressColor = "";
    this.nameColor = "";
    this.customClass = "";
    this.hidePrefix = false;
    this.prefix = "@";
    this.noTransform = false;
    /** Width of the first 4 bytes of the address */
    this.bytesWidth = 52;
    this.styles = ce({
      slots: {
        wrapper: "inline-flex",
        name: "inline-block whitespace-nowrap overflow-hidden text-ellipsis",
        address: "inline-block",
        bytes: "inline-block"
      },
      variants: {
        size: {
          "2x-small": {
            wrapper: "paragraph-ptmono-10-bold"
          },
          "x-small": {
            wrapper: "paragraph-ptmono-10-bold"
          },
          small: {
            wrapper: "paragraph-ptmono-12-bold"
          },
          medium: {
            wrapper: "paragraph-ptmono-14-bold"
          },
          large: {
            wrapper: "paragraph-ptmono-16-bold"
          },
          "x-large": {
            wrapper: "paragraph-ptmono-24-bold"
          },
          "2x-large": {
            wrapper: "paragraph-ptmono-24-bold"
          }
        },
        hasNameColor: {
          false: {
            name: "text-transparent bg-clip-text bg-gradient-to-r from-gradient-1-start to-gradient-1-end"
          }
        },
        hasAddressColor: {
          false: {
            address: "text-neutral-20",
            bytes: "text-neutral-60"
          }
        }
      }
    });
  }
  transformName(name) {
    if (this.noTransform) {
      return name;
    }
    return name?.toLowerCase();
  }
  transformAddress(address) {
    if (this.noTransform || !isAddress$1(address)) {
      return address;
    }
    try {
      return toChecksumAddress(address);
    } catch (error) {
      console.warn(error);
      return address;
    }
  }
  addressBytesTemplate(styles) {
    const address = this.transformAddress(this.address);
    return x`<div
      class=${styles}
      style=${customStyleMap({
      [`color: var(--${this.addressColor})`]: this.addressColor !== ""
    })}
    >
      #${address.slice(2, 6)}
    </div>`;
  }
  nameTemplate(styles) {
    const name = this.transformName(this.name);
    return x`<div
      class=${styles}
      style=${customStyleMap({
      [`max-width: ${this.maxWidth - (this.address ? this.bytesWidth : 0)}px`]: true,
      [`color: var(--${this.nameColor})`]: this.nameColor !== ""
    })}
    >
      ${this.hidePrefix ? E : this.prefix}${name}
    </div>`;
  }
  addressTemplate(styles) {
    const address = this.transformAddress(this.address);
    return x`<div
      class=${styles}
      style=${customStyleMap({
      [`color: var(--${this.addressColor})`]: this.addressColor !== ""
    })}
    >
      ${sliceAddress(address, this.sliceBy, this.sliceBy)}
    </div>`;
  }
  render() {
    const { wrapper, name, address, bytes } = this.styles({
      size: this.size,
      hasNameColor: this.nameColor !== "",
      hasAddressColor: this.addressColor !== ""
    });
    const template = (() => {
      if (this.name && this.address) {
        return x`${this.nameTemplate(name())}${this.addressBytesTemplate(
          bytes()
        )}`;
      }
      if (this.name) {
        return this.nameTemplate(name());
      }
      if (this.address) {
        return this.addressTemplate(address());
      }
    })();
    return x`<div class=${cn(wrapper(), this.customClass)}>${template}</div>`;
  }
};
__decorateClass([
  n({ type: String })
], LuksoUsername.prototype, "name", 2);
__decorateClass([
  n({ type: String })
], LuksoUsername.prototype, "address", 2);
__decorateClass([
  n({ type: Number, attribute: "max-width" })
], LuksoUsername.prototype, "maxWidth", 2);
__decorateClass([
  n({ type: "string" })
], LuksoUsername.prototype, "size", 2);
__decorateClass([
  n({ type: Number, attribute: "slice-by" })
], LuksoUsername.prototype, "sliceBy", 2);
__decorateClass([
  n({ type: String, attribute: "address-color" })
], LuksoUsername.prototype, "addressColor", 2);
__decorateClass([
  n({ type: String, attribute: "name-color" })
], LuksoUsername.prototype, "nameColor", 2);
__decorateClass([
  n({ type: String, attribute: "custom-class" })
], LuksoUsername.prototype, "customClass", 2);
__decorateClass([
  n({ type: Boolean, attribute: "hide-prefix" })
], LuksoUsername.prototype, "hidePrefix", 2);
__decorateClass([
  n({ type: String })
], LuksoUsername.prototype, "prefix", 2);
__decorateClass([
  n({ type: Boolean, attribute: "no-transform" })
], LuksoUsername.prototype, "noTransform", 2);
LuksoUsername = __decorateClass([
  safeCustomElement("lukso-username")
], LuksoUsername);

export { LuksoUsername as L, sliceAddress as s };
