import { W, k as k$1, a as a$2, L, b as P$1, A as A$1, d as d$2, g as g$2 } from "./_page-3cf95a08.js"; import { d as dijkstraExports } from "./dijkstra-cb1f074b.js"; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t$3 = window, e$5 = t$3.ShadowRoot && (void 0 === t$3.ShadyCSS || t$3.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$3 = Symbol(), n$4 = /* @__PURE__ */ new WeakMap(); let o$4 = class o { constructor(t2, e2, n2) { if (this._$cssResult$ = true, n2 !== s$3) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); this.cssText = t2, this.t = e2; } get styleSheet() { let t2 = this.o; const s2 = this.t; if (e$5 && void 0 === t2) { const e2 = void 0 !== s2 && 1 === s2.length; e2 && (t2 = n$4.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && n$4.set(s2, t2)); } return t2; } toString() { return this.cssText; } }; const r$2 = (t2) => new o$4("string" == typeof t2 ? t2 : t2 + "", void 0, s$3), i$3 = (t2, ...e2) => { const n2 = 1 === t2.length ? t2[0] : e2.reduce((e3, s2, n3) => e3 + ((t3) => { if (true === t3._$cssResult$) return t3.cssText; if ("number" == typeof t3) return t3; throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); })(s2) + t2[n3 + 1], t2[0]); return new o$4(n2, t2, s$3); }, S$1 = (s2, n2) => { e$5 ? s2.adoptedStyleSheets = n2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet) : n2.forEach((e2) => { const n3 = document.createElement("style"), o3 = t$3.litNonce; void 0 !== o3 && n3.setAttribute("nonce", o3), n3.textContent = e2.cssText, s2.appendChild(n3); }); }, c$1 = e$5 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { let e2 = ""; for (const s2 of t3.cssRules) e2 += s2.cssText; return r$2(e2); })(t2) : t2; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var s$2; const e$4 = window, r$1 = e$4.trustedTypes, h$2 = r$1 ? r$1.emptyScript : "", o$3 = e$4.reactiveElementPolyfillSupport, n$3 = { toAttribute(t2, i2) { switch (i2) { case Boolean: t2 = t2 ? h$2 : null; break; case Object: case Array: t2 = null == t2 ? t2 : JSON.stringify(t2); } return t2; }, fromAttribute(t2, i2) { let s2 = t2; switch (i2) { case Boolean: s2 = null !== t2; break; case Number: s2 = null === t2 ? null : Number(t2); break; case Object: case Array: try { s2 = JSON.parse(t2); } catch (t3) { s2 = null; } } return s2; } }, a$1 = (t2, i2) => i2 !== t2 && (i2 == i2 || t2 == t2), l$3 = { attribute: true, type: String, converter: n$3, reflect: false, hasChanged: a$1 }; let d$1 = class d extends HTMLElement { constructor() { super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = false, this.hasUpdated = false, this._$El = null, this.u(); } static addInitializer(t2) { var i2; this.finalize(), (null !== (i2 = this.h) && void 0 !== i2 ? i2 : this.h = []).push(t2); } static get observedAttributes() { this.finalize(); const t2 = []; return this.elementProperties.forEach((i2, s2) => { const e2 = this._$Ep(s2, i2); void 0 !== e2 && (this._$Ev.set(e2, s2), t2.push(e2)); }), t2; } static createProperty(t2, i2 = l$3) { if (i2.state && (i2.attribute = false), this.finalize(), this.elementProperties.set(t2, i2), !i2.noAccessor && !this.prototype.hasOwnProperty(t2)) { const s2 = "symbol" == typeof t2 ? Symbol() : "__" + t2, e2 = this.getPropertyDescriptor(t2, s2, i2); void 0 !== e2 && Object.defineProperty(this.prototype, t2, e2); } } static getPropertyDescriptor(t2, i2, s2) { return { get() { return this[i2]; }, set(e2) { const r2 = this[t2]; this[i2] = e2, this.requestUpdate(t2, r2, s2); }, configurable: true, enumerable: true }; } static getPropertyOptions(t2) { return this.elementProperties.get(t2) || l$3; } static finalize() { if (this.hasOwnProperty("finalized")) return false; this.finalized = true; const t2 = Object.getPrototypeOf(this); if (t2.finalize(), void 0 !== t2.h && (this.h = [...t2.h]), this.elementProperties = new Map(t2.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) { const t3 = this.properties, i2 = [...Object.getOwnPropertyNames(t3), ...Object.getOwnPropertySymbols(t3)]; for (const s2 of i2) this.createProperty(s2, t3[s2]); } return this.elementStyles = this.finalizeStyles(this.styles), true; } static finalizeStyles(i2) { const s2 = []; if (Array.isArray(i2)) { const e2 = new Set(i2.flat(1 / 0).reverse()); for (const i3 of e2) s2.unshift(c$1(i3)); } else void 0 !== i2 && s2.push(c$1(i2)); return s2; } static _$Ep(t2, i2) { const s2 = i2.attribute; return false === s2 ? void 0 : "string" == typeof s2 ? s2 : "string" == typeof t2 ? t2.toLowerCase() : void 0; } u() { var t2; this._$E_ = new Promise((t3) => this.enableUpdating = t3), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), null === (t2 = this.constructor.h) || void 0 === t2 || t2.forEach((t3) => t3(this)); } addController(t2) { var i2, s2; (null !== (i2 = this._$ES) && void 0 !== i2 ? i2 : this._$ES = []).push(t2), void 0 !== this.renderRoot && this.isConnected && (null === (s2 = t2.hostConnected) || void 0 === s2 || s2.call(t2)); } removeController(t2) { var i2; null === (i2 = this._$ES) || void 0 === i2 || i2.splice(this._$ES.indexOf(t2) >>> 0, 1); } _$Eg() { this.constructor.elementProperties.forEach((t2, i2) => { this.hasOwnProperty(i2) && (this._$Ei.set(i2, this[i2]), delete this[i2]); }); } createRenderRoot() { var t2; const s2 = null !== (t2 = this.shadowRoot) && void 0 !== t2 ? t2 : this.attachShadow(this.constructor.shadowRootOptions); return S$1(s2, this.constructor.elementStyles), s2; } connectedCallback() { var t2; void 0 === this.renderRoot && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => { var i2; return null === (i2 = t3.hostConnected) || void 0 === i2 ? void 0 : i2.call(t3); }); } enableUpdating(t2) { } disconnectedCallback() { var t2; null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => { var i2; return null === (i2 = t3.hostDisconnected) || void 0 === i2 ? void 0 : i2.call(t3); }); } attributeChangedCallback(t2, i2, s2) { this._$AK(t2, s2); } _$EO(t2, i2, s2 = l$3) { var e2; const r2 = this.constructor._$Ep(t2, s2); if (void 0 !== r2 && true === s2.reflect) { const h2 = (void 0 !== (null === (e2 = s2.converter) || void 0 === e2 ? void 0 : e2.toAttribute) ? s2.converter : n$3).toAttribute(i2, s2.type); this._$El = t2, null == h2 ? this.removeAttribute(r2) : this.setAttribute(r2, h2), this._$El = null; } } _$AK(t2, i2) { var s2; const e2 = this.constructor, r2 = e2._$Ev.get(t2); if (void 0 !== r2 && this._$El !== r2) { const t3 = e2.getPropertyOptions(r2), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== (null === (s2 = t3.converter) || void 0 === s2 ? void 0 : s2.fromAttribute) ? t3.converter : n$3; this._$El = r2, this[r2] = h2.fromAttribute(i2, t3.type), this._$El = null; } } requestUpdate(t2, i2, s2) { let e2 = true; void 0 !== t2 && (((s2 = s2 || this.constructor.getPropertyOptions(t2)).hasChanged || a$1)(this[t2], i2) ? (this._$AL.has(t2) || this._$AL.set(t2, i2), true === s2.reflect && this._$El !== t2 && (void 0 === this._$EC && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t2, s2))) : e2 = false), !this.isUpdatePending && e2 && (this._$E_ = this._$Ej()); } async _$Ej() { this.isUpdatePending = true; try { await this._$E_; } catch (t3) { Promise.reject(t3); } const t2 = this.scheduleUpdate(); return null != t2 && await t2, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); } performUpdate() { var t2; if (!this.isUpdatePending) return; this.hasUpdated, this._$Ei && (this._$Ei.forEach((t3, i3) => this[i3] = t3), this._$Ei = void 0); let i2 = false; const s2 = this._$AL; try { i2 = this.shouldUpdate(s2), i2 ? (this.willUpdate(s2), null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => { var i3; return null === (i3 = t3.hostUpdate) || void 0 === i3 ? void 0 : i3.call(t3); }), this.update(s2)) : this._$Ek(); } catch (t3) { throw i2 = false, this._$Ek(), t3; } i2 && this._$AE(s2); } willUpdate(t2) { } _$AE(t2) { var i2; null === (i2 = this._$ES) || void 0 === i2 || i2.forEach((t3) => { var i3; return null === (i3 = t3.hostUpdated) || void 0 === i3 ? void 0 : i3.call(t3); }), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); } _$Ek() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; } get updateComplete() { return this.getUpdateComplete(); } getUpdateComplete() { return this._$E_; } shouldUpdate(t2) { return true; } update(t2) { void 0 !== this._$EC && (this._$EC.forEach((t3, i2) => this._$EO(i2, this[i2], t3)), this._$EC = void 0), this._$Ek(); } updated(t2) { } firstUpdated(t2) { } }; d$1.finalized = true, d$1.elementProperties = /* @__PURE__ */ new Map(), d$1.elementStyles = [], d$1.shadowRootOptions = { mode: "open" }, null == o$3 || o$3({ ReactiveElement: d$1 }), (null !== (s$2 = e$4.reactiveElementVersions) && void 0 !== s$2 ? s$2 : e$4.reactiveElementVersions = []).push("1.6.1"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var t$2; const i$2 = window, s$1 = i$2.trustedTypes, e$3 = s$1 ? s$1.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, o$2 = `lit$${(Math.random() + "").slice(9)}$`, n$2 = "?" + o$2, l$2 = `<${n$2}>`, h$1 = document, r = (t2 = "") => h$1.createComment(t2), d2 = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, u$1 = Array.isArray, c = (t2) => u$1(t2) || "function" == typeof (null == t2 ? void 0 : t2[Symbol.iterator]), v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, a = /-->/g, f = />/g, _ = RegExp(`>|[ \f\r](?:([^\\s"'>=/]+)([ \f\r]*=[ \f\r]*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"), m = /'/g, p = /"/g, $ = /^(?:script|style|textarea|title)$/i, g$1 = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), y = g$1(1), w = g$1(2), x = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), T = /* @__PURE__ */ new WeakMap(), A = h$1.createTreeWalker(h$1, 129, null, false), E = (t2, i2) => { const s2 = t2.length - 1, n2 = []; let h2, r2 = 2 === i2 ? "" : "", d3 = v; for (let i3 = 0; i3 < s2; i3++) { const s3 = t2[i3]; let e2, u3, c2 = -1, g2 = 0; for (; g2 < s3.length && (d3.lastIndex = g2, u3 = d3.exec(s3), null !== u3); ) g2 = d3.lastIndex, d3 === v ? "!--" === u3[1] ? d3 = a : void 0 !== u3[1] ? d3 = f : void 0 !== u3[2] ? ($.test(u3[2]) && (h2 = RegExp("" === u3[0] ? (d3 = null != h2 ? h2 : v, c2 = -1) : void 0 === u3[1] ? c2 = -2 : (c2 = d3.lastIndex - u3[2].length, e2 = u3[1], d3 = void 0 === u3[3] ? _ : '"' === u3[3] ? p : m) : d3 === p || d3 === m ? d3 = _ : d3 === a || d3 === f ? d3 = v : (d3 = _, h2 = void 0); const y2 = d3 === _ && t2[i3 + 1].startsWith("/>") ? " " : ""; r2 += d3 === v ? s3 + l$2 : c2 >= 0 ? (n2.push(e2), s3.slice(0, c2) + "$lit$" + s3.slice(c2) + o$2 + y2) : s3 + o$2 + (-2 === c2 ? (n2.push(void 0), i3) : y2); } const u2 = r2 + (t2[s2] || "") + (2 === i2 ? "" : ""); if (!Array.isArray(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); return [void 0 !== e$3 ? e$3.createHTML(u2) : u2, n2]; }; class C { constructor({ strings: t2, _$litType$: i2 }, e2) { let l2; this.parts = []; let h2 = 0, d3 = 0; const u2 = t2.length - 1, c2 = this.parts, [v2, a2] = E(t2, i2); if (this.el = C.createElement(v2, e2), A.currentNode = this.el.content, 2 === i2) { const t3 = this.el.content, i3 = t3.firstChild; i3.remove(), t3.append(...i3.childNodes); } for (; null !== (l2 = A.nextNode()) && c2.length < u2; ) { if (1 === l2.nodeType) { if (l2.hasAttributes()) { const t3 = []; for (const i3 of l2.getAttributeNames()) if (i3.endsWith("$lit$") || i3.startsWith(o$2)) { const s2 = a2[d3++]; if (t3.push(i3), void 0 !== s2) { const t4 = l2.getAttribute(s2.toLowerCase() + "$lit$").split(o$2), i4 = /([.?@])?(.*)/.exec(s2); c2.push({ type: 1, index: h2, name: i4[2], strings: t4, ctor: "." === i4[1] ? M : "?" === i4[1] ? k : "@" === i4[1] ? H$1 : S }); } else c2.push({ type: 6, index: h2 }); } for (const i3 of t3) l2.removeAttribute(i3); } if ($.test(l2.tagName)) { const t3 = l2.textContent.split(o$2), i3 = t3.length - 1; if (i3 > 0) { l2.textContent = s$1 ? s$1.emptyScript : ""; for (let s2 = 0; s2 < i3; s2++) l2.append(t3[s2], r()), A.nextNode(), c2.push({ type: 2, index: ++h2 }); l2.append(t3[i3], r()); } } } else if (8 === l2.nodeType) if (l2.data === n$2) c2.push({ type: 2, index: h2 }); else { let t3 = -1; for (; -1 !== (t3 = l2.data.indexOf(o$2, t3 + 1)); ) c2.push({ type: 7, index: h2 }), t3 += o$2.length - 1; } h2++; } } static createElement(t2, i2) { const s2 = h$1.createElement("template"); return s2.innerHTML = t2, s2; } } function P(t2, i2, s2 = t2, e2) { var o3, n2, l2, h2; if (i2 === x) return i2; let r2 = void 0 !== e2 ? null === (o3 = s2._$Co) || void 0 === o3 ? void 0 : o3[e2] : s2._$Cl; const u2 = d2(i2) ? void 0 : i2._$litDirective$; return (null == r2 ? void 0 : r2.constructor) !== u2 && (null === (n2 = null == r2 ? void 0 : r2._$AO) || void 0 === n2 || n2.call(r2, false), void 0 === u2 ? r2 = void 0 : (r2 = new u2(t2), r2._$AT(t2, s2, e2)), void 0 !== e2 ? (null !== (l2 = (h2 = s2)._$Co) && void 0 !== l2 ? l2 : h2._$Co = [])[e2] = r2 : s2._$Cl = r2), void 0 !== r2 && (i2 = P(t2, r2._$AS(t2, i2.values), r2, e2)), i2; } class V { constructor(t2, i2) { this.u = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } v(t2) { var i2; const { el: { content: s2 }, parts: e2 } = this._$AD, o3 = (null !== (i2 = null == t2 ? void 0 : t2.creationScope) && void 0 !== i2 ? i2 : h$1).importNode(s2, true); A.currentNode = o3; let n2 = A.nextNode(), l2 = 0, r2 = 0, d3 = e2[0]; for (; void 0 !== d3; ) { if (l2 === d3.index) { let i3; 2 === d3.type ? i3 = new N(n2, n2.nextSibling, this, t2) : 1 === d3.type ? i3 = new d3.ctor(n2, d3.name, d3.strings, this, t2) : 6 === d3.type && (i3 = new I(n2, this, t2)), this.u.push(i3), d3 = e2[++r2]; } l2 !== (null == d3 ? void 0 : d3.index) && (n2 = A.nextNode(), l2++); } return o3; } p(t2) { let i2 = 0; for (const s2 of this.u) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++; } } class N { constructor(t2, i2, s2, e2) { var o3; this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cm = null === (o3 = null == e2 ? void 0 : e2.isConnected) || void 0 === o3 || o3; } get _$AU() { var t2, i2; return null !== (i2 = null === (t2 = this._$AM) || void 0 === t2 ? void 0 : t2._$AU) && void 0 !== i2 ? i2 : this._$Cm; } get parentNode() { let t2 = this._$AA.parentNode; const i2 = this._$AM; return void 0 !== i2 && 11 === t2.nodeType && (t2 = i2.parentNode), t2; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(t2, i2 = this) { t2 = P(this, t2, i2), d2(t2) ? t2 === b || null == t2 || "" === t2 ? (this._$AH !== b && this._$AR(), this._$AH = b) : t2 !== this._$AH && t2 !== x && this.g(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : c(t2) ? this.k(t2) : this.g(t2); } O(t2, i2 = this._$AB) { return this._$AA.parentNode.insertBefore(t2, i2); } T(t2) { this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); } g(t2) { this._$AH !== b && d2(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(h$1.createTextNode(t2)), this._$AH = t2; } $(t2) { var i2; const { values: s2, _$litType$: e2 } = t2, o3 = "number" == typeof e2 ? this._$AC(t2) : (void 0 === e2.el && (e2.el = C.createElement(e2.h, this.options)), e2); if ((null === (i2 = this._$AH) || void 0 === i2 ? void 0 : i2._$AD) === o3) this._$AH.p(s2); else { const t3 = new V(o3, this), i3 = t3.v(this.options); t3.p(s2), this.T(i3), this._$AH = t3; } } _$AC(t2) { let i2 = T.get(t2.strings); return void 0 === i2 && T.set(t2.strings, i2 = new C(t2)), i2; } k(t2) { u$1(this._$AH) || (this._$AH = [], this._$AR()); const i2 = this._$AH; let s2, e2 = 0; for (const o3 of t2) e2 === i2.length ? i2.push(s2 = new N(this.O(r()), this.O(r()), this, this.options)) : s2 = i2[e2], s2._$AI(o3), e2++; e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2); } _$AR(t2 = this._$AA.nextSibling, i2) { var s2; for (null === (s2 = this._$AP) || void 0 === s2 || s2.call(this, false, true, i2); t2 && t2 !== this._$AB; ) { const i3 = t2.nextSibling; t2.remove(), t2 = i3; } } setConnected(t2) { var i2; void 0 === this._$AM && (this._$Cm = t2, null === (i2 = this._$AP) || void 0 === i2 || i2.call(this, t2)); } } class S { constructor(t2, i2, s2, e2, o3) { this.type = 1, this._$AH = b, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = o3, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = b; } get tagName() { return this.element.tagName; } get _$AU() { return this._$AM._$AU; } _$AI(t2, i2 = this, s2, e2) { const o3 = this.strings; let n2 = false; if (void 0 === o3) t2 = P(this, t2, i2, 0), n2 = !d2(t2) || t2 !== this._$AH && t2 !== x, n2 && (this._$AH = t2); else { const e3 = t2; let l2, h2; for (t2 = o3[0], l2 = 0; l2 < o3.length - 1; l2++) h2 = P(this, e3[s2 + l2], i2, l2), h2 === x && (h2 = this._$AH[l2]), n2 || (n2 = !d2(h2) || h2 !== this._$AH[l2]), h2 === b ? t2 = b : t2 !== b && (t2 += (null != h2 ? h2 : "") + o3[l2 + 1]), this._$AH[l2] = h2; } n2 && !e2 && this.j(t2); } j(t2) { t2 === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, null != t2 ? t2 : ""); } } class M extends S { constructor() { super(...arguments), this.type = 3; } j(t2) { this.element[this.name] = t2 === b ? void 0 : t2; } } const R$1 = s$1 ? s$1.emptyScript : ""; class k extends S { constructor() { super(...arguments), this.type = 4; } j(t2) { t2 && t2 !== b ? this.element.setAttribute(this.name, R$1) : this.element.removeAttribute(this.name); } } let H$1 = class H extends S { constructor(t2, i2, s2, e2, o3) { super(t2, i2, s2, e2, o3), this.type = 5; } _$AI(t2, i2 = this) { var s2; if ((t2 = null !== (s2 = P(this, t2, i2, 0)) && void 0 !== s2 ? s2 : b) === x) return; const e2 = this._$AH, o3 = t2 === b && e2 !== b || t2.capture !== e2.capture || t2.once !== e2.once || t2.passive !== e2.passive, n2 = t2 !== b && (e2 === b || o3); o3 && this.element.removeEventListener(this.name, this, e2), n2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; } handleEvent(t2) { var i2, s2; "function" == typeof this._$AH ? this._$AH.call(null !== (s2 = null === (i2 = this.options) || void 0 === i2 ? void 0 : i2.host) && void 0 !== s2 ? s2 : this.element, t2) : this._$AH.handleEvent(t2); } }; class I { constructor(t2, i2, s2) { this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2; } get _$AU() { return this._$AM._$AU; } _$AI(t2) { P(this, t2); } } const z$1 = i$2.litHtmlPolyfillSupport; null == z$1 || z$1(C, N), (null !== (t$2 = i$2.litHtmlVersions) && void 0 !== t$2 ? t$2 : i$2.litHtmlVersions = []).push("2.6.1"); const Z$1 = (t2, i2, s2) => { var e2, o3; const n2 = null !== (e2 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== e2 ? e2 : i2; let l2 = n2._$litPart$; if (void 0 === l2) { const t3 = null !== (o3 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== o3 ? o3 : null; n2._$litPart$ = l2 = new N(i2.insertBefore(r(), t3), t3, void 0, null != s2 ? s2 : {}); } return l2._$AI(t2), l2; }; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var l$1, o$1; class s extends d$1 { constructor() { super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; } createRenderRoot() { var t2, e2; const i2 = super.createRenderRoot(); return null !== (t2 = (e2 = this.renderOptions).renderBefore) && void 0 !== t2 || (e2.renderBefore = i2.firstChild), i2; } update(t2) { const i2 = this.render(); this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = Z$1(i2, this.renderRoot, this.renderOptions); } connectedCallback() { var t2; super.connectedCallback(), null === (t2 = this._$Do) || void 0 === t2 || t2.setConnected(true); } disconnectedCallback() { var t2; super.disconnectedCallback(), null === (t2 = this._$Do) || void 0 === t2 || t2.setConnected(false); } render() { return x; } } s.finalized = true, s._$litElement$ = true, null === (l$1 = globalThis.litElementHydrateSupport) || void 0 === l$1 || l$1.call(globalThis, { LitElement: s }); const n$1 = globalThis.litElementPolyfillSupport; null == n$1 || n$1({ LitElement: s }); (null !== (o$1 = globalThis.litElementVersions) && void 0 !== o$1 ? o$1 : globalThis.litElementVersions = []).push("3.2.2"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const e$2 = (e2) => (n2) => "function" == typeof n2 ? ((e3, n3) => (customElements.define(e3, n3), n3))(e2, n2) : ((e3, n3) => { const { kind: t2, elements: s2 } = n3; return { kind: t2, elements: s2, finisher(n4) { customElements.define(e3, n4); } }; })(e2, n2); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const i$1 = (i2, e2) => "method" === e2.kind && e2.descriptor && !("value" in e2.descriptor) ? { ...e2, finisher(n2) { n2.createProperty(e2.key, i2); } } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: e2.key, initializer() { "function" == typeof e2.initializer && (this[e2.key] = e2.initializer.call(this)); }, finisher(n2) { n2.createProperty(e2.key, i2); } }; function e$1(e2) { return (n2, t2) => void 0 !== t2 ? ((i2, e3, n3) => { e3.constructor.createProperty(n3, i2); })(e2, n2, t2) : i$1(e2, n2); } /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ function t$1(t2) { return e$1({ ...t2, state: true }); } /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var n; null != (null === (n = window.HTMLSlotElement) || void 0 === n ? void 0 : n.prototype.assignedElements) ? (o3, n2) => o3.assignedElements(n2) : (o3, n2) => o3.assignedNodes(n2).filter((o4) => o4.nodeType === Node.ELEMENT_NODE); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, e = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 }); class i { constructor(t2) { } get _$AU() { return this._$AM._$AU; } _$AT(t2, e2, i2) { this._$Ct = t2, this._$AM = e2, this._$Ci = i2; } _$AS(t2, e2) { return this.update(t2, e2); } update(t2, e2) { return this.render(...e2); } } /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const o2 = e(class extends i { constructor(t$12) { var i2; if (super(t$12), t$12.type !== t.ATTRIBUTE || "class" !== t$12.name || (null === (i2 = t$12.strings) || void 0 === i2 ? void 0 : i2.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute."); } render(t2) { return " " + Object.keys(t2).filter((i2) => t2[i2]).join(" ") + " "; } update(i2, [s2]) { var r2, o3; if (void 0 === this.nt) { this.nt = /* @__PURE__ */ new Set(), void 0 !== i2.strings && (this.st = new Set(i2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2))); for (const t2 in s2) s2[t2] && !(null === (r2 = this.st) || void 0 === r2 ? void 0 : r2.has(t2)) && this.nt.add(t2); return this.render(s2); } const e2 = i2.element.classList; this.nt.forEach((t2) => { t2 in s2 || (e2.remove(t2), this.nt.delete(t2)); }); for (const t2 in s2) { const i3 = !!s2[t2]; i3 === this.nt.has(t2) || (null === (o3 = this.st) || void 0 === o3 ? void 0 : o3.has(t2)) || (i3 ? (e2.add(t2), this.nt.add(t2)) : (e2.remove(t2), this.nt.delete(t2))); } return x; } }); function addUniqueItem(array, item) { array.indexOf(item) === -1 && array.push(item); } const clamp = (min, max, v2) => Math.min(Math.max(v2, min), max); const defaults$1 = { duration: 0.3, delay: 0, endDelay: 0, repeat: 0, easing: "ease" }; const isNumber = (value) => typeof value === "number"; const isEasingList = (easing) => Array.isArray(easing) && !isNumber(easing[0]); const wrap = (min, max, v2) => { const rangeSize = max - min; return ((v2 - min) % rangeSize + rangeSize) % rangeSize + min; }; function getEasingForSegment(easing, i2) { return isEasingList(easing) ? easing[wrap(0, easing.length, i2)] : easing; } const mix = (min, max, progress2) => -progress2 * min + progress2 * max + min; const noop = () => { }; const noopReturn = (v2) => v2; const progress = (min, max, value) => max - min === 0 ? 1 : (value - min) / (max - min); function fillOffset(offset, remaining) { const min = offset[offset.length - 1]; for (let i2 = 1; i2 <= remaining; i2++) { const offsetProgress = progress(0, remaining, i2); offset.push(mix(min, 1, offsetProgress)); } } function defaultOffset(length) { const offset = [0]; fillOffset(offset, length - 1); return offset; } function interpolate(output, input = defaultOffset(output.length), easing = noopReturn) { const length = output.length; const remainder = length - input.length; remainder > 0 && fillOffset(input, remainder); return (t2) => { let i2 = 0; for (; i2 < length - 2; i2++) { if (t2 < input[i2 + 1]) break; } let progressInRange = clamp(0, 1, progress(input[i2], input[i2 + 1], t2)); const segmentEasing = getEasingForSegment(easing, i2); progressInRange = segmentEasing(progressInRange); return mix(output[i2], output[i2 + 1], progressInRange); }; } const isCubicBezier = (easing) => Array.isArray(easing) && isNumber(easing[0]); const isEasingGenerator = (easing) => typeof easing === "object" && Boolean(easing.createAnimation); const isFunction = (value) => typeof value === "function"; const isString = (value) => typeof value === "string"; const time = { ms: (seconds) => seconds * 1e3, s: (milliseconds) => milliseconds / 1e3 }; function velocityPerSecond(velocity, frameDuration) { return frameDuration ? velocity * (1e3 / frameDuration) : 0; } const calcBezier = (t2, a1, a2) => (((1 - 3 * a2 + 3 * a1) * t2 + (3 * a2 - 6 * a1)) * t2 + 3 * a1) * t2; const subdivisionPrecision = 1e-7; const subdivisionMaxIterations = 12; function binarySubdivide(x2, lowerBound, upperBound, mX1, mX2) { let currentX; let currentT; let i2 = 0; do { currentT = lowerBound + (upperBound - lowerBound) / 2; currentX = calcBezier(currentT, mX1, mX2) - x2; if (currentX > 0) { upperBound = currentT; } else { lowerBound = currentT; } } while (Math.abs(currentX) > subdivisionPrecision && ++i2 < subdivisionMaxIterations); return currentT; } function cubicBezier(mX1, mY1, mX2, mY2) { if (mX1 === mY1 && mX2 === mY2) return noopReturn; const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); return (t2) => t2 === 0 || t2 === 1 ? t2 : calcBezier(getTForX(t2), mY1, mY2); } const steps = (steps2, direction = "end") => (progress2) => { progress2 = direction === "end" ? Math.min(progress2, 0.999) : Math.max(progress2, 1e-3); const expanded = progress2 * steps2; const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); return clamp(0, 1, rounded / steps2); }; const namedEasings = { ease: cubicBezier(0.25, 0.1, 0.25, 1), "ease-in": cubicBezier(0.42, 0, 1, 1), "ease-in-out": cubicBezier(0.42, 0, 0.58, 1), "ease-out": cubicBezier(0, 0, 0.58, 1) }; const functionArgsRegex = /\((.*?)\)/; function getEasingFunction(definition) { if (isFunction(definition)) return definition; if (isCubicBezier(definition)) return cubicBezier(...definition); if (namedEasings[definition]) return namedEasings[definition]; if (definition.startsWith("steps")) { const args = functionArgsRegex.exec(definition); if (args) { const argsArray = args[1].split(","); return steps(parseFloat(argsArray[0]), argsArray[1].trim()); } } return noopReturn; } class Animation { constructor(output, keyframes = [0, 1], { easing, duration: initialDuration = defaults$1.duration, delay = defaults$1.delay, endDelay = defaults$1.endDelay, repeat = defaults$1.repeat, offset, direction = "normal" } = {}) { this.startTime = null; this.rate = 1; this.t = 0; this.cancelTimestamp = null; this.easing = noopReturn; this.duration = 0; this.totalDuration = 0; this.repeat = 0; this.playState = "idle"; this.finished = new Promise((resolve, reject) => { this.resolve = resolve; this.reject = reject; }); easing = easing || defaults$1.easing; if (isEasingGenerator(easing)) { const custom = easing.createAnimation(keyframes); easing = custom.easing; keyframes = custom.keyframes || keyframes; initialDuration = custom.duration || initialDuration; } this.repeat = repeat; this.easing = isEasingList(easing) ? noopReturn : getEasingFunction(easing); this.updateDuration(initialDuration); const interpolate$1 = interpolate(keyframes, offset, isEasingList(easing) ? easing.map(getEasingFunction) : noopReturn); this.tick = (timestamp) => { var _a2; delay = delay; let t2 = 0; if (this.pauseTime !== void 0) { t2 = this.pauseTime; } else { t2 = (timestamp - this.startTime) * this.rate; } this.t = t2; t2 /= 1e3; t2 = Math.max(t2 - delay, 0); if (this.playState === "finished" && this.pauseTime === void 0) { t2 = this.totalDuration; } const progress2 = t2 / this.duration; let currentIteration = Math.floor(progress2); let iterationProgress = progress2 % 1; if (!iterationProgress && progress2 >= 1) { iterationProgress = 1; } iterationProgress === 1 && currentIteration--; const iterationIsOdd = currentIteration % 2; if (direction === "reverse" || direction === "alternate" && iterationIsOdd || direction === "alternate-reverse" && !iterationIsOdd) { iterationProgress = 1 - iterationProgress; } const p2 = t2 >= this.totalDuration ? 1 : Math.min(iterationProgress, 1); const latest = interpolate$1(this.easing(p2)); output(latest); const isAnimationFinished = this.pauseTime === void 0 && (this.playState === "finished" || t2 >= this.totalDuration + endDelay); if (isAnimationFinished) { this.playState = "finished"; (_a2 = this.resolve) === null || _a2 === void 0 ? void 0 : _a2.call(this, latest); } else if (this.playState !== "idle") { this.frameRequestId = requestAnimationFrame(this.tick); } }; this.play(); } play() { const now = performance.now(); this.playState = "running"; if (this.pauseTime !== void 0) { this.startTime = now - this.pauseTime; } else if (!this.startTime) { this.startTime = now; } this.cancelTimestamp = this.startTime; this.pauseTime = void 0; this.frameRequestId = requestAnimationFrame(this.tick); } pause() { this.playState = "paused"; this.pauseTime = this.t; } finish() { this.playState = "finished"; this.tick(0); } stop() { var _a2; this.playState = "idle"; if (this.frameRequestId !== void 0) { cancelAnimationFrame(this.frameRequestId); } (_a2 = this.reject) === null || _a2 === void 0 ? void 0 : _a2.call(this, false); } cancel() { this.stop(); this.tick(this.cancelTimestamp); } reverse() { this.rate *= -1; } commitStyles() { } updateDuration(duration) { this.duration = duration; this.totalDuration = duration * (this.repeat + 1); } get currentTime() { return this.t; } set currentTime(t2) { if (this.pauseTime !== void 0 || this.rate === 0) { this.pauseTime = t2; } else { this.startTime = performance.now() - t2 / this.rate; } } get playbackRate() { return this.rate; } set playbackRate(rate) { this.rate = rate; } } class MotionValue { setAnimation(animation) { this.animation = animation; animation === null || animation === void 0 ? void 0 : animation.finished.then(() => this.clearAnimation()).catch(() => { }); } clearAnimation() { this.animation = this.generator = void 0; } } const data = /* @__PURE__ */ new WeakMap(); function getAnimationData(element) { if (!data.has(element)) { data.set(element, { transforms: [], values: /* @__PURE__ */ new Map() }); } return data.get(element); } function getMotionValue(motionValues, name) { if (!motionValues.has(name)) { motionValues.set(name, new MotionValue()); } return motionValues.get(name); } const axes = ["", "X", "Y", "Z"]; const order = ["translate", "scale", "rotate", "skew"]; const transformAlias = { x: "translateX", y: "translateY", z: "translateZ" }; const rotation = { syntax: "", initialValue: "0deg", toDefaultUnit: (v2) => v2 + "deg" }; const baseTransformProperties = { translate: { syntax: "", initialValue: "0px", toDefaultUnit: (v2) => v2 + "px" }, rotate: rotation, scale: { syntax: "", initialValue: 1, toDefaultUnit: noopReturn }, skew: rotation }; const transformDefinitions = /* @__PURE__ */ new Map(); const asTransformCssVar = (name) => `--motion-${name}`; const transforms = ["x", "y", "z"]; order.forEach((name) => { axes.forEach((axis) => { transforms.push(name + axis); transformDefinitions.set(asTransformCssVar(name + axis), baseTransformProperties[name]); }); }); const compareTransformOrder = (a2, b2) => transforms.indexOf(a2) - transforms.indexOf(b2); const transformLookup = new Set(transforms); const isTransform = (name) => transformLookup.has(name); const addTransformToElement = (element, name) => { if (transformAlias[name]) name = transformAlias[name]; const { transforms: transforms2 } = getAnimationData(element); addUniqueItem(transforms2, name); element.style.transform = buildTransformTemplate(transforms2); }; const buildTransformTemplate = (transforms2) => transforms2.sort(compareTransformOrder).reduce(transformListToString, "").trim(); const transformListToString = (template, name) => `${template} ${name}(var(${asTransformCssVar(name)}))`; const isCssVar = (name) => name.startsWith("--"); const registeredProperties = /* @__PURE__ */ new Set(); function registerCssVariable(name) { if (registeredProperties.has(name)) return; registeredProperties.add(name); try { const { syntax, initialValue } = transformDefinitions.has(name) ? transformDefinitions.get(name) : {}; CSS.registerProperty({ name, inherits: false, syntax, initialValue }); } catch (e2) { } } const testAnimation = (keyframes, options) => document.createElement("div").animate(keyframes, options); const featureTests = { cssRegisterProperty: () => typeof CSS !== "undefined" && Object.hasOwnProperty.call(CSS, "registerProperty"), waapi: () => Object.hasOwnProperty.call(Element.prototype, "animate"), partialKeyframes: () => { try { testAnimation({ opacity: [1] }); } catch (e2) { return false; } return true; }, finished: () => Boolean(testAnimation({ opacity: [0, 1] }, { duration: 1e-3 }).finished), linearEasing: () => { try { testAnimation({ opacity: 0 }, { easing: "linear(0, 1)" }); } catch (e2) { return false; } return true; } }; const results = {}; const supports = {}; for (const key in featureTests) { supports[key] = () => { if (results[key] === void 0) results[key] = featureTests[key](); return results[key]; }; } const resolution = 0.015; const generateLinearEasingPoints = (easing, duration) => { let points = ""; const numPoints = Math.round(duration / resolution); for (let i2 = 0; i2 < numPoints; i2++) { points += easing(progress(0, numPoints - 1, i2)) + ", "; } return points.substring(0, points.length - 2); }; const convertEasing = (easing, duration) => { if (isFunction(easing)) { return supports.linearEasing() ? `linear(${generateLinearEasingPoints(easing, duration)})` : defaults$1.easing; } else { return isCubicBezier(easing) ? cubicBezierAsString(easing) : easing; } }; const cubicBezierAsString = ([a2, b2, c2, d3]) => `cubic-bezier(${a2}, ${b2}, ${c2}, ${d3})`; function hydrateKeyframes(keyframes, readInitialValue) { for (let i2 = 0; i2 < keyframes.length; i2++) { if (keyframes[i2] === null) { keyframes[i2] = i2 ? keyframes[i2 - 1] : readInitialValue(); } } return keyframes; } const keyframesList = (keyframes) => Array.isArray(keyframes) ? keyframes : [keyframes]; function getStyleName(key) { if (transformAlias[key]) key = transformAlias[key]; return isTransform(key) ? asTransformCssVar(key) : key; } const style = { get: (element, name) => { name = getStyleName(name); let value = isCssVar(name) ? element.style.getPropertyValue(name) : getComputedStyle(element)[name]; if (!value && value !== 0) { const definition = transformDefinitions.get(name); if (definition) value = definition.initialValue; } return value; }, set: (element, name, value) => { name = getStyleName(name); if (isCssVar(name)) { element.style.setProperty(name, value); } else { element.style[name] = value; } } }; function stopAnimation(animation, needsCommit = true) { if (!animation || animation.playState === "finished") return; try { if (animation.stop) { animation.stop(); } else { needsCommit && animation.commitStyles(); animation.cancel(); } } catch (e2) { } } function getUnitConverter(keyframes, definition) { var _a2; let toUnit = (definition === null || definition === void 0 ? void 0 : definition.toDefaultUnit) || noopReturn; const finalKeyframe = keyframes[keyframes.length - 1]; if (isString(finalKeyframe)) { const unit = ((_a2 = finalKeyframe.match(/(-?[\d.]+)([a-z%]*)/)) === null || _a2 === void 0 ? void 0 : _a2[2]) || ""; if (unit) toUnit = (value) => value + unit; } return toUnit; } function getDevToolsRecord() { return window.__MOTION_DEV_TOOLS_RECORD; } function animateStyle(element, key, keyframesDefinition, options = {}, AnimationPolyfill) { const record = getDevToolsRecord(); const isRecording = options.record !== false && record; let animation; let { duration = defaults$1.duration, delay = defaults$1.delay, endDelay = defaults$1.endDelay, repeat = defaults$1.repeat, easing = defaults$1.easing, persist = false, direction, offset, allowWebkitAcceleration = false } = options; const data2 = getAnimationData(element); const valueIsTransform = isTransform(key); let canAnimateNatively = supports.waapi(); valueIsTransform && addTransformToElement(element, key); const name = getStyleName(key); const motionValue = getMotionValue(data2.values, name); const definition = transformDefinitions.get(name); stopAnimation(motionValue.animation, !(isEasingGenerator(easing) && motionValue.generator) && options.record !== false); return () => { const readInitialValue = () => { var _a2, _b; return (_b = (_a2 = style.get(element, name)) !== null && _a2 !== void 0 ? _a2 : definition === null || definition === void 0 ? void 0 : definition.initialValue) !== null && _b !== void 0 ? _b : 0; }; let keyframes = hydrateKeyframes(keyframesList(keyframesDefinition), readInitialValue); const toUnit = getUnitConverter(keyframes, definition); if (isEasingGenerator(easing)) { const custom = easing.createAnimation(keyframes, key !== "opacity", readInitialValue, name, motionValue); easing = custom.easing; keyframes = custom.keyframes || keyframes; duration = custom.duration || duration; } if (isCssVar(name)) { if (supports.cssRegisterProperty()) { registerCssVariable(name); } else { canAnimateNatively = false; } } if (valueIsTransform && !supports.linearEasing() && (isFunction(easing) || isEasingList(easing) && easing.some(isFunction))) { canAnimateNatively = false; } if (canAnimateNatively) { if (definition) { keyframes = keyframes.map((value) => isNumber(value) ? definition.toDefaultUnit(value) : value); } if (keyframes.length === 1 && (!supports.partialKeyframes() || isRecording)) { keyframes.unshift(readInitialValue()); } const animationOptions = { delay: time.ms(delay), duration: time.ms(duration), endDelay: time.ms(endDelay), easing: !isEasingList(easing) ? convertEasing(easing, duration) : void 0, direction, iterations: repeat + 1, fill: "both" }; animation = element.animate({ [name]: keyframes, offset, easing: isEasingList(easing) ? easing.map((thisEasing) => convertEasing(thisEasing, duration)) : void 0 }, animationOptions); if (!animation.finished) { animation.finished = new Promise((resolve, reject) => { animation.onfinish = resolve; animation.oncancel = reject; }); } const target = keyframes[keyframes.length - 1]; animation.finished.then(() => { if (persist) return; style.set(element, name, target); animation.cancel(); }).catch(noop); if (!allowWebkitAcceleration) animation.playbackRate = 1.000001; } else if (AnimationPolyfill && valueIsTransform) { keyframes = keyframes.map((value) => typeof value === "string" ? parseFloat(value) : value); if (keyframes.length === 1) { keyframes.unshift(parseFloat(readInitialValue())); } animation = new AnimationPolyfill((latest) => { style.set(element, name, toUnit ? toUnit(latest) : latest); }, keyframes, Object.assign(Object.assign({}, options), { duration, easing })); } else { const target = keyframes[keyframes.length - 1]; style.set(element, name, definition && isNumber(target) ? definition.toDefaultUnit(target) : target); } if (isRecording) { record(element, key, keyframes, { duration, delay, easing, repeat, offset }, "motion-one"); } motionValue.setAnimation(animation); return animation; }; } const getOptions = (options, key) => ( /** * TODO: Make test for this * Always return a new object otherwise delay is overwritten by results of stagger * and this results in no stagger */ options[key] ? Object.assign(Object.assign({}, options), options[key]) : Object.assign({}, options) ); function resolveElements(elements, selectorCache) { var _a2; if (typeof elements === "string") { if (selectorCache) { (_a2 = selectorCache[elements]) !== null && _a2 !== void 0 ? _a2 : selectorCache[elements] = document.querySelectorAll(elements); elements = selectorCache[elements]; } else { elements = document.querySelectorAll(elements); } } else if (elements instanceof Element) { elements = [elements]; } return Array.from(elements || []); } const createAnimation = (factory) => factory(); const withControls = (animationFactory, options, duration = defaults$1.duration) => { return new Proxy({ animations: animationFactory.map(createAnimation).filter(Boolean), duration, options }, controls); }; const getActiveAnimation = (state) => state.animations[0]; const controls = { get: (target, key) => { const activeAnimation = getActiveAnimation(target); switch (key) { case "duration": return target.duration; case "currentTime": return time.s((activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) || 0); case "playbackRate": case "playState": return activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]; case "finished": if (!target.finished) { target.finished = Promise.all(target.animations.map(selectFinished)).catch(noop); } return target.finished; case "stop": return () => { target.animations.forEach((animation) => stopAnimation(animation)); }; case "forEachNative": return (callback) => { target.animations.forEach((animation) => callback(animation, target)); }; default: return typeof (activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) === "undefined" ? void 0 : () => target.animations.forEach((animation) => animation[key]()); } }, set: (target, key, value) => { switch (key) { case "currentTime": value = time.ms(value); case "currentTime": case "playbackRate": for (let i2 = 0; i2 < target.animations.length; i2++) { target.animations[i2][key] = value; } return true; } return false; } }; const selectFinished = (animation) => animation.finished; function resolveOption(option, i2, total) { return isFunction(option) ? option(i2, total) : option; } function createAnimate(AnimatePolyfill) { return function animate2(elements, keyframes, options = {}) { elements = resolveElements(elements); const numElements = elements.length; const animationFactories = []; for (let i2 = 0; i2 < numElements; i2++) { const element = elements[i2]; for (const key in keyframes) { const valueOptions = getOptions(options, key); valueOptions.delay = resolveOption(valueOptions.delay, i2, numElements); const animation = animateStyle(element, key, keyframes[key], valueOptions, AnimatePolyfill); animationFactories.push(animation); } } return withControls( animationFactories, options, /** * TODO: * If easing is set to spring or glide, duration will be dynamically * generated. Ideally we would dynamically generate this from * animation.effect.getComputedTiming().duration but this isn't * supported in iOS13 or our number polyfill. Perhaps it's possible * to Proxy animations returned from animateStyle that has duration * as a getter. */ options.duration ); }; } const animate$1 = createAnimate(Animation); const sampleT = 5; function calcGeneratorVelocity(resolveValue, t2, current) { const prevT = Math.max(t2 - sampleT, 0); return velocityPerSecond(current - resolveValue(prevT), t2 - prevT); } const defaults = { stiffness: 100, damping: 10, mass: 1 }; const calcDampingRatio = (stiffness = defaults.stiffness, damping = defaults.damping, mass = defaults.mass) => damping / (2 * Math.sqrt(stiffness * mass)); function hasReachedTarget(origin, target, current) { return origin < target && current >= target || origin > target && current <= target; } const spring$1 = ({ stiffness = defaults.stiffness, damping = defaults.damping, mass = defaults.mass, from = 0, to: to2 = 1, velocity = 0, restSpeed = 2, restDistance = 0.5 } = {}) => { velocity = velocity ? time.s(velocity) : 0; const state = { done: false, hasReachedTarget: false, current: from, target: to2 }; const initialDelta = to2 - from; const undampedAngularFreq = Math.sqrt(stiffness / mass) / 1e3; const dampingRatio = calcDampingRatio(stiffness, damping, mass); let resolveSpring; if (dampingRatio < 1) { const angularFreq = undampedAngularFreq * Math.sqrt(1 - dampingRatio * dampingRatio); resolveSpring = (t2) => to2 - Math.exp(-dampingRatio * undampedAngularFreq * t2) * ((-velocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq * Math.sin(angularFreq * t2) + initialDelta * Math.cos(angularFreq * t2)); } else { resolveSpring = (t2) => { return to2 - Math.exp(-undampedAngularFreq * t2) * (initialDelta + (-velocity + undampedAngularFreq * initialDelta) * t2); }; } return (t2) => { state.current = resolveSpring(t2); const currentVelocity = t2 === 0 ? velocity : calcGeneratorVelocity(resolveSpring, t2, state.current); const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; const isBelowDisplacementThreshold = Math.abs(to2 - state.current) <= restDistance; state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold; state.hasReachedTarget = hasReachedTarget(from, to2, state.current); return state; }; }; const timeStep = 10; const maxDuration = 1e4; function pregenerateKeyframes(generator, toUnit = noopReturn) { let overshootDuration = void 0; let timestamp = timeStep; let state = generator(0); const keyframes = [toUnit(state.current)]; while (!state.done && timestamp < maxDuration) { state = generator(timestamp); keyframes.push(toUnit(state.done ? state.target : state.current)); if (overshootDuration === void 0 && state.hasReachedTarget) { overshootDuration = timestamp; } timestamp += timeStep; } const duration = timestamp - timeStep; if (keyframes.length === 1) keyframes.push(state.current); return { keyframes, duration: duration / 1e3, overshootDuration: (overshootDuration !== null && overshootDuration !== void 0 ? overshootDuration : duration) / 1e3 }; } function canGenerate(value) { return isNumber(value) && !isNaN(value); } function getAsNumber(value) { return isString(value) ? parseFloat(value) : value; } function createGeneratorEasing(createGenerator) { const keyframesCache = /* @__PURE__ */ new WeakMap(); return (options = {}) => { const generatorCache = /* @__PURE__ */ new Map(); const getGenerator = (from = 0, to2 = 100, velocity = 0, isScale = false) => { const key = `${from}-${to2}-${velocity}-${isScale}`; if (!generatorCache.has(key)) { generatorCache.set(key, createGenerator(Object.assign({ from, to: to2, velocity, restSpeed: isScale ? 0.05 : 2, restDistance: isScale ? 0.01 : 0.5 }, options))); } return generatorCache.get(key); }; const getKeyframes = (generator, toUnit) => { if (!keyframesCache.has(generator)) { keyframesCache.set(generator, pregenerateKeyframes(generator, toUnit)); } return keyframesCache.get(generator); }; return { createAnimation: (keyframes, shouldGenerate = true, getOrigin, name, motionValue) => { let settings; let origin; let target; let velocity = 0; let toUnit = noopReturn; const numKeyframes = keyframes.length; if (shouldGenerate) { toUnit = getUnitConverter(keyframes, name ? transformDefinitions.get(getStyleName(name)) : void 0); const targetDefinition = keyframes[numKeyframes - 1]; target = getAsNumber(targetDefinition); if (numKeyframes > 1 && keyframes[0] !== null) { origin = getAsNumber(keyframes[0]); } else { const prevGenerator = motionValue === null || motionValue === void 0 ? void 0 : motionValue.generator; if (prevGenerator) { const { animation, generatorStartTime } = motionValue; const startTime = (animation === null || animation === void 0 ? void 0 : animation.startTime) || generatorStartTime || 0; const currentTime = (animation === null || animation === void 0 ? void 0 : animation.currentTime) || performance.now() - startTime; const prevGeneratorCurrent = prevGenerator(currentTime).current; origin = prevGeneratorCurrent; velocity = calcGeneratorVelocity((t2) => prevGenerator(t2).current, currentTime, prevGeneratorCurrent); } else if (getOrigin) { origin = getAsNumber(getOrigin()); } } } if (canGenerate(origin) && canGenerate(target)) { const generator = getGenerator(origin, target, velocity, name === null || name === void 0 ? void 0 : name.includes("scale")); settings = Object.assign(Object.assign({}, getKeyframes(generator, toUnit)), { easing: "linear" }); if (motionValue) { motionValue.generator = generator; motionValue.generatorStartTime = performance.now(); } } if (!settings) { const keyframesMetadata = getKeyframes(getGenerator(0, 100)); settings = { easing: "ease", duration: keyframesMetadata.overshootDuration }; } return settings; } }; }; } const spring = createGeneratorEasing(spring$1); function animateProgress(target, options = {}) { return withControls([ () => { const animation = new Animation(target, [0, 1], options); animation.finished.catch(() => { }); return animation; } ], options, options.duration); } function animate(target, keyframesOrOptions, options) { const factory = isFunction(target) ? animateProgress : animate$1; return factory(target, keyframesOrOptions, options); } /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const l = (l2) => null != l2 ? l2 : b; var browser = {}; var canPromise$1 = function() { return typeof Promise === "function" && Promise.prototype && Promise.prototype.then; }; var qrcode = {}; var utils$1 = {}; let toSJISFunction; const CODEWORDS_COUNT = [ 0, // Not used 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085, 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706 ]; utils$1.getSymbolSize = function getSymbolSize(version2) { if (!version2) throw new Error('"version" cannot be null or undefined'); if (version2 < 1 || version2 > 40) throw new Error('"version" should be in range from 1 to 40'); return version2 * 4 + 17; }; utils$1.getSymbolTotalCodewords = function getSymbolTotalCodewords(version2) { return CODEWORDS_COUNT[version2]; }; utils$1.getBCHDigit = function(data2) { let digit = 0; while (data2 !== 0) { digit++; data2 >>>= 1; } return digit; }; utils$1.setToSJISFunction = function setToSJISFunction(f2) { if (typeof f2 !== "function") { throw new Error('"toSJISFunc" is not a valid function.'); } toSJISFunction = f2; }; utils$1.isKanjiModeEnabled = function() { return typeof toSJISFunction !== "undefined"; }; utils$1.toSJIS = function toSJIS(kanji2) { return toSJISFunction(kanji2); }; var errorCorrectionLevel = {}; (function(exports) { exports.L = { bit: 1 }; exports.M = { bit: 0 }; exports.Q = { bit: 3 }; exports.H = { bit: 2 }; function fromString(string) { if (typeof string !== "string") { throw new Error("Param is not a string"); } const lcStr = string.toLowerCase(); switch (lcStr) { case "l": case "low": return exports.L; case "m": case "medium": return exports.M; case "q": case "quartile": return exports.Q; case "h": case "high": return exports.H; default: throw new Error("Unknown EC Level: " + string); } } exports.isValid = function isValid2(level) { return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4; }; exports.from = function from(value, defaultValue) { if (exports.isValid(value)) { return value; } try { return fromString(value); } catch (e2) { return defaultValue; } }; })(errorCorrectionLevel); function BitBuffer$1() { this.buffer = []; this.length = 0; } BitBuffer$1.prototype = { get: function(index) { const bufIndex = Math.floor(index / 8); return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) === 1; }, put: function(num, length) { for (let i2 = 0; i2 < length; i2++) { this.putBit((num >>> length - i2 - 1 & 1) === 1); } }, getLengthInBits: function() { return this.length; }, putBit: function(bit) { const bufIndex = Math.floor(this.length / 8); if (this.buffer.length <= bufIndex) { this.buffer.push(0); } if (bit) { this.buffer[bufIndex] |= 128 >>> this.length % 8; } this.length++; } }; var bitBuffer = BitBuffer$1; function BitMatrix$1(size) { if (!size || size < 1) { throw new Error("BitMatrix size must be defined and greater than 0"); } this.size = size; this.data = new Uint8Array(size * size); this.reservedBit = new Uint8Array(size * size); } BitMatrix$1.prototype.set = function(row, col, value, reserved) { const index = row * this.size + col; this.data[index] = value; if (reserved) this.reservedBit[index] = true; }; BitMatrix$1.prototype.get = function(row, col) { return this.data[row * this.size + col]; }; BitMatrix$1.prototype.xor = function(row, col, value) { this.data[row * this.size + col] ^= value; }; BitMatrix$1.prototype.isReserved = function(row, col) { return this.reservedBit[row * this.size + col]; }; var bitMatrix = BitMatrix$1; var alignmentPattern = {}; (function(exports) { const getSymbolSize3 = utils$1.getSymbolSize; exports.getRowColCoords = function getRowColCoords(version2) { if (version2 === 1) return []; const posCount = Math.floor(version2 / 7) + 2; const size = getSymbolSize3(version2); const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2; const positions = [size - 7]; for (let i2 = 1; i2 < posCount - 1; i2++) { positions[i2] = positions[i2 - 1] - intervals; } positions.push(6); return positions.reverse(); }; exports.getPositions = function getPositions2(version2) { const coords = []; const pos = exports.getRowColCoords(version2); const posLength = pos.length; for (let i2 = 0; i2 < posLength; i2++) { for (let j = 0; j < posLength; j++) { if (i2 === 0 && j === 0 || // top-left i2 === 0 && j === posLength - 1 || // bottom-left i2 === posLength - 1 && j === 0) { continue; } coords.push([pos[i2], pos[j]]); } } return coords; }; })(alignmentPattern); var finderPattern = {}; const getSymbolSize2 = utils$1.getSymbolSize; const FINDER_PATTERN_SIZE = 7; finderPattern.getPositions = function getPositions(version2) { const size = getSymbolSize2(version2); return [ // top-left [0, 0], // top-right [size - FINDER_PATTERN_SIZE, 0], // bottom-left [0, size - FINDER_PATTERN_SIZE] ]; }; var maskPattern = {}; (function(exports) { exports.Patterns = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 }; const PenaltyScores = { N1: 3, N2: 3, N3: 40, N4: 10 }; exports.isValid = function isValid2(mask) { return mask != null && mask !== "" && !isNaN(mask) && mask >= 0 && mask <= 7; }; exports.from = function from(value) { return exports.isValid(value) ? parseInt(value, 10) : void 0; }; exports.getPenaltyN1 = function getPenaltyN1(data2) { const size = data2.size; let points = 0; let sameCountCol = 0; let sameCountRow = 0; let lastCol = null; let lastRow = null; for (let row = 0; row < size; row++) { sameCountCol = sameCountRow = 0; lastCol = lastRow = null; for (let col = 0; col < size; col++) { let module = data2.get(row, col); if (module === lastCol) { sameCountCol++; } else { if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5); lastCol = module; sameCountCol = 1; } module = data2.get(col, row); if (module === lastRow) { sameCountRow++; } else { if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5); lastRow = module; sameCountRow = 1; } } if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5); if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5); } return points; }; exports.getPenaltyN2 = function getPenaltyN2(data2) { const size = data2.size; let points = 0; for (let row = 0; row < size - 1; row++) { for (let col = 0; col < size - 1; col++) { const last = data2.get(row, col) + data2.get(row, col + 1) + data2.get(row + 1, col) + data2.get(row + 1, col + 1); if (last === 4 || last === 0) points++; } } return points * PenaltyScores.N2; }; exports.getPenaltyN3 = function getPenaltyN3(data2) { const size = data2.size; let points = 0; let bitsCol = 0; let bitsRow = 0; for (let row = 0; row < size; row++) { bitsCol = bitsRow = 0; for (let col = 0; col < size; col++) { bitsCol = bitsCol << 1 & 2047 | data2.get(row, col); if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) points++; bitsRow = bitsRow << 1 & 2047 | data2.get(col, row); if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) points++; } } return points * PenaltyScores.N3; }; exports.getPenaltyN4 = function getPenaltyN4(data2) { let darkCount = 0; const modulesCount = data2.data.length; for (let i2 = 0; i2 < modulesCount; i2++) darkCount += data2.data[i2]; const k2 = Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10); return k2 * PenaltyScores.N4; }; function getMaskAt(maskPattern2, i2, j) { switch (maskPattern2) { case exports.Patterns.PATTERN000: return (i2 + j) % 2 === 0; case exports.Patterns.PATTERN001: return i2 % 2 === 0; case exports.Patterns.PATTERN010: return j % 3 === 0; case exports.Patterns.PATTERN011: return (i2 + j) % 3 === 0; case exports.Patterns.PATTERN100: return (Math.floor(i2 / 2) + Math.floor(j / 3)) % 2 === 0; case exports.Patterns.PATTERN101: return i2 * j % 2 + i2 * j % 3 === 0; case exports.Patterns.PATTERN110: return (i2 * j % 2 + i2 * j % 3) % 2 === 0; case exports.Patterns.PATTERN111: return (i2 * j % 3 + (i2 + j) % 2) % 2 === 0; default: throw new Error("bad maskPattern:" + maskPattern2); } } exports.applyMask = function applyMask(pattern, data2) { const size = data2.size; for (let col = 0; col < size; col++) { for (let row = 0; row < size; row++) { if (data2.isReserved(row, col)) continue; data2.xor(row, col, getMaskAt(pattern, row, col)); } } }; exports.getBestMask = function getBestMask(data2, setupFormatFunc) { const numPatterns = Object.keys(exports.Patterns).length; let bestPattern = 0; let lowerPenalty = Infinity; for (let p2 = 0; p2 < numPatterns; p2++) { setupFormatFunc(p2); exports.applyMask(p2, data2); const penalty = exports.getPenaltyN1(data2) + exports.getPenaltyN2(data2) + exports.getPenaltyN3(data2) + exports.getPenaltyN4(data2); exports.applyMask(p2, data2); if (penalty < lowerPenalty) { lowerPenalty = penalty; bestPattern = p2; } } return bestPattern; }; })(maskPattern); var errorCorrectionCode = {}; const ECLevel$1 = errorCorrectionLevel; const EC_BLOCKS_TABLE = [ // L M Q H 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 4, 1, 2, 4, 4, 2, 4, 4, 4, 2, 4, 6, 5, 2, 4, 6, 6, 2, 5, 8, 8, 4, 5, 8, 8, 4, 5, 8, 11, 4, 8, 10, 11, 4, 9, 12, 16, 4, 9, 16, 16, 6, 10, 12, 18, 6, 10, 17, 16, 6, 11, 16, 19, 6, 13, 18, 21, 7, 14, 21, 25, 8, 16, 20, 25, 8, 17, 23, 25, 9, 17, 23, 34, 9, 18, 25, 30, 10, 20, 27, 32, 12, 21, 29, 35, 12, 23, 34, 37, 12, 25, 34, 40, 13, 26, 35, 42, 14, 28, 38, 45, 15, 29, 40, 48, 16, 31, 43, 51, 17, 33, 45, 54, 18, 35, 48, 57, 19, 37, 51, 60, 19, 38, 53, 63, 20, 40, 56, 66, 21, 43, 59, 70, 22, 45, 62, 74, 24, 47, 65, 77, 25, 49, 68, 81 ]; const EC_CODEWORDS_TABLE = [ // L M Q H 7, 10, 13, 17, 10, 16, 22, 28, 15, 26, 36, 44, 20, 36, 52, 64, 26, 48, 72, 88, 36, 64, 96, 112, 40, 72, 108, 130, 48, 88, 132, 156, 60, 110, 160, 192, 72, 130, 192, 224, 80, 150, 224, 264, 96, 176, 260, 308, 104, 198, 288, 352, 120, 216, 320, 384, 132, 240, 360, 432, 144, 280, 408, 480, 168, 308, 448, 532, 180, 338, 504, 588, 196, 364, 546, 650, 224, 416, 600, 700, 224, 442, 644, 750, 252, 476, 690, 816, 270, 504, 750, 900, 300, 560, 810, 960, 312, 588, 870, 1050, 336, 644, 952, 1110, 360, 700, 1020, 1200, 390, 728, 1050, 1260, 420, 784, 1140, 1350, 450, 812, 1200, 1440, 480, 868, 1290, 1530, 510, 924, 1350, 1620, 540, 980, 1440, 1710, 570, 1036, 1530, 1800, 570, 1064, 1590, 1890, 600, 1120, 1680, 1980, 630, 1204, 1770, 2100, 660, 1260, 1860, 2220, 720, 1316, 1950, 2310, 750, 1372, 2040, 2430 ]; errorCorrectionCode.getBlocksCount = function getBlocksCount(version2, errorCorrectionLevel2) { switch (errorCorrectionLevel2) { case ECLevel$1.L: return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 0]; case ECLevel$1.M: return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 1]; case ECLevel$1.Q: return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 2]; case ECLevel$1.H: return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 3]; default: return void 0; } }; errorCorrectionCode.getTotalCodewordsCount = function getTotalCodewordsCount(version2, errorCorrectionLevel2) { switch (errorCorrectionLevel2) { case ECLevel$1.L: return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 0]; case ECLevel$1.M: return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 1]; case ECLevel$1.Q: return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 2]; case ECLevel$1.H: return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 3]; default: return void 0; } }; var polynomial = {}; var galoisField = {}; const EXP_TABLE = new Uint8Array(512); const LOG_TABLE = new Uint8Array(256); (function initTables() { let x2 = 1; for (let i2 = 0; i2 < 255; i2++) { EXP_TABLE[i2] = x2; LOG_TABLE[x2] = i2; x2 <<= 1; if (x2 & 256) { x2 ^= 285; } } for (let i2 = 255; i2 < 512; i2++) { EXP_TABLE[i2] = EXP_TABLE[i2 - 255]; } })(); galoisField.log = function log(n2) { if (n2 < 1) throw new Error("log(" + n2 + ")"); return LOG_TABLE[n2]; }; galoisField.exp = function exp(n2) { return EXP_TABLE[n2]; }; galoisField.mul = function mul(x2, y2) { if (x2 === 0 || y2 === 0) return 0; return EXP_TABLE[LOG_TABLE[x2] + LOG_TABLE[y2]]; }; (function(exports) { const GF = galoisField; exports.mul = function mul2(p1, p2) { const coeff = new Uint8Array(p1.length + p2.length - 1); for (let i2 = 0; i2 < p1.length; i2++) { for (let j = 0; j < p2.length; j++) { coeff[i2 + j] ^= GF.mul(p1[i2], p2[j]); } } return coeff; }; exports.mod = function mod(divident, divisor) { let result = new Uint8Array(divident); while (result.length - divisor.length >= 0) { const coeff = result[0]; for (let i2 = 0; i2 < divisor.length; i2++) { result[i2] ^= GF.mul(divisor[i2], coeff); } let offset = 0; while (offset < result.length && result[offset] === 0) offset++; result = result.slice(offset); } return result; }; exports.generateECPolynomial = function generateECPolynomial(degree) { let poly = new Uint8Array([1]); for (let i2 = 0; i2 < degree; i2++) { poly = exports.mul(poly, new Uint8Array([1, GF.exp(i2)])); } return poly; }; })(polynomial); const Polynomial = polynomial; function ReedSolomonEncoder$1(degree) { this.genPoly = void 0; this.degree = degree; if (this.degree) this.initialize(this.degree); } ReedSolomonEncoder$1.prototype.initialize = function initialize(degree) { this.degree = degree; this.genPoly = Polynomial.generateECPolynomial(this.degree); }; ReedSolomonEncoder$1.prototype.encode = function encode(data2) { if (!this.genPoly) { throw new Error("Encoder not initialized"); } const paddedData = new Uint8Array(data2.length + this.degree); paddedData.set(data2); const remainder = Polynomial.mod(paddedData, this.genPoly); const start = this.degree - remainder.length; if (start > 0) { const buff = new Uint8Array(this.degree); buff.set(remainder, start); return buff; } return remainder; }; var reedSolomonEncoder = ReedSolomonEncoder$1; var version = {}; var mode = {}; var versionCheck = {}; versionCheck.isValid = function isValid(version2) { return !isNaN(version2) && version2 >= 1 && version2 <= 40; }; var regex = {}; const numeric = "[0-9]+"; const alphanumeric = "[A-Z $%*+\\-./:]+"; let kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+"; kanji = kanji.replace(/u/g, "\\u"); const byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+"; regex.KANJI = new RegExp(kanji, "g"); regex.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"); regex.BYTE = new RegExp(byte, "g"); regex.NUMERIC = new RegExp(numeric, "g"); regex.ALPHANUMERIC = new RegExp(alphanumeric, "g"); const TEST_KANJI = new RegExp("^" + kanji + "$"); const TEST_NUMERIC = new RegExp("^" + numeric + "$"); const TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$"); regex.testKanji = function testKanji(str) { return TEST_KANJI.test(str); }; regex.testNumeric = function testNumeric(str) { return TEST_NUMERIC.test(str); }; regex.testAlphanumeric = function testAlphanumeric(str) { return TEST_ALPHANUMERIC.test(str); }; (function(exports) { const VersionCheck = versionCheck; const Regex = regex; exports.NUMERIC = { id: "Numeric", bit: 1 << 0, ccBits: [10, 12, 14] }; exports.ALPHANUMERIC = { id: "Alphanumeric", bit: 1 << 1, ccBits: [9, 11, 13] }; exports.BYTE = { id: "Byte", bit: 1 << 2, ccBits: [8, 16, 16] }; exports.KANJI = { id: "Kanji", bit: 1 << 3, ccBits: [8, 10, 12] }; exports.MIXED = { bit: -1 }; exports.getCharCountIndicator = function getCharCountIndicator(mode2, version2) { if (!mode2.ccBits) throw new Error("Invalid mode: " + mode2); if (!VersionCheck.isValid(version2)) { throw new Error("Invalid version: " + version2); } if (version2 >= 1 && version2 < 10) return mode2.ccBits[0]; else if (version2 < 27) return mode2.ccBits[1]; return mode2.ccBits[2]; }; exports.getBestModeForData = function getBestModeForData(dataStr) { if (Regex.testNumeric(dataStr)) return exports.NUMERIC; else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC; else if (Regex.testKanji(dataStr)) return exports.KANJI; else return exports.BYTE; }; exports.toString = function toString(mode2) { if (mode2 && mode2.id) return mode2.id; throw new Error("Invalid mode"); }; exports.isValid = function isValid2(mode2) { return mode2 && mode2.bit && mode2.ccBits; }; function fromString(string) { if (typeof string !== "string") { throw new Error("Param is not a string"); } const lcStr = string.toLowerCase(); switch (lcStr) { case "numeric": return exports.NUMERIC; case "alphanumeric": return exports.ALPHANUMERIC; case "kanji": return exports.KANJI; case "byte": return exports.BYTE; default: throw new Error("Unknown mode: " + string); } } exports.from = function from(value, defaultValue) { if (exports.isValid(value)) { return value; } try { return fromString(value); } catch (e2) { return defaultValue; } }; })(mode); (function(exports) { const Utils2 = utils$1; const ECCode2 = errorCorrectionCode; const ECLevel2 = errorCorrectionLevel; const Mode2 = mode; const VersionCheck = versionCheck; const G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0; const G18_BCH = Utils2.getBCHDigit(G18); function getBestVersionForDataLength(mode2, length, errorCorrectionLevel2) { for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, mode2)) { return currentVersion; } } return void 0; } function getReservedBitsCount(mode2, version2) { return Mode2.getCharCountIndicator(mode2, version2) + 4; } function getTotalBitsFromDataArray(segments2, version2) { let totalBits = 0; segments2.forEach(function(data2) { const reservedBits = getReservedBitsCount(data2.mode, version2); totalBits += reservedBits + data2.getBitsLength(); }); return totalBits; } function getBestVersionForMixedData(segments2, errorCorrectionLevel2) { for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { const length = getTotalBitsFromDataArray(segments2, currentVersion); if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, Mode2.MIXED)) { return currentVersion; } } return void 0; } exports.from = function from(value, defaultValue) { if (VersionCheck.isValid(value)) { return parseInt(value, 10); } return defaultValue; }; exports.getCapacity = function getCapacity(version2, errorCorrectionLevel2, mode2) { if (!VersionCheck.isValid(version2)) { throw new Error("Invalid QR Code version"); } if (typeof mode2 === "undefined") mode2 = Mode2.BYTE; const totalCodewords = Utils2.getSymbolTotalCodewords(version2); const ecTotalCodewords = ECCode2.getTotalCodewordsCount(version2, errorCorrectionLevel2); const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; if (mode2 === Mode2.MIXED) return dataTotalCodewordsBits; const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode2, version2); switch (mode2) { case Mode2.NUMERIC: return Math.floor(usableBits / 10 * 3); case Mode2.ALPHANUMERIC: return Math.floor(usableBits / 11 * 2); case Mode2.KANJI: return Math.floor(usableBits / 13); case Mode2.BYTE: default: return Math.floor(usableBits / 8); } }; exports.getBestVersionForData = function getBestVersionForData(data2, errorCorrectionLevel2) { let seg; const ecl = ECLevel2.from(errorCorrectionLevel2, ECLevel2.M); if (Array.isArray(data2)) { if (data2.length > 1) { return getBestVersionForMixedData(data2, ecl); } if (data2.length === 0) { return 1; } seg = data2[0]; } else { seg = data2; } return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl); }; exports.getEncodedBits = function getEncodedBits2(version2) { if (!VersionCheck.isValid(version2) || version2 < 7) { throw new Error("Invalid QR Code version"); } let d3 = version2 << 12; while (Utils2.getBCHDigit(d3) - G18_BCH >= 0) { d3 ^= G18 << Utils2.getBCHDigit(d3) - G18_BCH; } return version2 << 12 | d3; }; })(version); var formatInfo = {}; const Utils$3 = utils$1; const G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0; const G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1; const G15_BCH = Utils$3.getBCHDigit(G15); formatInfo.getEncodedBits = function getEncodedBits(errorCorrectionLevel2, mask) { const data2 = errorCorrectionLevel2.bit << 3 | mask; let d3 = data2 << 10; while (Utils$3.getBCHDigit(d3) - G15_BCH >= 0) { d3 ^= G15 << Utils$3.getBCHDigit(d3) - G15_BCH; } return (data2 << 10 | d3) ^ G15_MASK; }; var segments = {}; const Mode$4 = mode; function NumericData(data2) { this.mode = Mode$4.NUMERIC; this.data = data2.toString(); } NumericData.getBitsLength = function getBitsLength(length) { return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0); }; NumericData.prototype.getLength = function getLength() { return this.data.length; }; NumericData.prototype.getBitsLength = function getBitsLength2() { return NumericData.getBitsLength(this.data.length); }; NumericData.prototype.write = function write(bitBuffer2) { let i2, group, value; for (i2 = 0; i2 + 3 <= this.data.length; i2 += 3) { group = this.data.substr(i2, 3); value = parseInt(group, 10); bitBuffer2.put(value, 10); } const remainingNum = this.data.length - i2; if (remainingNum > 0) { group = this.data.substr(i2); value = parseInt(group, 10); bitBuffer2.put(value, remainingNum * 3 + 1); } }; var numericData = NumericData; const Mode$3 = mode; const ALPHA_NUM_CHARS = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", " ", "$", "%", "*", "+", "-", ".", "/", ":" ]; function AlphanumericData(data2) { this.mode = Mode$3.ALPHANUMERIC; this.data = data2; } AlphanumericData.getBitsLength = function getBitsLength3(length) { return 11 * Math.floor(length / 2) + 6 * (length % 2); }; AlphanumericData.prototype.getLength = function getLength2() { return this.data.length; }; AlphanumericData.prototype.getBitsLength = function getBitsLength4() { return AlphanumericData.getBitsLength(this.data.length); }; AlphanumericData.prototype.write = function write2(bitBuffer2) { let i2; for (i2 = 0; i2 + 2 <= this.data.length; i2 += 2) { let value = ALPHA_NUM_CHARS.indexOf(this.data[i2]) * 45; value += ALPHA_NUM_CHARS.indexOf(this.data[i2 + 1]); bitBuffer2.put(value, 11); } if (this.data.length % 2) { bitBuffer2.put(ALPHA_NUM_CHARS.indexOf(this.data[i2]), 6); } }; var alphanumericData = AlphanumericData; var encodeUtf8$1 = function encodeUtf8(input) { var result = []; var size = input.length; for (var index = 0; index < size; index++) { var point = input.charCodeAt(index); if (point >= 55296 && point <= 56319 && size > index + 1) { var second = input.charCodeAt(index + 1); if (second >= 56320 && second <= 57343) { point = (point - 55296) * 1024 + second - 56320 + 65536; index += 1; } } if (point < 128) { result.push(point); continue; } if (point < 2048) { result.push(point >> 6 | 192); result.push(point & 63 | 128); continue; } if (point < 55296 || point >= 57344 && point < 65536) { result.push(point >> 12 | 224); result.push(point >> 6 & 63 | 128); result.push(point & 63 | 128); continue; } if (point >= 65536 && point <= 1114111) { result.push(point >> 18 | 240); result.push(point >> 12 & 63 | 128); result.push(point >> 6 & 63 | 128); result.push(point & 63 | 128); continue; } result.push(239, 191, 189); } return new Uint8Array(result).buffer; }; const encodeUtf82 = encodeUtf8$1; const Mode$2 = mode; function ByteData(data2) { this.mode = Mode$2.BYTE; if (typeof data2 === "string") { data2 = encodeUtf82(data2); } this.data = new Uint8Array(data2); } ByteData.getBitsLength = function getBitsLength5(length) { return length * 8; }; ByteData.prototype.getLength = function getLength3() { return this.data.length; }; ByteData.prototype.getBitsLength = function getBitsLength6() { return ByteData.getBitsLength(this.data.length); }; ByteData.prototype.write = function(bitBuffer2) { for (let i2 = 0, l2 = this.data.length; i2 < l2; i2++) { bitBuffer2.put(this.data[i2], 8); } }; var byteData = ByteData; const Mode$1 = mode; const Utils$2 = utils$1; function KanjiData(data2) { this.mode = Mode$1.KANJI; this.data = data2; } KanjiData.getBitsLength = function getBitsLength7(length) { return length * 13; }; KanjiData.prototype.getLength = function getLength4() { return this.data.length; }; KanjiData.prototype.getBitsLength = function getBitsLength8() { return KanjiData.getBitsLength(this.data.length); }; KanjiData.prototype.write = function(bitBuffer2) { let i2; for (i2 = 0; i2 < this.data.length; i2++) { let value = Utils$2.toSJIS(this.data[i2]); if (value >= 33088 && value <= 40956) { value -= 33088; } else if (value >= 57408 && value <= 60351) { value -= 49472; } else { throw new Error( "Invalid SJIS character: " + this.data[i2] + "\nMake sure your charset is UTF-8" ); } value = (value >>> 8 & 255) * 192 + (value & 255); bitBuffer2.put(value, 13); } }; var kanjiData = KanjiData; (function(exports) { const Mode2 = mode; const NumericData2 = numericData; const AlphanumericData2 = alphanumericData; const ByteData2 = byteData; const KanjiData2 = kanjiData; const Regex = regex; const Utils2 = utils$1; const dijkstra = dijkstraExports; function getStringByteLength(str) { return unescape(encodeURIComponent(str)).length; } function getSegments(regex2, mode2, str) { const segments2 = []; let result; while ((result = regex2.exec(str)) !== null) { segments2.push({ data: result[0], index: result.index, mode: mode2, length: result[0].length }); } return segments2; } function getSegmentsFromString(dataStr) { const numSegs = getSegments(Regex.NUMERIC, Mode2.NUMERIC, dataStr); const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode2.ALPHANUMERIC, dataStr); let byteSegs; let kanjiSegs; if (Utils2.isKanjiModeEnabled()) { byteSegs = getSegments(Regex.BYTE, Mode2.BYTE, dataStr); kanjiSegs = getSegments(Regex.KANJI, Mode2.KANJI, dataStr); } else { byteSegs = getSegments(Regex.BYTE_KANJI, Mode2.BYTE, dataStr); kanjiSegs = []; } const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs); return segs.sort(function(s1, s2) { return s1.index - s2.index; }).map(function(obj) { return { data: obj.data, mode: obj.mode, length: obj.length }; }); } function getSegmentBitsLength(length, mode2) { switch (mode2) { case Mode2.NUMERIC: return NumericData2.getBitsLength(length); case Mode2.ALPHANUMERIC: return AlphanumericData2.getBitsLength(length); case Mode2.KANJI: return KanjiData2.getBitsLength(length); case Mode2.BYTE: return ByteData2.getBitsLength(length); } } function mergeSegments(segs) { return segs.reduce(function(acc, curr) { const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null; if (prevSeg && prevSeg.mode === curr.mode) { acc[acc.length - 1].data += curr.data; return acc; } acc.push(curr); return acc; }, []); } function buildNodes(segs) { const nodes = []; for (let i2 = 0; i2 < segs.length; i2++) { const seg = segs[i2]; switch (seg.mode) { case Mode2.NUMERIC: nodes.push([ seg, { data: seg.data, mode: Mode2.ALPHANUMERIC, length: seg.length }, { data: seg.data, mode: Mode2.BYTE, length: seg.length } ]); break; case Mode2.ALPHANUMERIC: nodes.push([ seg, { data: seg.data, mode: Mode2.BYTE, length: seg.length } ]); break; case Mode2.KANJI: nodes.push([ seg, { data: seg.data, mode: Mode2.BYTE, length: getStringByteLength(seg.data) } ]); break; case Mode2.BYTE: nodes.push([ { data: seg.data, mode: Mode2.BYTE, length: getStringByteLength(seg.data) } ]); } } return nodes; } function buildGraph(nodes, version2) { const table = {}; const graph = { start: {} }; let prevNodeIds = ["start"]; for (let i2 = 0; i2 < nodes.length; i2++) { const nodeGroup = nodes[i2]; const currentNodeIds = []; for (let j = 0; j < nodeGroup.length; j++) { const node = nodeGroup[j]; const key = "" + i2 + j; currentNodeIds.push(key); table[key] = { node, lastCount: 0 }; graph[key] = {}; for (let n2 = 0; n2 < prevNodeIds.length; n2++) { const prevNodeId = prevNodeIds[n2]; if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) { graph[prevNodeId][key] = getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node.mode); table[prevNodeId].lastCount += node.length; } else { if (table[prevNodeId]) table[prevNodeId].lastCount = node.length; graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) + 4 + Mode2.getCharCountIndicator(node.mode, version2); } } } prevNodeIds = currentNodeIds; } for (let n2 = 0; n2 < prevNodeIds.length; n2++) { graph[prevNodeIds[n2]].end = 0; } return { map: graph, table }; } function buildSingleSegment(data2, modesHint) { let mode2; const bestMode = Mode2.getBestModeForData(data2); mode2 = Mode2.from(modesHint, bestMode); if (mode2 !== Mode2.BYTE && mode2.bit < bestMode.bit) { throw new Error('"' + data2 + '" cannot be encoded with mode ' + Mode2.toString(mode2) + ".\n Suggested mode is: " + Mode2.toString(bestMode)); } if (mode2 === Mode2.KANJI && !Utils2.isKanjiModeEnabled()) { mode2 = Mode2.BYTE; } switch (mode2) { case Mode2.NUMERIC: return new NumericData2(data2); case Mode2.ALPHANUMERIC: return new AlphanumericData2(data2); case Mode2.KANJI: return new KanjiData2(data2); case Mode2.BYTE: return new ByteData2(data2); } } exports.fromArray = function fromArray(array) { return array.reduce(function(acc, seg) { if (typeof seg === "string") { acc.push(buildSingleSegment(seg, null)); } else if (seg.data) { acc.push(buildSingleSegment(seg.data, seg.mode)); } return acc; }, []); }; exports.fromString = function fromString(data2, version2) { const segs = getSegmentsFromString(data2, Utils2.isKanjiModeEnabled()); const nodes = buildNodes(segs); const graph = buildGraph(nodes, version2); const path = dijkstra.find_path(graph.map, "start", "end"); const optimizedSegs = []; for (let i2 = 1; i2 < path.length - 1; i2++) { optimizedSegs.push(graph.table[path[i2]].node); } return exports.fromArray(mergeSegments(optimizedSegs)); }; exports.rawSplit = function rawSplit(data2) { return exports.fromArray( getSegmentsFromString(data2, Utils2.isKanjiModeEnabled()) ); }; })(segments); const Utils$1 = utils$1; const ECLevel = errorCorrectionLevel; const BitBuffer = bitBuffer; const BitMatrix = bitMatrix; const AlignmentPattern = alignmentPattern; const FinderPattern = finderPattern; const MaskPattern = maskPattern; const ECCode = errorCorrectionCode; const ReedSolomonEncoder = reedSolomonEncoder; const Version = version; const FormatInfo = formatInfo; const Mode = mode; const Segments = segments; function setupFinderPattern(matrix, version2) { const size = matrix.size; const pos = FinderPattern.getPositions(version2); for (let i2 = 0; i2 < pos.length; i2++) { const row = pos[i2][0]; const col = pos[i2][1]; for (let r2 = -1; r2 <= 7; r2++) { if (row + r2 <= -1 || size <= row + r2) continue; for (let c2 = -1; c2 <= 7; c2++) { if (col + c2 <= -1 || size <= col + c2) continue; if (r2 >= 0 && r2 <= 6 && (c2 === 0 || c2 === 6) || c2 >= 0 && c2 <= 6 && (r2 === 0 || r2 === 6) || r2 >= 2 && r2 <= 4 && c2 >= 2 && c2 <= 4) { matrix.set(row + r2, col + c2, true, true); } else { matrix.set(row + r2, col + c2, false, true); } } } } } function setupTimingPattern(matrix) { const size = matrix.size; for (let r2 = 8; r2 < size - 8; r2++) { const value = r2 % 2 === 0; matrix.set(r2, 6, value, true); matrix.set(6, r2, value, true); } } function setupAlignmentPattern(matrix, version2) { const pos = AlignmentPattern.getPositions(version2); for (let i2 = 0; i2 < pos.length; i2++) { const row = pos[i2][0]; const col = pos[i2][1]; for (let r2 = -2; r2 <= 2; r2++) { for (let c2 = -2; c2 <= 2; c2++) { if (r2 === -2 || r2 === 2 || c2 === -2 || c2 === 2 || r2 === 0 && c2 === 0) { matrix.set(row + r2, col + c2, true, true); } else { matrix.set(row + r2, col + c2, false, true); } } } } } function setupVersionInfo(matrix, version2) { const size = matrix.size; const bits = Version.getEncodedBits(version2); let row, col, mod; for (let i2 = 0; i2 < 18; i2++) { row = Math.floor(i2 / 3); col = i2 % 3 + size - 8 - 3; mod = (bits >> i2 & 1) === 1; matrix.set(row, col, mod, true); matrix.set(col, row, mod, true); } } function setupFormatInfo(matrix, errorCorrectionLevel2, maskPattern2) { const size = matrix.size; const bits = FormatInfo.getEncodedBits(errorCorrectionLevel2, maskPattern2); let i2, mod; for (i2 = 0; i2 < 15; i2++) { mod = (bits >> i2 & 1) === 1; if (i2 < 6) { matrix.set(i2, 8, mod, true); } else if (i2 < 8) { matrix.set(i2 + 1, 8, mod, true); } else { matrix.set(size - 15 + i2, 8, mod, true); } if (i2 < 8) { matrix.set(8, size - i2 - 1, mod, true); } else if (i2 < 9) { matrix.set(8, 15 - i2 - 1 + 1, mod, true); } else { matrix.set(8, 15 - i2 - 1, mod, true); } } matrix.set(size - 8, 8, 1, true); } function setupData(matrix, data2) { const size = matrix.size; let inc = -1; let row = size - 1; let bitIndex = 7; let byteIndex = 0; for (let col = size - 1; col > 0; col -= 2) { if (col === 6) col--; while (true) { for (let c2 = 0; c2 < 2; c2++) { if (!matrix.isReserved(row, col - c2)) { let dark = false; if (byteIndex < data2.length) { dark = (data2[byteIndex] >>> bitIndex & 1) === 1; } matrix.set(row, col - c2, dark); bitIndex--; if (bitIndex === -1) { byteIndex++; bitIndex = 7; } } } row += inc; if (row < 0 || size <= row) { row -= inc; inc = -inc; break; } } } } function createData(version2, errorCorrectionLevel2, segments2) { const buffer = new BitBuffer(); segments2.forEach(function(data2) { buffer.put(data2.mode.bit, 4); buffer.put(data2.getLength(), Mode.getCharCountIndicator(data2.mode, version2)); data2.write(buffer); }); const totalCodewords = Utils$1.getSymbolTotalCodewords(version2); const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) { buffer.put(0, 4); } while (buffer.getLengthInBits() % 8 !== 0) { buffer.putBit(0); } const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8; for (let i2 = 0; i2 < remainingByte; i2++) { buffer.put(i2 % 2 ? 17 : 236, 8); } return createCodewords(buffer, version2, errorCorrectionLevel2); } function createCodewords(bitBuffer2, version2, errorCorrectionLevel2) { const totalCodewords = Utils$1.getSymbolTotalCodewords(version2); const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); const dataTotalCodewords = totalCodewords - ecTotalCodewords; const ecTotalBlocks = ECCode.getBlocksCount(version2, errorCorrectionLevel2); const blocksInGroup2 = totalCodewords % ecTotalBlocks; const blocksInGroup1 = ecTotalBlocks - blocksInGroup2; const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks); const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks); const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1; const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1; const rs = new ReedSolomonEncoder(ecCount); let offset = 0; const dcData = new Array(ecTotalBlocks); const ecData = new Array(ecTotalBlocks); let maxDataSize = 0; const buffer = new Uint8Array(bitBuffer2.buffer); for (let b2 = 0; b2 < ecTotalBlocks; b2++) { const dataSize = b2 < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2; dcData[b2] = buffer.slice(offset, offset + dataSize); ecData[b2] = rs.encode(dcData[b2]); offset += dataSize; maxDataSize = Math.max(maxDataSize, dataSize); } const data2 = new Uint8Array(totalCodewords); let index = 0; let i2, r2; for (i2 = 0; i2 < maxDataSize; i2++) { for (r2 = 0; r2 < ecTotalBlocks; r2++) { if (i2 < dcData[r2].length) { data2[index++] = dcData[r2][i2]; } } } for (i2 = 0; i2 < ecCount; i2++) { for (r2 = 0; r2 < ecTotalBlocks; r2++) { data2[index++] = ecData[r2][i2]; } } return data2; } function createSymbol(data2, version2, errorCorrectionLevel2, maskPattern2) { let segments2; if (Array.isArray(data2)) { segments2 = Segments.fromArray(data2); } else if (typeof data2 === "string") { let estimatedVersion = version2; if (!estimatedVersion) { const rawSegments = Segments.rawSplit(data2); estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel2); } segments2 = Segments.fromString(data2, estimatedVersion || 40); } else { throw new Error("Invalid data"); } const bestVersion = Version.getBestVersionForData(segments2, errorCorrectionLevel2); if (!bestVersion) { throw new Error("The amount of data is too big to be stored in a QR Code"); } if (!version2) { version2 = bestVersion; } else if (version2 < bestVersion) { throw new Error( "\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n" ); } const dataBits = createData(version2, errorCorrectionLevel2, segments2); const moduleCount = Utils$1.getSymbolSize(version2); const modules = new BitMatrix(moduleCount); setupFinderPattern(modules, version2); setupTimingPattern(modules); setupAlignmentPattern(modules, version2); setupFormatInfo(modules, errorCorrectionLevel2, 0); if (version2 >= 7) { setupVersionInfo(modules, version2); } setupData(modules, dataBits); if (isNaN(maskPattern2)) { maskPattern2 = MaskPattern.getBestMask( modules, setupFormatInfo.bind(null, modules, errorCorrectionLevel2) ); } MaskPattern.applyMask(maskPattern2, modules); setupFormatInfo(modules, errorCorrectionLevel2, maskPattern2); return { modules, version: version2, errorCorrectionLevel: errorCorrectionLevel2, maskPattern: maskPattern2, segments: segments2 }; } qrcode.create = function create(data2, options) { if (typeof data2 === "undefined" || data2 === "") { throw new Error("No input text"); } let errorCorrectionLevel2 = ECLevel.M; let version2; let mask; if (typeof options !== "undefined") { errorCorrectionLevel2 = ECLevel.from(options.errorCorrectionLevel, ECLevel.M); version2 = Version.from(options.version); mask = MaskPattern.from(options.maskPattern); if (options.toSJISFunc) { Utils$1.setToSJISFunction(options.toSJISFunc); } } return createSymbol(data2, version2, errorCorrectionLevel2, mask); }; var canvas = {}; var utils = {}; (function(exports) { function hex2rgba(hex) { if (typeof hex === "number") { hex = hex.toString(); } if (typeof hex !== "string") { throw new Error("Color should be defined as hex string"); } let hexCode = hex.slice().replace("#", "").split(""); if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) { throw new Error("Invalid hex color: " + hex); } if (hexCode.length === 3 || hexCode.length === 4) { hexCode = Array.prototype.concat.apply([], hexCode.map(function(c2) { return [c2, c2]; })); } if (hexCode.length === 6) hexCode.push("F", "F"); const hexValue = parseInt(hexCode.join(""), 16); return { r: hexValue >> 24 & 255, g: hexValue >> 16 & 255, b: hexValue >> 8 & 255, a: hexValue & 255, hex: "#" + hexCode.slice(0, 6).join("") }; } exports.getOptions = function getOptions2(options) { if (!options) options = {}; if (!options.color) options.color = {}; const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin; const width = options.width && options.width >= 21 ? options.width : void 0; const scale = options.scale || 4; return { width, scale: width ? 4 : scale, margin, color: { dark: hex2rgba(options.color.dark || "#000000ff"), light: hex2rgba(options.color.light || "#ffffffff") }, type: options.type, rendererOpts: options.rendererOpts || {} }; }; exports.getScale = function getScale(qrSize, opts) { return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale; }; exports.getImageWidth = function getImageWidth(qrSize, opts) { const scale = exports.getScale(qrSize, opts); return Math.floor((qrSize + opts.margin * 2) * scale); }; exports.qrToImageData = function qrToImageData(imgData, qr, opts) { const size = qr.modules.size; const data2 = qr.modules.data; const scale = exports.getScale(size, opts); const symbolSize = Math.floor((size + opts.margin * 2) * scale); const scaledMargin = opts.margin * scale; const palette = [opts.color.light, opts.color.dark]; for (let i2 = 0; i2 < symbolSize; i2++) { for (let j = 0; j < symbolSize; j++) { let posDst = (i2 * symbolSize + j) * 4; let pxColor = opts.color.light; if (i2 >= scaledMargin && j >= scaledMargin && i2 < symbolSize - scaledMargin && j < symbolSize - scaledMargin) { const iSrc = Math.floor((i2 - scaledMargin) / scale); const jSrc = Math.floor((j - scaledMargin) / scale); pxColor = palette[data2[iSrc * size + jSrc] ? 1 : 0]; } imgData[posDst++] = pxColor.r; imgData[posDst++] = pxColor.g; imgData[posDst++] = pxColor.b; imgData[posDst] = pxColor.a; } } }; })(utils); (function(exports) { const Utils2 = utils; function clearCanvas(ctx, canvas2, size) { ctx.clearRect(0, 0, canvas2.width, canvas2.height); if (!canvas2.style) canvas2.style = {}; canvas2.height = size; canvas2.width = size; canvas2.style.height = size + "px"; canvas2.style.width = size + "px"; } function getCanvasElement() { try { return document.createElement("canvas"); } catch (e2) { throw new Error("You need to specify a canvas element"); } } exports.render = function render2(qrData, canvas2, options) { let opts = options; let canvasEl = canvas2; if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { opts = canvas2; canvas2 = void 0; } if (!canvas2) { canvasEl = getCanvasElement(); } opts = Utils2.getOptions(opts); const size = Utils2.getImageWidth(qrData.modules.size, opts); const ctx = canvasEl.getContext("2d"); const image = ctx.createImageData(size, size); Utils2.qrToImageData(image.data, qrData, opts); clearCanvas(ctx, canvasEl, size); ctx.putImageData(image, 0, 0); return canvasEl; }; exports.renderToDataURL = function renderToDataURL(qrData, canvas2, options) { let opts = options; if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { opts = canvas2; canvas2 = void 0; } if (!opts) opts = {}; const canvasEl = exports.render(qrData, canvas2, opts); const type = opts.type || "image/png"; const rendererOpts = opts.rendererOpts || {}; return canvasEl.toDataURL(type, rendererOpts.quality); }; })(canvas); var svgTag = {}; const Utils = utils; function getColorAttrib(color, attrib) { const alpha = color.a / 255; const str = attrib + '="' + color.hex + '"'; return alpha < 1 ? str + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str; } function svgCmd(cmd, x2, y2) { let str = cmd + x2; if (typeof y2 !== "undefined") str += " " + y2; return str; } function qrToPath(data2, size, margin) { let path = ""; let moveBy = 0; let newRow = false; let lineLength = 0; for (let i2 = 0; i2 < data2.length; i2++) { const col = Math.floor(i2 % size); const row = Math.floor(i2 / size); if (!col && !newRow) newRow = true; if (data2[i2]) { lineLength++; if (!(i2 > 0 && col > 0 && data2[i2 - 1])) { path += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0); moveBy = 0; newRow = false; } if (!(col + 1 < size && data2[i2 + 1])) { path += svgCmd("h", lineLength); lineLength = 0; } } else { moveBy++; } } return path; } svgTag.render = function render(qrData, options, cb) { const opts = Utils.getOptions(options); const size = qrData.modules.size; const data2 = qrData.modules.data; const qrcodesize = size + opts.margin * 2; const bg = !opts.color.light.a ? "" : "'; const path = "'; const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"'; const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" '; const svgTag2 = '' + bg + path + "\n"; if (typeof cb === "function") { cb(null, svgTag2); } return svgTag2; }; const canPromise = canPromise$1; const QRCode = qrcode; const CanvasRenderer = canvas; const SvgRenderer = svgTag; function renderCanvas(renderFunc, canvas2, text, opts, cb) { const args = [].slice.call(arguments, 1); const argsNum = args.length; const isLastArgCb = typeof args[argsNum - 1] === "function"; if (!isLastArgCb && !canPromise()) { throw new Error("Callback required as last argument"); } if (isLastArgCb) { if (argsNum < 2) { throw new Error("Too few arguments provided"); } if (argsNum === 2) { cb = text; text = canvas2; canvas2 = opts = void 0; } else if (argsNum === 3) { if (canvas2.getContext && typeof cb === "undefined") { cb = opts; opts = void 0; } else { cb = opts; opts = text; text = canvas2; canvas2 = void 0; } } } else { if (argsNum < 1) { throw new Error("Too few arguments provided"); } if (argsNum === 1) { text = canvas2; canvas2 = opts = void 0; } else if (argsNum === 2 && !canvas2.getContext) { opts = text; text = canvas2; canvas2 = void 0; } return new Promise(function(resolve, reject) { try { const data2 = QRCode.create(text, opts); resolve(renderFunc(data2, canvas2, opts)); } catch (e2) { reject(e2); } }); } try { const data2 = QRCode.create(text, opts); cb(null, renderFunc(data2, canvas2, opts)); } catch (e2) { cb(e2); } } browser.create = QRCode.create; browser.toCanvas = renderCanvas.bind(null, CanvasRenderer.render); browser.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL); browser.toString = renderCanvas.bind(null, function(data2, _2, opts) { return SvgRenderer.render(data2, opts); }); var It = Object.defineProperty, st = Object.getOwnPropertySymbols, Et = Object.prototype.hasOwnProperty, Mt = Object.prototype.propertyIsEnumerable, ct = (e2, t2, a2) => t2 in e2 ? It(e2, t2, { enumerable: true, configurable: true, writable: true, value: a2 }) : e2[t2] = a2, dt = (e2, t2) => { for (var a2 in t2 || (t2 = {})) Et.call(t2, a2) && ct(e2, a2, t2[a2]); if (st) for (var a2 of st(t2)) Mt.call(t2, a2) && ct(e2, a2, t2[a2]); return e2; }; function ht() { return { default: { light: { inverse: "rgb(255,255,255)", foreground: "rgb(51,150,255)", background: "rgb(232,242,252)" }, dark: { inverse: "rgb(255,255,255)", foreground: "rgb(71,161,255)", background: "rgb(21,38,55)" } }, magenta: { light: { inverse: "rgb(255,255,255)", foreground: "rgb(198,83,128)", background: "rgb(244,221,230)" }, dark: { inverse: "rgb(255,255,255)", foreground: "rgb(203,77,140)", background: "rgb(57,35,43)" } }, blue: { light: { inverse: "rgb(255,255,255)", foreground: "rgb(61,92,245)", background: "rgb(232,235,252)" }, dark: { inverse: "rgb(255,255,255)", foreground: "rgb(81,109,251)", background: "rgb(28,33,59)" } }, orange: { light: { inverse: "rgb(255,255,255)", foreground: "rgb(234,140,46)", background: "rgb(244,236,221)" }, dark: { inverse: "rgb(0,0,0)", foreground: "rgb(255,166,76)", background: "rgb(57,50,34)" } }, green: { light: { inverse: "rgb(255,255,255)", foreground: "rgb(38,181,98)", background: "rgb(218,246,218)" }, dark: { inverse: "rgb(0,0,0)", foreground: "rgb(38,217,98)", background: "rgb(35,52,40)" } }, purple: { light: { inverse: "rgb(255,255,255)", foreground: "rgb(121,76,255)", background: "rgb(225,218,246)" }, dark: { inverse: "rgb(255,255,255)", foreground: "rgb(144,110,247)", background: "rgb(36,31,51)" } }, teal: { light: { inverse: "rgb(255,255,255)", foreground: "rgb(43,182,182)", background: "rgb(217,242,238)" }, dark: { inverse: "rgb(0,0,0)", foreground: "rgb(54,226,226)", background: "rgb(29,48,52)" } }, blackWhite: { light: { inverse: "rgb(255,255,255)", foreground: "rgb(20,20,20)", background: "rgb(255,255,255)" }, dark: { inverse: "rgb(0,0,0)", foreground: "rgb(255,255,255)", background: "rgb(20,20,20)" } } }; } function Wt() { return { light: { foreground: { 1: "rgb(20,20,20)", 2: "rgb(121,134,134)", 3: "rgb(158,169,169)" }, background: { 1: "rgb(255,255,255)", 2: "rgb(241,243,243)", 3: "rgb(228,231,231)" }, overlay: "rgba(0,0,0,0.1)" }, dark: { foreground: { 1: "rgb(228,231,231)", 2: "rgb(148,158,158)", 3: "rgb(110,119,119)" }, background: { 1: "rgb(20,20,20)", 2: "rgb(39,42,42)", 3: "rgb(59,64,64)" }, overlay: "rgba(255,255,255,0.1" } }; } function At() { return { default: { 1: "#B6B9C9", 2: "#C653C6", 3: "#794DFF", 4: "#2EB8B8" }, blue: { 1: "#E8EBFD", 2: "#C653C6", 3: "#2DD2C5", 4: "#3D5CF5" }, magenta: { 1: "#F4DDE6", 2: "#E0D452", 3: "#F09475", 4: "#D1618D" }, orange: { 1: "#F4ECDD", 2: "#B4EB47", 3: "#3075E8", 4: "#EB9947" }, green: { 1: "#DAF6DA", 2: "#E06B92", 3: "#99E54D", 4: "#26B562" }, purple: { 1: "#E1DAF6", 2: "#EB9947", 3: "#E06B92", 4: "#794DFF" }, teal: { 1: "#D9F2EE", 2: "#F09475", 3: "#794DFF", 4: "#2EB8B8" }, blackWhite: { 1: "#E3E8E8", 2: "#98AEAE", 3: "#516767", 4: "#242E2E" } }; } const u = { color() { var e2, t2; const a2 = (e2 = W.state.themeColor) != null ? e2 : "default", n2 = (t2 = W.state.themeMode) != null ? t2 : "dark", o3 = ht()[a2][n2], r2 = Wt()[n2], i2 = At()[a2]; return { foreground: dt({ accent: o3.foreground, inverse: o3.inverse }, r2.foreground), background: dt({ accent: o3.background }, r2.background), gradient: i2, overlay: r2.overlay, error: "rgb(242, 90, 103)" }; }, setTheme() { const e2 = document.querySelector(":root"), { themeZIndex: t2 } = W.state; if (e2) { const a2 = { "--w3m-color-fg-accent": u.color().foreground.accent, "--w3m-color-fg-inverse": u.color().foreground.inverse, "--w3m-color-fg-1": u.color().foreground[1], "--w3m-color-fg-2": u.color().foreground[2], "--w3m-color-fg-3": u.color().foreground[3], "--w3m-color-bg-1": u.color().background[1], "--w3m-color-bg-2": u.color().background[2], "--w3m-color-bg-3": u.color().background[3], "--w3m-color-overlay": u.color().overlay, "--w3m-color-err": u.color().error, "--w3m-color-success": ht().green.light.foreground, "--w3m-gradient-1": u.color().gradient[1], "--w3m-gradient-2": u.color().gradient[2], "--w3m-gradient-3": u.color().gradient[3], "--w3m-gradient-4": u.color().gradient[4], "--w3m-modal-z-index": `${t2}` }; Object.entries(a2).forEach(([n2, o3]) => e2.style.setProperty(n2, o3)); } }, globalCss: i$3`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent}button::after{content:'';position:absolute;inset:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-color-fg-inverse);background:var(--w3m-color-fg-accent)}` }, Lt = i$3`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--w3m-color-overlay)}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-fg-accent);border-radius:50%;margin-bottom:4px}button path{fill:var(--w3m-color-fg-inverse)}`; var jt = Object.defineProperty, St = Object.getOwnPropertyDescriptor, ke = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? St(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && jt(t2, a2, o3), o3; }; let te = class extends s { constructor() { super(...arguments), this.icon = void 0, this.label = "", this.onClick = () => null; } render() { return y``; } }; te.styles = [u.globalCss, Lt], ke([e$1()], te.prototype, "icon", 2), ke([e$1()], te.prototype, "label", 2), ke([e$1()], te.prototype, "onClick", 2), te = ke([e$2("w3m-box-button")], te); const Pt = i$3`button{border-radius:28px;height:28px;padding:0 10px;background-color:var(--w3m-color-fg-accent)}button path{fill:var(--w3m-color-fg-inverse)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{background-color:var(--w3m-color-bg-3)}`; var _t = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, le = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Dt(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && _t(t2, a2, o3), o3; }; let G = class extends s { constructor() { super(...arguments), this.disabled = false, this.iconLeft = void 0, this.iconRight = void 0, this.onClick = () => null; } render() { const e2 = { "w3m-icon-left": this.iconLeft !== void 0, "w3m-icon-right": this.iconRight !== void 0 }; return y``; } }; G.styles = [u.globalCss, Pt], le([e$1()], G.prototype, "disabled", 2), le([e$1()], G.prototype, "iconLeft", 2), le([e$1()], G.prototype, "iconRight", 2), le([e$1()], G.prototype, "onClick", 2), G = le([e$2("w3m-button")], G); const Tt = i$3`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:10px;color:var(--w3m-color-fg-inverse);background-color:var(--w3m-color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-color-fg-accent);background-color:transparent}.w3m-secondary::after{display:none}`; var Nt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, Te = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Rt(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Nt(t2, a2, o3), o3; }; let se = class extends s { constructor() { super(...arguments), this.disabled = false, this.variant = "primary"; } render() { const e2 = { "w3m-secondary": this.variant === "secondary" }; return y``; } }; se.styles = [u.globalCss, Tt], Te([e$1()], se.prototype, "disabled", 2), Te([e$1()], se.prototype, "variant", 2), se = Te([e$2("w3m-button-big")], se); let Bt = class { constructor(...t2) { this.angle = 0, this.t = 1253106, this.last = 0, this.height = 500, this.amp = 300, this.seed = 15, this.freqX = 14e-5, this.freqY = 29e-5, this.freqDelta = 1e-5, this.activeColors = [1, 1, 1, 1], this.isMetaKey = false, this.playing = false, mt(this, "resize", () => { this.width = window.innerWidth, this.minigl.setSize(this.width, this.height), this.minigl.setOrthographicCamera(), this.xSegCount = Math.ceil(this.width * this.conf.density[0]), this.ySegCount = Math.ceil(this.height * this.conf.density[1]), this.mesh.geometry.setTopology(this.xSegCount, this.ySegCount), this.mesh.geometry.setSize(this.width, this.height), this.mesh.material.uniforms.u_shadow_power.value = this.width < 550 ? 5 : 6; }), mt(this, "animate", (a2) => { if (this.playing) { if (this.shouldSkipFrame(a2) || (this.t += Math.min(a2 - this.last, 1e3 / 15), this.last = a2, this.mesh.material.uniforms.u_time.value = this.t, this.minigl.render()), this.last !== 0 && this.isStatic) return this.minigl.render(); requestAnimationFrame(this.animate); } }); } play(t2) { this.el = t2, this.connect(); } stop() { this.playing = false; } async connect() { this.shaderFiles = { vertex: "varying vec3 v_color;void main(){float time=u_time*u_global.noiseSpeed;vec2 noiseCoord=resolution*uvNorm*u_global.noiseFreq;vec2 st=1.-uvNorm.xy;float tilt=resolution.y/2.0*uvNorm.y;float incline=resolution.x*uvNorm.x/2.0*u_vertDeform.incline;float offset=resolution.x/2.0*u_vertDeform.incline*mix(u_vertDeform.offsetBottom,u_vertDeform.offsetTop,uv.y);float noise=snoise(vec3(noiseCoord.x*u_vertDeform.noiseFreq.x+time*u_vertDeform.noiseFlow,noiseCoord.y*u_vertDeform.noiseFreq.y,time*u_vertDeform.noiseSpeed+u_vertDeform.noiseSeed))*u_vertDeform.noiseAmp;noise*=1.0-pow(abs(uvNorm.y),2.0);noise=max(0.0,noise);vec3 pos=vec3(position.x,position.y+tilt+incline+noise-offset,position.z);if(u_active_colors[0]==1.){v_color=u_baseColor;}for(int i=0;i { this.el && (this.computedCanvasStyle = getComputedStyle(this.el), this.waitForCssVars()); }); } initMaterial() { this.uniforms = { u_time: new this.minigl.Uniform({ value: 0 }), u_shadow_power: new this.minigl.Uniform({ value: 5 }), u_darken_top: new this.minigl.Uniform({ value: this.el.dataset.jsDarkenTop === "" ? 1 : 0 }), u_active_colors: new this.minigl.Uniform({ value: this.activeColors, type: "vec4" }), u_global: new this.minigl.Uniform({ value: { noiseFreq: new this.minigl.Uniform({ value: [this.freqX, this.freqY], type: "vec2" }), noiseSpeed: new this.minigl.Uniform({ value: 5e-6 }) }, type: "struct" }), u_vertDeform: new this.minigl.Uniform({ value: { incline: new this.minigl.Uniform({ value: Math.sin(this.angle) / Math.cos(this.angle) }), offsetTop: new this.minigl.Uniform({ value: -0.5 }), offsetBottom: new this.minigl.Uniform({ value: -0.5 }), noiseFreq: new this.minigl.Uniform({ value: [3, 4], type: "vec2" }), noiseAmp: new this.minigl.Uniform({ value: this.amp }), noiseSpeed: new this.minigl.Uniform({ value: 10 }), noiseFlow: new this.minigl.Uniform({ value: 3 }), noiseSeed: new this.minigl.Uniform({ value: this.seed }) }, type: "struct", excludeFrom: "fragment" }), u_baseColor: new this.minigl.Uniform({ value: this.sectionColors[0], type: "vec3", excludeFrom: "fragment" }), u_waveLayers: new this.minigl.Uniform({ value: [], excludeFrom: "fragment", type: "array" }) }; for (let t2 = 1; t2 < this.sectionColors.length; t2 += 1) this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({ value: { color: new this.minigl.Uniform({ value: this.sectionColors[t2], type: "vec3" }), noiseFreq: new this.minigl.Uniform({ value: [2 + t2 / this.sectionColors.length, 3 + t2 / this.sectionColors.length], type: "vec2" }), noiseSpeed: new this.minigl.Uniform({ value: 11 + 0.3 * t2 }), noiseFlow: new this.minigl.Uniform({ value: 6.5 + 0.3 * t2 }), noiseSeed: new this.minigl.Uniform({ value: this.seed + 10 * t2 }), noiseFloor: new this.minigl.Uniform({ value: 0.1 }), noiseCeil: new this.minigl.Uniform({ value: 0.63 + 0.07 * t2 }) }, type: "struct" })); return this.vertexShader = [this.shaderFiles.noise, this.shaderFiles.blend, this.shaderFiles.vertex].join(""), new this.minigl.Material(this.vertexShader, this.shaderFiles.fragment, this.uniforms); } initMesh() { this.material = this.initMaterial(), this.geometry = new this.minigl.PlaneGeometry(), this.mesh = new this.minigl.Mesh(this.geometry, this.material); } shouldSkipFrame(t2) { return !!window.document.hidden || parseInt(t2, 10) % 2 == 0 || void 0; } updateFrequency(t2) { this.freqX += t2, this.freqY += t2; } toggleColor(t2) { this.activeColors[t2] = this.activeColors[t2] === 0 ? 1 : 0; } init() { this.playing = true, this.initGradientColors(), this.initMesh(), this.resize(), requestAnimationFrame(this.animate); } waitForCssVars() { this.computedCanvasStyle && this.computedCanvasStyle.getPropertyValue("--w3m-gradient-1").indexOf("#") !== -1 ? this.init() : this.init(); } initGradientColors() { this.sectionColors = ["--w3m-gradient-1", "--w3m-gradient-2", "--w3m-gradient-3", "--w3m-gradient-4"].map((t2) => { let a2 = this.computedCanvasStyle.getPropertyValue(t2).trim(); return a2.length === 4 && (a2 = `#${a2.substr(1).split("").map((n2) => n2 + n2).join("")}`), a2 && `0x${a2.substr(1)}`; }).filter(Boolean).map(Ut); } }; function Ut(e2) { return [(e2 >> 16 & 255) / 255, (e2 >> 8 & 255) / 255, (255 & e2) / 255]; } function mt(e2, t2, a2) { return t2 in e2 ? Object.defineProperty(e2, t2, { value: a2, enumerable: true, configurable: true, writable: true }) : e2[t2] = a2, e2; } let Ht = class { constructor(t2, a2, n2) { const o3 = this; o3.canvas = t2, o3.gl = o3.canvas.getContext("webgl", { antialias: true }), o3.meshes = []; const r2 = o3.gl; a2 && n2 && this.setSize(a2, n2), Object.defineProperties(o3, { Material: { enumerable: false, value: class { constructor(c2, m2, s2 = {}) { const d3 = this; function v2(N2, E2) { const x2 = r2.createShader(N2); return r2.shaderSource(x2, E2), r2.compileShader(x2), r2.getShaderParameter(x2, r2.COMPILE_STATUS) || console.error(r2.getShaderInfoLog(x2)), x2; } function O(N2, E2) { return Object.entries(N2).map(([x2, A2]) => A2.getDeclaration(x2, E2)).join(""); } d3.uniforms = s2, d3.uniformInstances = []; const C2 = "precision highp float;"; d3.vertexSource = `${C2} attribute vec4 position;attribute vec2 uv;attribute vec2 uvNorm;${O(o3.commonUniforms, "vertex")} ${O(s2, "vertex")} ${c2}`, d3.Source = `${C2} ${O(o3.commonUniforms, "fragment")} ${O(s2, "fragment")} ${m2} `, d3.vertexShader = v2(r2.VERTEX_SHADER, d3.vertexSource), d3.fragmentShader = v2(r2.FRAGMENT_SHADER, d3.Source), d3.program = r2.createProgram(), r2.attachShader(d3.program, d3.vertexShader), r2.attachShader(d3.program, d3.fragmentShader), r2.linkProgram(d3.program), r2.getProgramParameter(d3.program, r2.LINK_STATUS) || console.error(r2.getProgramInfoLog(d3.program)), r2.useProgram(d3.program), d3.attachUniforms(void 0, o3.commonUniforms), d3.attachUniforms(void 0, d3.uniforms); } attachUniforms(c2, m2) { const s2 = this; c2 === void 0 ? Object.entries(m2).forEach(([d3, v2]) => { s2.attachUniforms(d3, v2); }) : m2.type == "array" ? m2.value.forEach((d3, v2) => s2.attachUniforms(`${c2}[${v2}]`, d3)) : m2.type == "struct" ? Object.entries(m2.value).forEach(([d3, v2]) => s2.attachUniforms(`${c2}.${d3}`, v2)) : s2.uniformInstances.push({ uniform: m2, location: r2.getUniformLocation(s2.program, c2) }); } } }, Uniform: { enumerable: false, value: class { constructor(c2) { this.type = "float", Object.assign(this, c2), this.typeFn = { float: "1f", int: "1i", vec2: "2fv", vec3: "3fv", vec4: "4fv", mat4: "Matrix4fv" }[this.type] || "1f", this.update(); } update(c2) { this.value !== void 0 && r2[`uniform${this.typeFn}`](c2, this.typeFn.indexOf("Matrix") === 0 ? this.transpose : this.value, this.typeFn.indexOf("Matrix") === 0 ? this.value : null); } getDeclaration(c2, m2, s2) { const d3 = this; if (d3.excludeFrom !== m2) { if (d3.type === "array") return d3.value[0].getDeclaration(c2, m2, d3.value.length) + `const int ${c2}_length=${d3.value.length};`; if (d3.type === "struct") { let v2 = c2.replace("u_", ""); return v2 = v2.charAt(0).toUpperCase() + v2.slice(1), `uniform struct ${v2} {` + Object.entries(d3.value).map(([O, C2]) => C2.getDeclaration(O, m2).replace(/^uniform/, "")).join("") + `} ${c2}${s2 > 0 ? `[${s2}]` : ""};`; } return `uniform ${d3.type} ${c2}${s2 > 0 ? `[${s2}]` : ""};`; } } } }, PlaneGeometry: { enumerable: false, value: class { constructor(c2, m2, s2, d3, v2) { r2.createBuffer(), this.attributes = { position: new o3.Attribute({ target: r2.ARRAY_BUFFER, size: 3 }), uv: new o3.Attribute({ target: r2.ARRAY_BUFFER, size: 2 }), uvNorm: new o3.Attribute({ target: r2.ARRAY_BUFFER, size: 2 }), index: new o3.Attribute({ target: r2.ELEMENT_ARRAY_BUFFER, size: 3, type: r2.UNSIGNED_SHORT }) }, this.setTopology(s2, d3), this.setSize(c2, m2, v2); } setTopology(c2 = 1, m2 = 1) { const s2 = this; s2.xSegCount = c2, s2.ySegCount = m2, s2.vertexCount = (s2.xSegCount + 1) * (s2.ySegCount + 1), s2.quadCount = s2.xSegCount * s2.ySegCount * 2, s2.attributes.uv.values = new Float32Array(2 * s2.vertexCount), s2.attributes.uvNorm.values = new Float32Array(2 * s2.vertexCount), s2.attributes.index.values = new Uint16Array(3 * s2.quadCount); for (let d3 = 0; d3 <= s2.ySegCount; d3++) for (let v2 = 0; v2 <= s2.xSegCount; v2++) { const O = d3 * (s2.xSegCount + 1) + v2; if (s2.attributes.uv.values[2 * O] = v2 / s2.xSegCount, s2.attributes.uv.values[2 * O + 1] = 1 - d3 / s2.ySegCount, s2.attributes.uvNorm.values[2 * O] = v2 / s2.xSegCount * 2 - 1, s2.attributes.uvNorm.values[2 * O + 1] = 1 - d3 / s2.ySegCount * 2, v2 < s2.xSegCount && d3 < s2.ySegCount) { const C2 = d3 * s2.xSegCount + v2; s2.attributes.index.values[6 * C2] = O, s2.attributes.index.values[6 * C2 + 1] = O + 1 + s2.xSegCount, s2.attributes.index.values[6 * C2 + 2] = O + 1, s2.attributes.index.values[6 * C2 + 3] = O + 1, s2.attributes.index.values[6 * C2 + 4] = O + 1 + s2.xSegCount, s2.attributes.index.values[6 * C2 + 5] = O + 2 + s2.xSegCount; } } s2.attributes.uv.update(), s2.attributes.uvNorm.update(), s2.attributes.index.update(); } setSize(c2 = 1, m2 = 1, s2 = "xz") { const d3 = this; d3.width = c2, d3.height = m2, d3.orientation = s2, d3.attributes.position.values && d3.attributes.position.values.length === 3 * d3.vertexCount || (d3.attributes.position.values = new Float32Array(3 * d3.vertexCount)); const v2 = c2 / -2, O = m2 / -2, C2 = c2 / d3.xSegCount, N2 = m2 / d3.ySegCount; for (let E2 = 0; E2 <= d3.ySegCount; E2++) { const x2 = O + E2 * N2; for (let A2 = 0; A2 <= d3.xSegCount; A2++) { const M2 = v2 + A2 * C2, P2 = E2 * (d3.xSegCount + 1) + A2; d3.attributes.position.values[3 * P2 + "xyz".indexOf(s2[0])] = M2, d3.attributes.position.values[3 * P2 + "xyz".indexOf(s2[1])] = -x2; } } d3.attributes.position.update(); } } }, Mesh: { enumerable: false, value: class { constructor(c2, m2) { const s2 = this; s2.geometry = c2, s2.material = m2, s2.attributeInstances = [], Object.entries(s2.geometry.attributes).forEach(([d3, v2]) => { s2.attributeInstances.push({ attribute: v2, location: v2.attach(d3, s2.material.program) }); }), o3.meshes.push(s2); } draw() { r2.useProgram(this.material.program), this.material.uniformInstances.forEach(({ uniform: c2, location: m2 }) => c2.update(m2)), this.attributeInstances.forEach(({ attribute: c2, location: m2 }) => c2.use(m2)), r2.drawElements(r2.TRIANGLES, this.geometry.attributes.index.values.length, r2.UNSIGNED_SHORT, 0); } remove() { o3.meshes = o3.meshes.filter((c2) => c2 != this); } } }, Attribute: { enumerable: false, value: class { constructor(c2) { this.type = r2.FLOAT, this.normalized = false, this.buffer = r2.createBuffer(), Object.assign(this, c2), this.update(); } update() { this.values !== void 0 && (r2.bindBuffer(this.target, this.buffer), r2.bufferData(this.target, this.values, r2.STATIC_DRAW)); } attach(c2, m2) { const s2 = r2.getAttribLocation(m2, c2); return this.target === r2.ARRAY_BUFFER && (r2.enableVertexAttribArray(s2), r2.vertexAttribPointer(s2, this.size, this.type, this.normalized, 0, 0)), s2; } use(c2) { r2.bindBuffer(this.target, this.buffer), this.target === r2.ARRAY_BUFFER && (r2.enableVertexAttribArray(c2), r2.vertexAttribPointer(c2, this.size, this.type, this.normalized, 0, 0)); } } } }); const i2 = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; o3.commonUniforms = { projectionMatrix: new o3.Uniform({ type: "mat4", value: i2 }), modelViewMatrix: new o3.Uniform({ type: "mat4", value: i2 }), resolution: new o3.Uniform({ type: "vec2", value: [1, 1] }), aspectRatio: new o3.Uniform({ type: "float", value: 1 }) }; } setSize(t2 = 640, a2 = 480) { this.width = t2, this.height = a2, this.canvas.width = t2, this.canvas.height = a2, this.gl.viewport(0, 0, t2, a2), this.commonUniforms.resolution.value = [t2, a2], this.commonUniforms.aspectRatio.value = t2 / a2; } setOrthographicCamera(t2 = 0, a2 = 0, n2 = 0, o3 = -2e3, r2 = 2e3) { this.commonUniforms.projectionMatrix.value = [2 / this.width, 0, 0, 0, 0, 2 / this.height, 0, 0, 0, 0, 2 / (o3 - r2), 0, t2, a2, n2, 1]; } render() { this.gl.clearColor(0, 0, 0, 0), this.gl.clearDepth(1), this.meshes.forEach((t2) => t2.draw()); } }; const g = { CROSS_ICON: w``, NOISE_TEXTURE: w``, WALLET_CONNECT_LOGO: w``, WALLET_CONNECT_ICON: w``, WALLET_CONNECT_ICON_COLORED: w``, BACK_ICON: w``, COPY_ICON: w``, RETRY_ICON: w``, DESKTOP_ICON: w``, MOBILE_ICON: w``, ARROW_DOWN_ICON: w``, ARROW_UP_RIGHT_ICON: w``, ARROW_RIGHT_ICON: w``, QRCODE_ICON: w``, SCAN_ICON: w``, CHECKMARK_ICON: w``, HELP_ETH_IMG: w``, HELP_PAINTING_IMG: w``, HELP_CHART_IMG: w``, HELP_KEY_IMG: w``, HELP_USER_IMG: w``, HELP_LOCK_IMG: w``, HELP_COMPAS_IMG: w``, HELP_NOUN_IMG: w``, HELP_DAO_IMG: w``, SEARCH_ICON: w``, HELP_ICON: w``, WALLET_ICON: w``, NETWORK_PLACEHOLDER: w``, WALLET_PLACEHOLDER: w``, TOKEN_PLACEHOLDER: w``, ACCOUNT_COPY: w``, ACCOUNT_DISCONNECT: w`` }, Zt = { 1: "692ed6ba-e569-459a-556a-776476829e00", 42161: "600a9a04-c1b9-42ca-6785-9b4b6ff85200", 43114: "30c46e53-e989-45fb-4549-be3bd4eb3b00", 56: "93564157-2e8e-4ce7-81df-b264dbee9b00", 250: "06b26297-fe0c-4733-5d6b-ffa5498aac00", 10: "ab9c186a-c52f-464b-2906-ca59d760a400", 137: "41d04d42-da3b-4453-8506-668cc0727900", 100: "02b53f6a-e3d4-479e-1cb4-21178987d100", 9001: "f926ff41-260d-4028-635e-91913fc28e00", 324: "b310f07f-4ef7-49f3-7073-2a0a39685800", 314: "5a73b3dd-af74-424e-cae0-0de859ee9400", 4689: "34e68754-e536-40da-c153-6ef2e7188a00", 1088: "3897a66d-40b9-4833-162f-a2c90531c900", 1284: "161038da-44ae-4ec7-1208-0ea569454b00", 1285: "f1d73bb6-5450-4e18-38f7-fb6484264a00" }; var Z = ((e2) => (e2.metaMask = "metaMask", e2.trust = "trust", e2.phantom = "phantom", e2.brave = "brave", e2.spotEthWallet = "spotEthWallet", e2.exodus = "exodus", e2.tokenPocket = "tokenPocket", e2.frame = "frame", e2.tally = "tally", e2.coinbaseWallet = "coinbaseWallet", e2.core = "core", e2.bitkeep = "bitkeep", e2.mathWallet = "mathWallet", e2.opera = "opera", e2.tokenary = "tokenary", e2["1inch"] = "1inch", e2.kuCoinWallet = "kuCoinWallet", e2.ledger = "ledger", e2))(Z || {}); const J = { injectedPreset: { metaMask: { name: "MetaMask", icon: "619537c0-2ff3-4c78-9ed8-a05e7567f300", url: "https://metamask.io", isMobile: true, isInjected: true }, trust: { name: "Trust", icon: "0528ee7e-16d1-4089-21e3-bbfb41933100", url: "https://trustwallet.com", isMobile: true, isInjected: true }, spotEthWallet: { name: "Spot", icon: "1bf33a89-b049-4a1c-d1f6-4dd7419ee400", url: "https://www.spot-wallet.com", isMobile: true, isInjected: true }, phantom: { name: "Phantom", icon: "62471a22-33cb-4e65-5b54-c3d9ea24b900", url: "https://phantom.app", isInjected: true }, core: { name: "Core", icon: "35f9c46e-cc57-4aa7-315d-e6ccb2a1d600", url: "https://core.app", isMobile: true, isInjected: true }, bitkeep: { name: "BitKeep", icon: "3f7075d0-4ab7-4db5-404d-3e4c05e6fe00", url: "https://bitkeep.com", isMobile: true, isInjected: true }, tokenPocket: { name: "TokenPocket", icon: "f3119826-4ef5-4d31-4789-d4ae5c18e400", url: "https://www.tokenpocket.pro", isMobile: true, isInjected: true }, mathWallet: { name: "MathWallet", icon: "26a8f588-3231-4411-60ce-5bb6b805a700", url: "https://mathwallet.org", isMobile: true, isInjected: true }, exodus: { name: "Exodus", icon: "4c16cad4-cac9-4643-6726-c696efaf5200", url: "https://www.exodus.com", isMobile: true, isDesktop: true, isInjected: true }, kuCoinWallet: { name: "KuCoin Wallet", icon: "1e47340b-8fd7-4ad6-17e7-b2bd651fae00", url: "https://kuwallet.com", isMobile: true, isInjected: true }, ledger: { name: "Ledger", icon: "a7f416de-aa03-4c5e-3280-ab49269aef00", url: "https://www.ledger.com", isDesktop: true }, brave: { name: "Brave", icon: "125e828e-9936-4451-a8f2-949c119b7400", url: "https://brave.com/wallet", isInjected: true }, frame: { name: "Frame", icon: "cd492418-ea85-4ef1-aeed-1c9e20b58900", url: "https://frame.sh", isInjected: true }, tally: { name: "Tally", icon: "98d2620c-9fc8-4a1c-31bc-78d59d00a300", url: "https://tallyho.org", isInjected: true }, coinbaseWallet: { name: "Coinbase", icon: "f8068a7f-83d7-4190-1f94-78154a12c600", url: "https://www.coinbase.com/wallet", isInjected: true }, opera: { name: "Opera", icon: "877fa1a4-304d-4d45-ca8e-f76d1a556f00", url: "https://www.opera.com/crypto", isInjected: true }, tokenary: { name: "Tokenary", icon: "5e481041-dc3c-4a81-373a-76bbde91b800", url: "https://tokenary.io", isDesktop: true, isInjected: true }, ["1inch"]: { name: "1inch Wallet", icon: "dce1ee99-403f-44a9-9f94-20de30616500", url: "https://1inch.io/wallet", isMobile: true } }, getInjectedId(e2) { if (e2.toUpperCase() !== "INJECTED" && e2.length) return e2; const { ethereum: t2, spotEthWallet: a2, coinbaseWalletExtension: n2 } = window; return t2 ? t2.isTrust || t2.isTrustWallet ? "trust" : t2.isPhantom ? "phantom" : t2.isBraveWallet ? "brave" : a2 ? "spotEthWallet" : t2.isExodus ? "exodus" : t2.isTokenPocket ? "tokenPocket" : t2.isFrame ? "frame" : t2.isTally ? "tally" : n2 ? "coinbaseWallet" : t2.isAvalanche ? "core" : t2.isBitKeep ? "bitkeep" : t2.isMathWallet ? "mathWallet" : t2.isOpera ? "opera" : t2.isTokenary ? "tokenary" : t2.isOneInchIOSWallet || t2.isOneInchAndroidWallet ? "1inch" : t2.isKuCoinWallet ? "kuCoinWallet" : t2.isMetaMask ? "metaMask" : "injected" : "metaMask"; }, getInjectedName(e2) { var t2, a2; if (e2.length && e2.toUpperCase() !== "INJECTED") return e2; const n2 = J.getInjectedId(""); return (a2 = (t2 = J.injectedPreset[n2]) == null ? void 0 : t2.name) != null ? a2 : "Injected"; } }, Ft = { ETH: { icon: "692ed6ba-e569-459a-556a-776476829e00" }, WETH: { icon: "692ed6ba-e569-459a-556a-776476829e00" }, AVAX: { icon: "30c46e53-e989-45fb-4549-be3bd4eb3b00" }, FTM: { icon: "06b26297-fe0c-4733-5d6b-ffa5498aac00" }, BNB: { icon: "93564157-2e8e-4ce7-81df-b264dbee9b00" }, MATIC: { icon: "41d04d42-da3b-4453-8506-668cc0727900" }, OP: { icon: "ab9c186a-c52f-464b-2906-ca59d760a400" }, xDAI: { icon: "02b53f6a-e3d4-479e-1cb4-21178987d100" }, EVMOS: { icon: "f926ff41-260d-4028-635e-91913fc28e00" }, METIS: { icon: "3897a66d-40b9-4833-162f-a2c90531c900" }, IOTX: { icon: "34e68754-e536-40da-c153-6ef2e7188a00" } }; var zt = Object.defineProperty, pt = Object.getOwnPropertySymbols, Vt = Object.prototype.hasOwnProperty, Gt = Object.prototype.propertyIsEnumerable, ut = (e2, t2, a2) => t2 in e2 ? zt(e2, t2, { enumerable: true, configurable: true, writable: true, value: a2 }) : e2[t2] = a2, qt = (e2, t2) => { for (var a2 in t2 || (t2 = {})) Vt.call(t2, a2) && ut(e2, a2, t2[a2]); if (pt) for (var a2 of pt(t2)) Gt.call(t2, a2) && ut(e2, a2, t2[a2]); return e2; }; const h = { MOBILE_BREAKPOINT: 600, W3M_RECENT_WALLET: "W3M_RECENT_WALLET", rejectStandaloneButtonComponent() { const { isStandalone: e2 } = a$2.state; if (e2) throw new Error("Web3Modal button components are not available in standalone mode."); }, getShadowRootElement(e2, t2) { const a2 = e2.renderRoot.querySelector(t2); if (!a2) throw new Error(`${t2} not found`); return a2; }, getWalletId(e2) { return J.getInjectedId(e2); }, getWalletIcon(e2) { var t2, a2; const n2 = (t2 = J.injectedPreset[e2]) == null ? void 0 : t2.icon, { projectId: o3, walletImages: r2 } = W.state; return (a2 = r2 == null ? void 0 : r2[e2]) != null ? a2 : o3 && n2 ? A$1.getImageUrl(n2) : ""; }, getWalletName(e2, t2 = false) { const a2 = J.getInjectedName(e2); return t2 ? a2.split(" ")[0] : a2; }, getChainIcon(e2) { var t2; const a2 = Zt[e2], { projectId: n2, chainImages: o3 } = W.state; return (t2 = o3 == null ? void 0 : o3[e2]) != null ? t2 : n2 && a2 ? A$1.getImageUrl(a2) : ""; }, getTokenIcon(e2) { var t2, a2; const n2 = (t2 = Ft[e2]) == null ? void 0 : t2.icon, { projectId: o3, tokenImages: r2 } = W.state; return (a2 = r2 == null ? void 0 : r2[e2]) != null ? a2 : o3 && n2 ? A$1.getImageUrl(n2) : ""; }, isMobileAnimation() { return window.innerWidth <= h.MOBILE_BREAKPOINT; }, async preloadImage(e2) { return new Promise((t2, a2) => { const n2 = new Image(); n2.onload = t2, n2.onerror = a2, n2.src = e2; }); }, getErrorMessage(e2) { return e2 instanceof Error ? e2.message : "Unknown Error"; }, debounce(e2, t2 = 500) { let a2; return (...n2) => { function o3() { e2(...n2); } a2 && clearTimeout(a2), a2 = setTimeout(o3, t2); }; }, async handleMobileLinking(e2) { const { standaloneUri: t2, selectedChain: a2 } = a$2.state, { links: n2, name: o3 } = e2; function r2(i2) { let c2 = ""; n2 != null && n2.universal ? c2 = d$2.formatUniversalUrl(n2.universal, i2, o3) : n2 != null && n2.native && (c2 = d$2.formatNativeUrl(n2.native, i2, o3)), d$2.openHref(c2); } t2 ? (h.setRecentWallet(e2), r2(t2)) : (await L.client().connectWalletConnect((i2) => { r2(i2); }, a2 == null ? void 0 : a2.id), h.setRecentWallet(e2), k$1.close()); }, async handleAndroidLinking() { const { standaloneUri: e2, selectedChain: t2 } = a$2.state; e2 ? d$2.openHref(e2) : (await L.client().connectWalletConnect((a2) => { d$2.setWalletConnectAndroidDeepLink(a2), d$2.openHref(a2); }, t2 == null ? void 0 : t2.id), k$1.close()); }, async handleUriCopy() { const { standaloneUri: e2 } = a$2.state; if (e2) await navigator.clipboard.writeText(e2); else { const t2 = L.client().walletConnectUri; await navigator.clipboard.writeText(t2); } P$1.openToast("Link copied", "success"); }, async handleConnectorConnection(e2, t2) { try { const { selectedChain: a2 } = a$2.state; await L.client().connectConnector(e2, a2 == null ? void 0 : a2.id), k$1.close(); } catch (a2) { console.error(a2), t2 ? t2() : P$1.openToast(h.getErrorMessage(a2), "error"); } }, getCustomWallets() { var e2; const { desktopWallets: t2, mobileWallets: a2 } = W.state; return (e2 = d$2.isMobile() ? a2 : t2) != null ? e2 : []; }, getCustomImageUrls() { const { chainImages: e2, walletImages: t2 } = W.state, a2 = Object.values(e2 ?? {}), n2 = Object.values(t2 ?? {}); return Object.values([...a2, ...n2]); }, getConnectorImageUrls() { return L.client().getConnectors().map(({ id: e2 }) => J.getInjectedId(e2)).map((e2) => h.getWalletIcon(e2)); }, truncate(e2, t2 = 8) { return e2.length <= t2 ? e2 : `${e2.substring(0, 4)}...${e2.substring(e2.length - 4)}`; }, generateAvatarColors(e2) { var t2; const a2 = (t2 = e2.match(/.{1,7}/g)) == null ? void 0 : t2.splice(0, 5), n2 = []; a2 == null ? void 0 : a2.forEach((r2) => { let i2 = 0; for (let m2 = 0; m2 < r2.length; m2 += 1) i2 = r2.charCodeAt(m2) + ((i2 << 5) - i2), i2 = i2 & i2; const c2 = [0, 0, 0]; for (let m2 = 0; m2 < 3; m2 += 1) { const s2 = i2 >> m2 * 8 & 255; c2[m2] = s2; } n2.push(`rgb(${c2[0]}, ${c2[1]}, ${c2[2]})`); }); const o3 = document.querySelector(":root"); if (o3) { const r2 = { "--w3m-color-av-1": n2[0], "--w3m-color-av-2": n2[1], "--w3m-color-av-3": n2[2], "--w3m-color-av-4": n2[3], "--w3m-color-av-5": n2[4] }; Object.entries(r2).forEach(([i2, c2]) => o3.style.setProperty(i2, c2)); } }, setRecentWallet(e2) { const { walletConnectVersion: t2 } = a$2.state; localStorage.setItem(h.W3M_RECENT_WALLET, JSON.stringify({ [t2]: e2 })); }, getRecentWallet() { const e2 = localStorage.getItem(h.W3M_RECENT_WALLET); if (e2) { const { walletConnectVersion: t2 } = a$2.state, a2 = JSON.parse(e2); if (a2[t2]) return a2[t2]; } }, getExtensionWallets() { const e2 = []; for (const [t2, a2] of Object.entries(J.injectedPreset)) t2 !== Z.coinbaseWallet && a2 && a2.isInjected && !a2.isDesktop && e2.push(qt({ id: t2 }, a2)); return e2; }, caseSafeIncludes(e2, t2) { return e2.toUpperCase().includes(t2.toUpperCase()); } }, Kt = i$3`#w3m-transparent-noise,.w3m-canvas,.w3m-color-placeholder,.w3m-gradient-placeholder,.w3m-highlight{inset:0;position:absolute;display:block;pointer-events:none;width:100%;height:100px;border-radius:8px 8px 0 0;transform:translateY(-5px)}.w3m-gradient-placeholder{background:linear-gradient(var(--w3m-gradient-1),var(--w3m-gradient-2),var(--w3m-gradient-3),var(--w3m-gradient-4))}.w3m-color-placeholder{background-color:var(--w3m-color-fg-accent)}.w3m-highlight{border:1px solid var(--w3m-color-overlay)}.w3m-canvas{opacity:0;transition:opacity 2s ease;box-shadow:0 8px 28px -6px rgba(10,16,31,.12),0 18px 88px -4px rgba(10,16,31,.14)}.w3m-canvas-visible{opacity:1}#w3m-transparent-noise{mix-blend-mode:multiply;opacity:.35}.w3m-toolbar{height:28px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-color-fg-inverse)}.w3m-action-btn{width:28px;height:28px;border-radius:50%;border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:background-color,.2s ease;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay),0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08)}.w3m-action-btn:hover{background-color:var(--w3m-color-bg-2)}.w3m-action-btn svg{display:block;object-position:center}.w3m-action-btn path{fill:var(--w3m-color-fg-1)}.w3m-actions{display:flex}.w3m-actions button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}`; var Yt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, Ne = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Xt(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Yt(t2, a2, o3), o3; }; const vt = new Bt(); let ce = class extends s { constructor() { super(), this.open = false, this.isHelp = false, this.unsubscribeRouter = void 0, this.playTimeout = void 0, this.unsubscribeRouter = g$2.subscribe((e2) => { this.isHelp = e2.view === "Help"; }); } firstUpdated() { const { themeBackground: e2 } = W.state; e2 === "gradient" && (this.playTimeout = setTimeout(() => { vt.play(this.canvasEl), this.open = true; }, 800)); } disconnectedCallback() { var e2; (e2 = this.unsubscribeRouter) == null || e2.call(this), clearTimeout(this.playTimeout), vt.stop(); } get canvasEl() { return h.getShadowRootElement(this, ".w3m-canvas"); } onHelp() { g$2.push("Help"); } render() { const { themeBackground: e2 } = W.state, t2 = { "w3m-canvas": true, "w3m-canvas-visible": this.open }, a2 = { "w3m-actions": true, "w3m-help-active": this.isHelp }; return y`${e2 === "themeColor" ? y`
` : null} ${e2 === "gradient" ? y`
${g.NOISE_TEXTURE}` : null}
${g.WALLET_CONNECT_LOGO}
`; } }; ce.styles = [u.globalCss, Kt], Ne([t$1()], ce.prototype, "open", 2), Ne([t$1()], ce.prototype, "isHelp", 2), ce = Ne([e$2("w3m-modal-backcard")], ce); const Qt = i$3`main{padding:20px;padding-top:0;width:100%}`; var Jt = Object.defineProperty, eo = Object.getOwnPropertyDescriptor, to = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? eo(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Jt(t2, a2, o3), o3; }; let Re = class extends s { render() { return y`
`; } }; Re.styles = [u.globalCss, Qt], Re = to([e$2("w3m-modal-content")], Re); const oo = i$3`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`; var ao = Object.defineProperty, no = Object.getOwnPropertyDescriptor, ro = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? no(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && ao(t2, a2, o3), o3; }; let Be = class extends s { render() { return y`
`; } }; Be.styles = [u.globalCss, oo], Be = ro([e$2("w3m-modal-footer")], Be); const io = i$3`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px;transition:opacity .2s ease}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-color-fg-accent)}`; var lo = Object.defineProperty, so = Object.getOwnPropertyDescriptor, de = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? so(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && lo(t2, a2, o3), o3; }; let q = class extends s { constructor() { super(...arguments), this.title = "", this.onAction = void 0, this.actionIcon = void 0, this.border = false; } backBtnTemplate() { return y``; } actionBtnTemplate() { return y``; } render() { const e2 = { "w3m-border": this.border }, t2 = g$2.state.history.length > 1, a2 = this.title ? y`${this.title}` : y``; return y`
${t2 ? this.backBtnTemplate() : null} ${a2} ${this.onAction ? this.actionBtnTemplate() : null}
`; } }; q.styles = [u.globalCss, io], de([e$1()], q.prototype, "title", 2), de([e$1()], q.prototype, "onAction", 2), de([e$1()], q.prototype, "actionIcon", 2), de([e$1()], q.prototype, "border", 2), q = de([e$2("w3m-modal-header")], q); const co = i$3`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`; var ho = Object.defineProperty, mo = Object.getOwnPropertyDescriptor, Ue = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? mo(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && ho(t2, a2, o3), o3; }; let he = class extends s { constructor() { super(), this.view = g$2.state.view, this.prevView = g$2.state.view, this.unsubscribe = void 0, this.oldHeight = "0px", this.resizeObserver = void 0, this.unsubscribe = g$2.subscribe((e2) => { this.view !== e2.view && this.onChangeRoute(); }); } firstUpdated() { this.resizeObserver = new ResizeObserver(([e2]) => { const t2 = `${e2.contentRect.height}px`; this.oldHeight !== "0px" && (animate(this.routerEl, { height: [this.oldHeight, t2] }, { duration: 0.2 }), animate(this.routerEl, { opacity: [0, 1], scale: [0.99, 1] }, { duration: 0.37, delay: 0.03 })), this.oldHeight = t2; }), this.resizeObserver.observe(this.contentEl); } disconnectedCallback() { var e2, t2; (e2 = this.unsubscribe) == null || e2.call(this), (t2 = this.resizeObserver) == null || t2.disconnect(); } get routerEl() { return h.getShadowRootElement(this, ".w3m-router"); } get contentEl() { return h.getShadowRootElement(this, ".w3m-content"); } viewTemplate() { switch (this.view) { case "ConnectWallet": return y``; case "SelectNetwork": return y``; case "InjectedConnector": return y``; case "InstallConnector": return y``; case "GetWallet": return y``; case "DesktopConnector": return y``; case "WalletExplorer": return y``; case "Qrcode": return y``; case "Help": return y``; case "Account": return y``; case "SwitchNetwork": return y``; default: return y`
Not Found
`; } } async onChangeRoute() { await animate(this.routerEl, { opacity: [1, 0], scale: [1, 1.02] }, { duration: 0.15 }).finished, this.view = g$2.state.view; } render() { return y`
${this.viewTemplate()}
`; } }; he.styles = [u.globalCss, co], Ue([t$1()], he.prototype, "view", 2), Ue([t$1()], he.prototype, "prevView", 2), he = Ue([e$2("w3m-modal-router")], he); const po = i$3`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:10px 15px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:36px;border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-color-fg-accent)}.w3m-error path{fill:var(--w3m-color-err)}`; var uo = Object.defineProperty, vo = Object.getOwnPropertyDescriptor, gt = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? vo(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && uo(t2, a2, o3), o3; }; let $e = class extends s { constructor() { super(), this.open = false, this.unsubscribe = void 0, this.timeout = void 0, this.unsubscribe = P$1.subscribe((e2) => { e2.open ? (this.open = true, this.timeout = setTimeout(() => P$1.closeToast(), 2200)) : (this.open = false, clearTimeout(this.timeout)); }); } disconnectedCallback() { var e2; (e2 = this.unsubscribe) == null || e2.call(this), clearTimeout(this.timeout), P$1.closeToast(); } render() { const { message: e2, variant: t2 } = P$1.state, a2 = { "w3m-success": t2 === "success", "w3m-error": t2 === "error" }; return this.open ? y`
${t2 === "success" ? g.CHECKMARK_ICON : null} ${t2 === "error" ? g.CROSS_ICON : null}${e2}
` : null; } }; $e.styles = [u.globalCss, po], gt([t$1()], $e.prototype, "open", 2), $e = gt([e$2("w3m-modal-toast")], $e); const go = i$3`button{padding:5px;border-radius:10px;transition:all .2s ease;display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:hover{background-color:var(--w3m-color-overlay)}`; var wo = Object.defineProperty, bo = Object.getOwnPropertyDescriptor, Oe = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? bo(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && wo(t2, a2, o3), o3; }; let oe = class extends s { constructor() { super(...arguments), this.onClick = () => null, this.name = "", this.chainId = ""; } render() { return y``; } }; oe.styles = [u.globalCss, go], Oe([e$1()], oe.prototype, "onClick", 2), Oe([e$1()], oe.prototype, "name", 2), Oe([e$1()], oe.prototype, "chainId", 2), oe = Oe([e$2("w3m-network-button")], oe); const fo = i$3`div{width:inherit;height:inherit}.polygon-stroke{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}`; var yo = Object.defineProperty, xo = Object.getOwnPropertyDescriptor, wt = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? xo(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && yo(t2, a2, o3), o3; }; let Ie = class extends s { constructor() { super(...arguments), this.chainId = ""; } render() { const e2 = h.getChainIcon(this.chainId); return e2 ? y`
` : y`${g.NETWORK_PLACEHOLDER}`; } }; Ie.styles = [u.globalCss, fo], wt([e$1()], Ie.prototype, "chainId", 2), Ie = wt([e$2("w3m-network-image")], Ie); const Co = 0.1, bt = 2.5, F = 7; function He(e2, t2, a2) { return e2 === t2 ? false : (e2 - t2 < 0 ? t2 - e2 : e2 - t2) <= a2 + Co; } function ko(e2, t2) { const a2 = Array.prototype.slice.call(browser.create(e2, { errorCorrectionLevel: t2 }).modules.data, 0), n2 = Math.sqrt(a2.length); return a2.reduce((o3, r2, i2) => (i2 % n2 === 0 ? o3.push([r2]) : o3[o3.length - 1].push(r2)) && o3, []); } const $o = { generate(e2, t2, a2, n2) { const o3 = n2 === "light" ? "#141414" : "#fff", r2 = n2 === "light" ? "#fff" : "#141414", i2 = [], c2 = ko(e2, "Q"), m2 = t2 / c2.length, s2 = [{ x: 0, y: 0 }, { x: 1, y: 0 }, { x: 0, y: 1 }]; s2.forEach(({ x: E2, y: x2 }) => { const A2 = (c2.length - F) * m2 * E2, M2 = (c2.length - F) * m2 * x2, P2 = 0.32; for (let U = 0; U < s2.length; U += 1) { const ee = m2 * (F - U * 2); i2.push(w``); } }); const d3 = Math.floor((a2 + 25) / m2), v2 = c2.length / 2 - d3 / 2, O = c2.length / 2 + d3 / 2 - 1, C2 = []; c2.forEach((E2, x2) => { E2.forEach((A2, M2) => { if (c2[x2][M2] && !(x2 < F && M2 < F || x2 > c2.length - (F + 1) && M2 < F || x2 < F && M2 > c2.length - (F + 1)) && !(x2 > v2 && x2 < O && M2 > v2 && M2 < O)) { const P2 = x2 * m2 + m2 / 2, U = M2 * m2 + m2 / 2; C2.push([P2, U]); } }); }); const N2 = {}; return C2.forEach(([E2, x2]) => { N2[E2] ? N2[E2].push(x2) : N2[E2] = [x2]; }), Object.entries(N2).map(([E2, x2]) => { const A2 = x2.filter((M2) => x2.every((P2) => !He(M2, P2, m2))); return [Number(E2), A2]; }).forEach(([E2, x2]) => { x2.forEach((A2) => { i2.push(w``); }); }), Object.entries(N2).filter(([E2, x2]) => x2.length > 1).map(([E2, x2]) => { const A2 = x2.filter((M2) => x2.some((P2) => He(M2, P2, m2))); return [Number(E2), A2]; }).map(([E2, x2]) => { x2.sort((M2, P2) => M2 < P2 ? -1 : 1); const A2 = []; for (const M2 of x2) { const P2 = A2.find((U) => U.some((ee) => He(M2, ee, m2))); P2 ? P2.push(M2) : A2.push([M2]); } return [E2, A2.map((M2) => [M2[0], M2[M2.length - 1]])]; }).forEach(([E2, x2]) => { x2.forEach(([A2, M2]) => { i2.push(w``); }); }), i2; } }, Oo = i$3`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:15px}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-color-fg-accent)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`; var Io = Object.defineProperty, Eo = Object.getOwnPropertyDescriptor, me = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Eo(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Io(t2, a2, o3), o3; }; let K = class extends s { constructor() { super(...arguments), this.uri = "", this.size = 0, this.logoSrc = "", this.walletId = ""; } svgTemplate() { var e2; const t2 = (e2 = W.state.themeMode) != null ? e2 : "light"; return w`${$o.generate(this.uri, this.size, this.size / 4, t2)}`; } render() { return y`
${this.walletId || this.logoSrc ? y`` : g.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`; } }; K.styles = [u.globalCss, Oo], me([e$1()], K.prototype, "uri", 2), me([e$1({ type: Number })], K.prototype, "size", 2), me([e$1()], K.prototype, "logoSrc", 2), me([e$1()], K.prototype, "walletId", 2), K = me([e$2("w3m-qrcode")], K); const Mo = i$3`:host{position:relative;height:28px;width:75%}input{width:100%;height:100%;line-height:28px!important;border-radius:28px;font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:transparent;position:absolute;background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}input::placeholder{color:transparent}svg{margin-right:4px}.w3m-placeholder{top:0;left:50%;transform:translateX(-50%);transition:.2s all ease;pointer-events:none;display:flex;align-items:center;justify-content:center;height:100%;width:fit-content;position:relative}input:focus-within+.w3m-placeholder,input:not(:placeholder-shown)+.w3m-placeholder{transform:translateX(10px);left:0}w3m-text{opacity:1;transition:.2s opacity ease}input:focus-within+.w3m-placeholder w3m-text,input:not(:placeholder-shown)+.w3m-placeholder w3m-text{opacity:0}input:focus-within,input:not(:placeholder-shown){color:var(--w3m-color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-color-fg-accent)}path{fill:var(--w3m-color-fg-2)}`; var Wo = Object.defineProperty, Ao = Object.getOwnPropertyDescriptor, ft = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Ao(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Wo(t2, a2, o3), o3; }; let Ee = class extends s { constructor() { super(...arguments), this.onChange = () => null; } render() { const e2 = d$2.isMobile() ? "Search mobile wallets" : "Search desktop wallets"; return y`
${g.SEARCH_ICON}${e2}
`; } }; Ee.styles = [u.globalCss, Mo], ft([e$1()], Ee.prototype, "onChange", 2), Ee = ft([e$2("w3m-search-input")], Ee); const Lo = i$3`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-color-fg-accent)}`; var jo = Object.defineProperty, So = Object.getOwnPropertyDescriptor, Po = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? So(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && jo(t2, a2, o3), o3; }; let Ze = class extends s { render() { return y``; } }; Ze.styles = [u.globalCss, Lo], Ze = Po([e$2("w3m-spinner")], Ze); const _o = i$3`span{font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xxsmall-bold{font-weight:700;font-size:10px;line-height:12px;letter-spacing:.02em;text-transform:uppercase}.w3m-xsmall-normal{font-weight:600;font-size:12px;line-height:14px;letter-spacing:-.03em}.w3m-small-thin{font-weight:500;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-small-normal{font-weight:600;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-medium-thin{font-weight:500;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-normal{font-weight:600;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-bold{font-weight:700;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-large-bold{font-weight:600;font-size:20px;line-height:24px;letter-spacing:-.03em}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-color-fg-inverse)}.w3m-color-accnt{color:var(--w3m-color-fg-accent)}.w3m-color-error{color:var(--w3m-color-err)}`; var Do = Object.defineProperty, To = Object.getOwnPropertyDescriptor, Fe = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? To(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Do(t2, a2, o3), o3; }; let pe = class extends s { constructor() { super(...arguments), this.variant = "medium-normal", this.color = "primary"; } render() { const e2 = { "w3m-large-bold": this.variant === "large-bold", "w3m-medium-bold": this.variant === "medium-bold", "w3m-medium-normal": this.variant === "medium-normal", "w3m-medium-thin": this.variant === "medium-thin", "w3m-small-normal": this.variant === "small-normal", "w3m-small-thin": this.variant === "small-thin", "w3m-xsmall-normal": this.variant === "xsmall-normal", "w3m-xxsmall-bold": this.variant === "xxsmall-bold", "w3m-color-primary": this.color === "primary", "w3m-color-secondary": this.color === "secondary", "w3m-color-tertiary": this.color === "tertiary", "w3m-color-inverse": this.color === "inverse", "w3m-color-accnt": this.color === "accent", "w3m-color-error": this.color === "error" }; return y``; } }; pe.styles = [u.globalCss, _o], Fe([e$1()], pe.prototype, "variant", 2), Fe([e$1()], pe.prototype, "color", 2), pe = Fe([e$2("w3m-text")], pe); const No = i$3`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;inset:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`; var Ro = Object.defineProperty, Bo = Object.getOwnPropertyDescriptor, yt = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Bo(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Ro(t2, a2, o3), o3; }; let Me = class extends s { constructor() { super(...arguments), this.symbol = void 0; } render() { var e2; const t2 = h.getTokenIcon((e2 = this.symbol) != null ? e2 : ""); return t2 ? y`
${this.id}
` : g.TOKEN_PLACEHOLDER; } }; Me.styles = [u.globalCss, No], yt([e$1()], Me.prototype, "symbol", 2), Me = yt([e$2("w3m-token-image")], Me); const Uo = i$3`button{transition:all .2s ease;width:100%;height:100%;border-radius:10px;display:flex;align-items:flex-start}button:hover{background-color:var(--w3m-color-overlay)}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:15px;margin-bottom:5px}.w3m-sublabel{margin-top:2px}`; var Ho = Object.defineProperty, Zo = Object.getOwnPropertyDescriptor, z = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Zo(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Ho(t2, a2, o3), o3; }; let H2 = class extends s { constructor() { super(...arguments), this.onClick = () => null, this.name = "", this.walletId = "", this.label = void 0, this.src = void 0, this.installed = false, this.recent = false; } sublabelTemplate() { return this.recent ? y`RECENT` : this.installed ? y`INSTALLED` : null; } render() { var e2; return y``; } }; H2.styles = [u.globalCss, Uo], z([e$1()], H2.prototype, "onClick", 2), z([e$1()], H2.prototype, "name", 2), z([e$1()], H2.prototype, "walletId", 2), z([e$1()], H2.prototype, "label", 2), z([e$1()], H2.prototype, "src", 2), z([e$1()], H2.prototype, "installed", 2), z([e$1()], H2.prototype, "recent", 2), H2 = z([e$2("w3m-wallet-button")], H2); const Fo = i$3`div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;inset:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`; var zo = Object.defineProperty, Vo = Object.getOwnPropertyDescriptor, ze = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Vo(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && zo(t2, a2, o3), o3; }; let ue = class extends s { constructor() { super(...arguments), this.walletId = void 0, this.src = void 0; } render() { var e2; const t2 = h.getWalletId((e2 = this.walletId) != null ? e2 : ""), a2 = h.getWalletId(t2), n2 = this.src ? this.src : h.getWalletIcon(a2); return y`${n2.length ? y`
${this.id}
` : g.WALLET_PLACEHOLDER}`; } }; ue.styles = [u.globalCss, Fo], ze([e$1()], ue.prototype, "walletId", 2), ze([e$1()], ue.prototype, "src", 2), ue = ze([e$2("w3m-wallet-image")], ue); const Go = i$3`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:10px;padding:4px 4px 4px 8px}div button{border-radius:16px;padding:4px 8px 4px 4px;height:auto;margin-left:10px;color:var(--w3m-color-fg-inverse);background-color:var(--w3m-color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`; var qo = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, xt = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Ko(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && qo(t2, a2, o3), o3; }; let We = class extends s { constructor() { super(), this.balance = "hide", h.rejectStandaloneButtonComponent(); } onOpen() { const { isStandalone: e2 } = a$2.state; e2 || k$1.open({ route: "Account" }); } accountTemplate() { return y``; } render() { return this.balance === "show" ? y`
` : y`${this.accountTemplate()}`; } }; We.styles = [u.globalCss, Go], xt([e$1()], We.prototype, "balance", 2), We = xt([e$2("w3m-account-button")], We); const Yo = i$3`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--w3m-color-overlay)}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`; var Xo = Object.defineProperty, Qo = Object.getOwnPropertyDescriptor, Ve = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Qo(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Xo(t2, a2, o3), o3; }; let ve = class extends s { constructor() { super(), this.chainId = "", this.label = "", this.unsubscribeNetwork = void 0; const { selectedChain: e2 } = a$2.state; this.chainId = e2 == null ? void 0 : e2.id.toString(), this.label = e2 == null ? void 0 : e2.name, this.unsubscribeNetwork = a$2.subscribe(({ selectedChain: t2 }) => { this.chainId = t2 == null ? void 0 : t2.id.toString(), this.label = t2 == null ? void 0 : t2.name; }); } disconnectedCallback() { var e2; (e2 = this.unsubscribeNetwork) == null || e2.call(this); } onClick() { g$2.push("SelectNetwork"); } render() { const { chains: e2 } = a$2.state, t2 = e2 && e2.length > 1; return y``; } }; ve.styles = [u.globalCss, Yo], Ve([t$1()], ve.prototype, "chainId", 2), Ve([t$1()], ve.prototype, "label", 2), ve = Ve([e$2("w3m-account-network-button")], ve); const Jo = i$3`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`; var ea = Object.defineProperty, ta = Object.getOwnPropertyDescriptor, ge = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? ta(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && ea(t2, a2, o3), o3; }; let Y = class extends s { constructor() { super(), this.address = void 0, this.name = void 0, this.loading = true, this.variant = "button", this.unsubscribeAccount = void 0, this.address = a$2.state.address, this.name = a$2.state.profileName, this.loading = Boolean(a$2.state.profileLoading), this.unsubscribeAccount = a$2.subscribe(({ address: e2, profileName: t2, profileLoading: a2 }) => { this.address = e2, this.name = t2, this.loading = Boolean(a2); }); } disconnectedCallback() { var e2; (e2 = this.unsubscribeAccount) == null || e2.call(this); } render() { var e2; const t2 = this.variant === "button", a2 = { "w3m-loading": this.loading }; return y`${this.name ? this.name : h.truncate((e2 = this.address) != null ? e2 : "")}`; } }; Y.styles = [u.globalCss, Jo], ge([t$1()], Y.prototype, "address", 2), ge([t$1()], Y.prototype, "name", 2), ge([t$1()], Y.prototype, "loading", 2), ge([e$1()], Y.prototype, "variant", 2), Y = ge([e$2("w3m-address-text")], Y); const oa = i$3`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 10),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px}.w3m-slider::after,.w3m-slider::before{content:'';height:100%;width:50px;z-index:2;position:absolute;background:linear-gradient(to right,var(--w3m-color-bg-1) 0,transparent 100%);top:0}.w3m-slider::before{left:0}.w3m-slider::after{right:0;transform:rotateZ(180deg)}.w3m-track{display:flex;width:calc(70px * 20);animation:scroll 20s linear infinite}.w3m-action{padding:30px 0 10px 0;display:flex;justify-content:center;align-items:center;flex-direction:column}.w3m-action w3m-button-big:last-child{margin-top:10px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;box-shadow:0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08);border-radius:15px}`; var aa = Object.defineProperty, na = Object.getOwnPropertyDescriptor, ra = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? na(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && aa(t2, a2, o3), o3; }; let Ge = class extends s { onGoToQrcode() { g$2.push("Qrcode"); } onGoToGetWallet() { g$2.push("GetWallet"); } render() { const { previewWallets: e2 } = A$1.state, t2 = e2.length, a2 = [...e2, ...e2]; return y`${t2 ? y`
${a2.map(({ image_url: n2 }) => y``)}
` : null}
Select WalletI don’t have a wallet
`; } }; Ge.styles = [u.globalCss, oa], Ge = ra([e$2("w3m-android-wallet-selection")], Ge); const ia = i$3`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`; var la = Object.defineProperty, sa = Object.getOwnPropertyDescriptor, we = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? sa(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && la(t2, a2, o3), o3; }; let X = class extends s { constructor() { super(), this.address = void 0, this.avatar = void 0, this.loading = true, this.size = "small", this.unsubscribeAccount = void 0, this.address = a$2.state.address, this.avatar = a$2.state.profileAvatar, this.loading = Boolean(a$2.state.profileLoading), this.unsubscribeAccount = a$2.subscribe(({ address: e2, profileAvatar: t2, profileLoading: a2 }) => { this.address = e2, this.avatar = t2, this.loading = Boolean(a2); }); } disconnectedCallback() { var e2; (e2 = this.unsubscribeAccount) == null || e2.call(this); } render() { const e2 = { "w3m-placeholder": true, "w3m-small": this.size === "small", "w3m-medium": this.size === "medium" }; return this.avatar ? y`` : this.address ? (h.generateAvatarColors(this.address), y`
${this.loading ? y`
` : null}
`) : null; } }; X.styles = [u.globalCss, ia], we([t$1()], X.prototype, "address", 2), we([t$1()], X.prototype, "avatar", 2), we([t$1()], X.prototype, "loading", 2), we([e$1()], X.prototype, "size", 2), X = we([e$2("w3m-avatar")], X); const ca = i$3`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`; var da = Object.defineProperty, ha = Object.getOwnPropertyDescriptor, qe = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? ha(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && da(t2, a2, o3), o3; }; let be = class extends s { constructor() { var e2, t2; super(), this.symbol = void 0, this.amount = void 0, this.unsubscribeAccount = void 0, this.symbol = (e2 = a$2.state.balance) == null ? void 0 : e2.symbol, this.amount = (t2 = a$2.state.balance) == null ? void 0 : t2.amount, this.unsubscribeAccount = a$2.subscribe(({ balance: a2 }) => { this.symbol = a2 == null ? void 0 : a2.symbol, this.amount = a2 == null ? void 0 : a2.amount; }); } disconnectedCallback() { var e2; (e2 = this.unsubscribeAccount) == null || e2.call(this); } render() { let e2 = "_._"; return this.amount === "0.0" && (e2 = 0), this.amount && this.amount.length > 6 && (e2 = parseFloat(this.amount).toFixed(3)), y`
${e2} ${this.symbol}
`; } }; be.styles = [u.globalCss, ca], qe([t$1()], be.prototype, "symbol", 2), qe([t$1()], be.prototype, "amount", 2), be = qe([e$2("w3m-balance")], be); const ma = i$3`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-color-fg-inverse)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`; var pa = Object.defineProperty, ua = Object.getOwnPropertyDescriptor, Ae = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? ua(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && pa(t2, a2, o3), o3; }; let ae = class extends s { constructor() { super(), this.loading = false, this.label = "Connect Wallet", this.icon = "show", this.modalUnsub = void 0, h.rejectStandaloneButtonComponent(), this.modalUnsub = k$1.subscribe((e2) => { e2.open && (this.loading = true), e2.open || (this.loading = false); }); } disconnectedCallback() { var e2; (e2 = this.modalUnsub) == null || e2.call(this); } iconTemplate() { return this.icon === "show" ? g.WALLET_CONNECT_ICON : null; } onClick() { a$2.state.isConnected ? this.onDisconnect() : this.onConnect(); } onConnect() { this.loading = true; const { enableNetworkView: e2 } = W.state, { chains: t2, selectedChain: a2 } = a$2.state, n2 = (t2 == null ? void 0 : t2.length) && t2.length > 1; e2 || n2 && !a2 ? k$1.open({ route: "SelectNetwork" }) : k$1.open({ route: "ConnectWallet" }); } onDisconnect() { L.client().disconnect(), a$2.resetAccount(); } render() { return y`${this.loading ? y`Connecting...` : y`${this.iconTemplate()}${this.label}`}`; } }; ae.styles = [u.globalCss, ma], Ae([t$1()], ae.prototype, "loading", 2), Ae([e$1()], ae.prototype, "label", 2), Ae([e$1()], ae.prototype, "icon", 2), ae = Ae([e$2("w3m-connect-button")], ae); var va = Object.defineProperty, ga = Object.getOwnPropertyDescriptor, fe = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? ga(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && va(t2, a2, o3), o3; }; let ne = class extends s { constructor() { super(), this.isConnected = false, this.label = "Connect Wallet", this.icon = "show", this.balance = "hide", this.unsubscribeAccount = void 0, h.rejectStandaloneButtonComponent(), this.isConnected = a$2.state.isConnected, this.unsubscribeAccount = a$2.subscribe(({ isConnected: e2 }) => { this.isConnected = e2; }); } disconnectedCallback() { var e2; (e2 = this.unsubscribeAccount) == null || e2.call(this); } render() { const { enableAccountView: e2 } = W.state; return this.isConnected && e2 ? y`` : y``; } }; fe([t$1()], ne.prototype, "isConnected", 2), fe([e$1()], ne.prototype, "label", 2), fe([e$1()], ne.prototype, "icon", 2), fe([e$1()], ne.prototype, "balance", 2), ne = fe([e$2("w3m-core-button")], ne); const R = { allowedExplorerListings(e2) { const { explorerAllowList: t2, explorerDenyList: a2 } = W.state; let n2 = [...e2]; return t2 && (n2 = n2.filter((o3) => t2.includes(o3.id))), a2 && (n2 = n2.filter((o3) => !a2.includes(o3.id))), n2; }, walletsWithInjected(e2) { let t2 = [...e2 ?? []]; if (window.ethereum) { const a2 = h.getWalletName(""); t2 = t2.filter(({ name: n2 }) => !h.caseSafeIncludes(n2, a2)); } return t2; }, connectorWallets() { const { isStandalone: e2 } = a$2.state; if (e2) return []; let t2 = L.client().getConnectors(); return !window.ethereum && d$2.isMobile() && (t2 = t2.filter(({ id: a2 }) => a2 !== "injected" && a2 !== Z.metaMask)), t2; }, walletTemplatesWithRecent(e2, t2) { let a2 = [...e2]; if (t2) { const n2 = h.getRecentWallet(); a2 = a2.filter((o3) => !o3.values.includes(n2 == null ? void 0 : n2.name)), a2.splice(1, 0, t2); } return a2; }, deduplicateExplorerListingsFromConnectors(e2) { const { isStandalone: t2 } = a$2.state; if (t2) return e2; const a2 = L.client().getConnectors().map(({ name: n2 }) => n2.toUpperCase()); return e2.filter(({ name: n2 }) => !a2.includes(n2.toUpperCase())); } }, wa = i$3`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-color-fg-accent)}`; var ba = Object.defineProperty, fa = Object.getOwnPropertyDescriptor, ya = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? fa(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && ba(t2, a2, o3), o3; }; let Ke = class extends s { onDesktopWallet(e2) { g$2.push("DesktopConnector", { DesktopConnector: e2 }); } onInjectedWallet() { g$2.push("InjectedConnector"); } onInstallConnector() { g$2.push("InstallConnector", { InstallConnector: { id: "metaMask", name: "MetaMask", isMobile: true, url: "https://metamask.io" } }); } async onConnectorWallet(e2) { window.ethereum ? e2 === "injected" || e2 === Z.metaMask ? this.onInjectedWallet() : await h.handleConnectorConnection(e2) : this.onInstallConnector(); } desktopWalletsTemplate() { const { desktopWallets: e2 } = W.state; return e2 == null ? void 0 : e2.map(({ id: t2, name: a2, links: { universal: n2, native: o3 } }) => y``); } previewWalletsTemplate() { let e2 = R.allowedExplorerListings(A$1.state.previewWallets); return e2 = R.deduplicateExplorerListingsFromConnectors(e2), e2.map(({ name: t2, desktop: { universal: a2, native: n2 }, homepage: o3, image_url: r2, id: i2 }) => y``); } connectorWalletsTemplate() { return R.connectorWallets().map(({ id: e2, name: t2, ready: a2 }) => y``); } recentWalletTemplate() { const e2 = h.getRecentWallet(); if (!e2) return; const { id: t2, name: a2, links: n2, image: o3 } = e2; return y``; } render() { const { standaloneUri: e2 } = a$2.state, t2 = this.desktopWalletsTemplate(), a2 = this.previewWalletsTemplate(), n2 = this.connectorWalletsTemplate(), o3 = this.recentWalletTemplate(), r2 = [...t2 ?? [], ...a2], i2 = [...n2, ...r2], c2 = R.walletTemplatesWithRecent(i2, o3), m2 = R.walletTemplatesWithRecent(r2, o3), s2 = e2 ? m2 : c2, d3 = s2.length > 4; let v2 = []; d3 ? v2 = s2.filter((C2) => !C2.values.includes(Z.coinbaseWallet)).slice(0, 3) : v2 = s2; const O = Boolean(v2.length); return y`
${g.MOBILE_ICON}Mobile
${g.SCAN_ICON}Scan with your wallet
${O ? y`
${g.DESKTOP_ICON}Desktop
${v2} ${d3 ? y`` : null}
` : null}`; } }; Ke.styles = [u.globalCss, wa], Ke = ya([e$2("w3m-desktop-wallet-selection")], Ke); const xa = i$3`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-color-fg-accent);text-decoration:none;transition:opacity .2s ease-in-out}a:hover{opacity:.8}`; var Ca = Object.defineProperty, ka = Object.getOwnPropertyDescriptor, $a = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? ka(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Ca(t2, a2, o3), o3; }; let Ye = class extends s { render() { const { termsOfServiceUrl: e2, privacyPolicyUrl: t2 } = W.state; return e2 ?? t2 ? y`
By connecting your wallet, you agree to our
${e2 ? y`Terms of Service` : null} ${e2 && t2 ? "and" : null} ${t2 ? y`Privacy Policy` : null}
` : null; } }; Ye.styles = [u.globalCss, xa], Ye = $a([e$2("w3m-legal-notice")], Ye); const Oa = i$3`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`; var Ia = Object.defineProperty, Ea = Object.getOwnPropertyDescriptor, Ma = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Ea(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Ia(t2, a2, o3), o3; }; let Xe = class extends s { onGoToQrcode() { g$2.push("Qrcode"); } async onConnectorWallet(e2) { await h.handleConnectorConnection(e2); } mobileWalletsTemplate() { const { mobileWallets: e2 } = W.state, t2 = R.walletsWithInjected(e2); if (t2.length) return t2.map(({ id: a2, name: n2, links: { universal: o3, native: r2 } }) => y``); } previewWalletsTemplate() { const { previewWallets: e2 } = A$1.state; let t2 = R.walletsWithInjected(e2); return t2 = R.allowedExplorerListings(t2), t2 = R.deduplicateExplorerListingsFromConnectors(t2), t2.map(({ image_url: a2, name: n2, mobile: { native: o3, universal: r2 }, id: i2 }) => y``); } connectorWalletsTemplate() { let e2 = R.connectorWallets(); return window.ethereum || (e2 = e2.filter(({ id: t2 }) => t2 !== "injected" && t2 !== Z.metaMask)), e2.map(({ name: t2, id: a2, ready: n2 }) => y``); } recentWalletTemplate() { const e2 = h.getRecentWallet(); if (!e2) return; const { id: t2, name: a2, links: n2, image: o3 } = e2; return y``; } render() { const { standaloneUri: e2 } = a$2.state, t2 = this.connectorWalletsTemplate(), a2 = this.mobileWalletsTemplate(), n2 = this.previewWalletsTemplate(), o3 = this.recentWalletTemplate(), r2 = a2 ?? n2, i2 = [...t2, ...r2], c2 = R.walletTemplatesWithRecent(i2, o3), m2 = R.walletTemplatesWithRecent(r2, o3), s2 = e2 ? m2 : c2, d3 = s2.length > 8; let v2 = []; d3 ? v2 = s2.filter((E2) => !E2.values.includes(Z.coinbaseWallet)).slice(0, 7) : v2 = s2; const O = v2.slice(0, 4), C2 = v2.slice(4, 8), N2 = Boolean(v2.length); return y`${N2 ? y`
${O} ${C2.length ? y`${C2} ${d3 ? y`` : null}` : null}
` : null}`; } }; Xe.styles = [u.globalCss, Oa], Xe = Ma([e$2("w3m-mobile-wallet-selection")], Xe); const Wa = i$3`:host{all:initial}.w3m-overlay{inset:0;position:fixed;z-index:var(--w3m-modal-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}.w3m-open{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0}.w3m-card{width:100%;position:relative;transform:translateY(5px);border-radius:30px;overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{transform:translateY(5px);border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}`; var Aa = Object.defineProperty, La = Object.getOwnPropertyDescriptor, Le = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? La(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Aa(t2, a2, o3), o3; }; let re = class extends s { constructor() { if (super(), this.open = false, this.preload = true, this.activeChainId = void 0, this.unsubscribeModal = void 0, this.unsubscribeConfig = void 0, this.unwatchAccount = void 0, this.unwatchNetwork = void 0, this.abortController = void 0, u.setTheme(), this.unsubscribeConfig = W.subscribe(u.setTheme), this.unsubscribeModal = k$1.subscribe((e2) => { e2.open ? this.onOpenModalEvent() : this.onCloseModalEvent(); }), !a$2.state.isStandalone) { a$2.getAccount(); const e2 = a$2.getSelectedChain(); this.activeChainId = e2 == null ? void 0 : e2.id, this.fetchEnsProfile(), this.fetchBalance(), this.unwatchNetwork = L.client().watchNetwork((t2) => { const a2 = t2.chain; a2 && this.activeChainId !== a2.id && (a$2.setSelectedChain(a2), this.activeChainId = a2.id, a$2.resetBalance(), this.fetchBalance()); }), this.unwatchAccount = L.client().watchAccount((t2) => { const { address: a2 } = a$2.state; t2.address !== a2 && (this.fetchEnsProfile(t2.address), this.fetchBalance(t2.address)), a$2.setAddress(t2.address), a$2.setIsConnected(t2.isConnected); }); } this.preloadModalData(); } disconnectedCallback() { var e2, t2, a2, n2; (e2 = this.unsubscribeModal) == null || e2.call(this), (t2 = this.unsubscribeConfig) == null || t2.call(this), (a2 = this.unwatchAccount) == null || a2.call(this), (n2 = this.unwatchNetwork) == null || n2.call(this); } get overlayEl() { return h.getShadowRootElement(this, ".w3m-overlay"); } get containerEl() { return h.getShadowRootElement(this, ".w3m-container"); } async fetchEnsProfile(e2) { try { if (W.state.enableAccountView) { a$2.setProfileLoading(true); const t2 = e2 ?? a$2.state.address, { id: a2 } = L.client().getDefaultChain(); if (t2 && a2 === 1) { const [n2, o3] = await Promise.all([L.client().fetchEnsName({ address: t2, chainId: 1 }), L.client().fetchEnsAvatar({ address: t2, chainId: 1 })]); o3 && await h.preloadImage(o3), a$2.setProfileName(n2), a$2.setProfileAvatar(o3); } } } catch (t2) { console.error(t2), P$1.openToast(h.getErrorMessage(t2), "error"); } finally { a$2.setProfileLoading(false); } } async fetchBalance(e2) { try { if (W.state.enableAccountView) { a$2.setBalanceLoading(true); const t2 = e2 ?? a$2.state.address; if (t2) { const a2 = await L.client().fetchBalance({ address: t2 }); a$2.setBalance({ amount: a2.formatted, symbol: a2.symbol }); } } } catch (t2) { console.error(t2), P$1.openToast(h.getErrorMessage(t2), "error"); } finally { a$2.setBalanceLoading(false); } } toggleBodyScroll(e2) { if (document.querySelector("body")) if (e2) { const t2 = document.getElementById("w3m-styles"); t2 == null ? void 0 : t2.remove(); } else document.head.insertAdjacentHTML("beforeend", ''); } async preloadExplorerData() { var e2; const { standaloneChains: t2, chains: a2, walletConnectVersion: n2 } = a$2.state, o3 = t2 == null ? void 0 : t2.join(","); await Promise.all([A$1.getPreviewWallets({ page: 1, entries: 10, chains: o3, device: d$2.isMobile() ? "mobile" : "desktop", version: n2 }), A$1.getRecomendedWallets()]), a$2.setIsDataLoaded(true); const { previewWallets: r2, recomendedWallets: i2 } = A$1.state, c2 = (e2 = a2 == null ? void 0 : a2.map((s2) => h.getChainIcon(s2.id))) != null ? e2 : [], m2 = [...r2, ...i2].map((s2) => s2.image_url.lg); await this.preloadExplorerImages([...c2, ...m2]); } async preloadExplorerImages(e2) { e2.length && await Promise.all(e2.map(async (t2) => h.preloadImage(t2))); } async preloadCustomImages() { const e2 = h.getCustomImageUrls(); e2.length && await Promise.all(e2.map(async (t2) => h.preloadImage(t2))); } async preloadConnectorImages() { if (!a$2.state.isStandalone) { const e2 = h.getConnectorImageUrls(); e2.length && await Promise.all(e2.map(async (t2) => h.preloadImage(t2))); } } async preloadModalData() { try { this.preload && (this.preload = false, await Promise.all([this.preloadExplorerData(), this.preloadCustomImages(), this.preloadConnectorImages()])); } catch (e2) { console.error(e2), P$1.openToast("Failed preloading", "error"); } } onCloseModal(e2) { e2.target === e2.currentTarget && k$1.close(); } async onOpenModalEvent() { await this.preloadModalData(), this.toggleBodyScroll(false); const e2 = 0.2; await animate(this.containerEl, { y: 0 }, { duration: 0 }).finished, animate(this.overlayEl, { opacity: [0, 1] }, { duration: 0.2, delay: e2 }), animate(this.containerEl, h.isMobileAnimation() ? { y: ["50vh", 0] } : { scale: [0.98, 1] }, { scale: { easing: spring({ velocity: 0.4 }) }, y: { easing: spring({ mass: 0.5 }) }, delay: e2 }), this.addKeyboardEvents(), this.open = true; } async onCloseModalEvent() { this.toggleBodyScroll(true), this.removeKeyboardEvents(), await Promise.all([animate(this.containerEl, h.isMobileAnimation() ? { y: [0, "50vh"] } : { scale: [1, 0.98] }, { scale: { easing: spring({ velocity: 0 }) }, y: { easing: spring({ mass: 0.5 }) } }).finished, animate(this.overlayEl, { opacity: [1, 0] }, { duration: 0.2 }).finished]), this.open = false; } addKeyboardEvents() { this.abortController = new AbortController(), window.addEventListener("keydown", (e2) => { var t2; e2.key === "Escape" ? k$1.close() : e2.key === "Tab" && ((t2 = e2.target) != null && t2.tagName.includes("W3M-") || this.containerEl.focus()); }, this.abortController), this.containerEl.focus(); } removeKeyboardEvents() { var e2; (e2 = this.abortController) == null || e2.abort(), this.abortController = void 0; } render() { const e2 = { "w3m-overlay": true, "w3m-open": this.open }; return y`
${this.open ? y`
` : null}
`; } }; re.styles = [u.globalCss, Wa], Le([t$1()], re.prototype, "open", 2), Le([t$1()], re.prototype, "preload", 2), Le([t$1()], re.prototype, "activeChainId", 2), re = Le([e$2("w3m-modal")], re); const ja = i$3`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`; var Sa = Object.defineProperty, Pa = Object.getOwnPropertyDescriptor, je = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Pa(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Sa(t2, a2, o3), o3; }; let ie = class extends s { constructor() { super(), this.chainId = "", this.label = "", this.wrongNetwork = false, this.unsubscribeNetwork = void 0, h.rejectStandaloneButtonComponent(); const { selectedChain: e2 } = a$2.state; this.onSetChainData(e2), this.unsubscribeNetwork = a$2.subscribe(({ selectedChain: t2 }) => { this.onSetChainData(t2); }); } disconnectedCallback() { var e2; (e2 = this.unsubscribeNetwork) == null || e2.call(this); } onSetChainData(e2) { if (e2) { const { chains: t2 } = a$2.state, a2 = t2 == null ? void 0 : t2.map((n2) => n2.id); this.chainId = e2.id.toString(), this.wrongNetwork = !(a2 != null && a2.includes(e2.id)), this.label = this.wrongNetwork ? "Wrong Network" : e2.name; } } onClick() { k$1.open({ route: "SelectNetwork" }); } render() { var e2; const { chains: t2 } = a$2.state, a2 = t2 && t2.length > 1; return y`${(e2 = this.label) != null && e2.length ? this.label : "Select Network"}`; } }; ie.styles = [u.globalCss, ja], je([t$1()], ie.prototype, "chainId", 2), je([t$1()], ie.prototype, "label", 2), je([t$1()], ie.prototype, "wrongNetwork", 2), ie = je([e$2("w3m-network-switch")], ie); const _a = i$3`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:10px;transition:background-color .2s ease;height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:15px;justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:hover{background-color:var(--w3m-color-overlay)}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:8px;border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`; var Da = Object.defineProperty, Ta = Object.getOwnPropertyDescriptor, Na = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Ta(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Da(t2, a2, o3), o3; }; let Qe = class extends s { onClick() { g$2.push("WalletExplorer"); } render() { const { previewWallets: e2 } = A$1.state, t2 = h.getCustomWallets(), a2 = [...e2, ...t2].reverse().slice(0, 4); return y``; } }; Qe.styles = [u.globalCss, _a], Qe = Na([e$2("w3m-view-all-wallets-button")], Qe); const Ra = i$3`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`; var Ba = Object.defineProperty, Ua = Object.getOwnPropertyDescriptor, Ct = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Ua(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Ba(t2, a2, o3), o3; }; let Se = class extends s { constructor() { super(), this.uri = "", this.createConnectionAndWait(); } get overlayEl() { return h.getShadowRootElement(this, ".w3m-qr-container"); } async createConnectionAndWait(e2 = 0) { var t2; try { const { standaloneUri: a2 } = a$2.state; a2 ? setTimeout(() => this.uri = a2, 0) : (await L.client().connectWalletConnect((n2) => this.uri = n2, (t2 = a$2.state.selectedChain) == null ? void 0 : t2.id), k$1.close()); } catch (a2) { console.error(a2), P$1.openToast("Connection request declined", "error"), e2 < 2 && this.createConnectionAndWait(e2 + 1); } } render() { return y`
${this.uri ? y`` : y``}
`; } }; Se.styles = [u.globalCss, Ra], Ct([t$1()], Se.prototype, "uri", 2), Se = Ct([e$2("w3m-walletconnect-qr")], Se); const Ha = i$3`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-color-success);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-color-success),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`; var Za = Object.defineProperty, Fa = Object.getOwnPropertyDescriptor, za = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Fa(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Za(t2, a2, o3), o3; }; let Je = class extends s { onDisconnect() { k$1.close(), L.client().disconnect(), a$2.resetAccount(); } async onCopyAddress() { var e2; await navigator.clipboard.writeText((e2 = a$2.state.address) != null ? e2 : ""), P$1.openToast("Address copied", "success"); } render() { return y`
Connected
`; } }; Je.styles = [u.globalCss, Ha], Je = za([e$2("w3m-account-view")], Je); var Va = Object.defineProperty, Ga = Object.getOwnPropertyDescriptor, qa = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Ga(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Va(t2, a2, o3), o3; }; let et = class extends s { viewTemplate() { return d$2.isAndroid() ? y`` : d$2.isMobile() ? y`` : y``; } render() { return y`${this.viewTemplate()}`; } }; et.styles = [u.globalCss], et = qa([e$2("w3m-connect-wallet-view")], et); const Ka = i$3`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}.w3m-install-actions{display:flex}.w3m-install-actions w3m-button{margin:0 5px;opacity:1}`; var Ya = Object.defineProperty, Xa = Object.getOwnPropertyDescriptor, kt = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? Xa(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Ya(t2, a2, o3), o3; }; let Pe = class extends s { constructor() { super(), this.uri = "", this.createConnectionAndWait(); } getRouterData() { var e2; const t2 = (e2 = g$2.state.data) == null ? void 0 : e2.DesktopConnector; if (!t2) throw new Error("Missing router data"); return t2; } onFormatAndRedirect(e2) { const { native: t2, universal: a2, name: n2 } = this.getRouterData(); if (t2) { const o3 = d$2.formatNativeUrl(t2, e2, n2); d$2.openHref(o3); } else if (a2) { const o3 = d$2.formatUniversalUrl(a2, e2, n2); d$2.openHref(o3, "_blank"); } } async createConnectionAndWait(e2 = 0) { var t2; const { standaloneUri: a2 } = a$2.state, { name: n2, walletId: o3, native: r2, universal: i2, icon: c2 } = this.getRouterData(), m2 = { name: n2, id: o3, links: { native: r2, universal: i2 }, image: c2 }; if (a2) h.setRecentWallet(m2), this.onFormatAndRedirect(a2); else try { await L.client().connectWalletConnect((s2) => { this.uri = s2, this.onFormatAndRedirect(s2); }, (t2 = a$2.state.selectedChain) == null ? void 0 : t2.id), h.setRecentWallet(m2), k$1.close(); } catch (s2) { console.error(s2), P$1.openToast("Connection request declined", "error"), e2 < 2 && this.createConnectionAndWait(e2 + 1); } } onConnectWithMobile() { g$2.push("Qrcode"); } onGoToWallet() { const { universal: e2, name: t2 } = this.getRouterData(); if (e2) { const a2 = d$2.formatUniversalUrl(e2, this.uri, t2); d$2.openHref(a2, "_blank"); } } render() { const { name: e2, icon: t2, universal: a2, walletId: n2 } = this.getRouterData(), o3 = h.getWalletName(e2); return y`
${t2 ? y`` : y``}
${`Continue in ${o3}...`}
Retry${a2 ? y`Go to Wallet` : y`Connect with Mobile`}
`; } }; Pe.styles = [u.globalCss, Ka], kt([t$1()], Pe.prototype, "uri", 2), Pe = kt([e$2("w3m-desktop-connector-view")], Pe); const Qa = i$3`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`; var Ja = Object.defineProperty, en = Object.getOwnPropertyDescriptor, tn = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? en(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Ja(t2, a2, o3), o3; }; let tt = class extends s { constructor() { super(...arguments), this.explorerUrl = "https://explorer.walletconnect.com/"; } onGet(e2) { d$2.openHref(e2, "_blank"); } onExplore() { d$2.openHref(this.explorerUrl, "_blank"); } render() { const { recomendedWallets: e2 } = A$1.state, t2 = h.getCustomWallets().slice(0, 6), a2 = e2.length, n2 = t2.length; return y`${a2 ? e2.map(({ name: o3, image_url: r2, homepage: i2 }) => y`
${o3}Get
`) : null} ${n2 ? t2.map(({ name: o3, id: r2, links: i2 }) => y`
${o3}Get
`) : null}
`; } }; tt.styles = [u.globalCss, Qa], tt = tn([e$2("w3m-get-wallet-view")], tt); const on = i$3`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`; var an = Object.defineProperty, nn = Object.getOwnPropertyDescriptor, rn = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? nn(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && an(t2, a2, o3), o3; }; let ot = class extends s { constructor() { super(...arguments), this.learnUrl = "https://ethereum.org/en/wallets/"; } onGet() { g$2.push("GetWallet"); } onLearnMore() { d$2.openHref(this.learnUrl, "_blank"); } render() { return y`
${g.HELP_CHART_IMG} ${g.HELP_PAINTING_IMG} ${g.HELP_ETH_IMG}
A home for your digital assetsA wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.
${g.HELP_KEY_IMG} ${g.HELP_USER_IMG} ${g.HELP_LOCK_IMG}
One login for all of web3Log in to any app by connecting your wallet. Say goodbye to countless passwords!
${g.HELP_COMPAS_IMG} ${g.HELP_NOUN_IMG} ${g.HELP_DAO_IMG}
Your gateway to a new webWith your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.
`; } }; ot.styles = [u.globalCss, on], ot = rn([e$2("w3m-help-view")], ot); const ln = i$3`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:20px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-injected-error w3m-button{opacity:1}`; var sn = Object.defineProperty, cn = Object.getOwnPropertyDescriptor, at = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? cn(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && sn(t2, a2, o3), o3; }; let ye = class extends s { constructor() { super(), this.connecting = true, this.error = false, this.connector = L.client().getConnectorById("injected"), this.onConnect(); } async onConnect() { const { ready: e2 } = this.connector; e2 && (this.error = false, this.connecting = true, await h.handleConnectorConnection("injected", () => { this.error = true, this.connecting = false; })); } render() { const e2 = h.getWalletName(this.connector.name), t2 = h.getWalletId(this.connector.id), a2 = { "w3m-injected-wrapper": true, "w3m-injected-error": this.error }; return y`
${this.connecting ? y`` : null}${this.error ? "Connection declined" : `Continue in ${e2}...`}
Try Again
`; } }; ye.styles = [u.globalCss, ln], at([t$1()], ye.prototype, "connecting", 2), at([t$1()], ye.prototype, "error", 2), ye = at([e$2("w3m-injected-connector-view")], ye); const dn = i$3`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}.w3m-install-title{display:flex;align-items:center;justify-content:center;flex-direction:column}.w3m-install-title w3m-text:last-child{margin-top:10px;max-width:240px}.w3m-install-actions{display:flex;margin-top:15px;align-items:center;flex-direction:column}@media(max-width:355px){.w3m-install-actions{flex-direction:column;align-items:center}}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-install-actions w3m-button{margin:5px;opacity:1}.w3m-info-text{text-align:center}`; var hn = Object.defineProperty, mn = Object.getOwnPropertyDescriptor, pn = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? mn(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && hn(t2, a2, o3), o3; }; let nt = class extends s { getRouterData() { var e2; const t2 = (e2 = g$2.state.data) == null ? void 0 : e2.InstallConnector; if (!t2) throw new Error("Missing router data"); return t2; } onInstall() { const { url: e2 } = this.getRouterData(); d$2.openHref(e2, "_blank"); } onMobile() { const { name: e2 } = this.getRouterData(); g$2.push("ConnectWallet"), P$1.openToast(`Scan the code with ${e2}`, "success"); } render() { const { name: e2, id: t2, isMobile: a2 } = this.getRouterData(); return y`
Install ${e2}To connect ${e2}, install the browser extension.
Install Extension${a2 ? y`${e2} Mobile` : null}
`; } }; nt.styles = [u.globalCss, dn], nt = pn([e$2("w3m-install-connector-view")], nt); var un = Object.defineProperty, vn = Object.getOwnPropertyDescriptor, gn = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? vn(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && un(t2, a2, o3), o3; }; let rt = class extends s { render() { return y``; } }; rt.styles = [u.globalCss], rt = gn([e$2("w3m-qrcode-view")], rt); const wn = i$3`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}`; var bn = Object.defineProperty, fn = Object.getOwnPropertyDescriptor, yn = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? fn(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && bn(t2, a2, o3), o3; }; let it = class extends s { async onSelectChain(e2) { const { isConnected: t2, selectedChain: a2, walletConnectVersion: n2 } = a$2.state; t2 ? (a2 == null ? void 0 : a2.id) === e2.id ? g$2.replace("Account") : n2 === 2 ? (await L.client().switchNetwork({ chainId: e2.id }), g$2.replace("Account")) : g$2.push("SwitchNetwork", { SwitchNetwork: e2 }) : (g$2.push("ConnectWallet"), a$2.setSelectedChain(e2)); } render() { const { chains: e2 } = a$2.state; return y`
${e2 == null ? void 0 : e2.map((t2) => y`${t2.name}`)}
`; } }; it.styles = [u.globalCss, wn], it = yn([e$2("w3m-select-network-view")], it); const xn = i$3`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-network-image{width:96px;height:96px;margin-bottom:20px}w3m-button{opacity:0}.w3m-error w3m-button{opacity:1}`; var Cn = Object.defineProperty, kn = Object.getOwnPropertyDescriptor, $t = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? kn(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && Cn(t2, a2, o3), o3; }; let _e = class extends s { constructor() { super(), this.error = false, this.onSwitchNetwork(); } getRouterData() { var e2; const t2 = (e2 = g$2.state.data) == null ? void 0 : e2.SwitchNetwork; if (!t2) throw new Error("Missing router data"); return t2; } async onSwitchNetwork() { try { this.error = false; const e2 = this.getRouterData(); await L.client().switchNetwork({ chainId: e2.id }), a$2.setSelectedChain(e2), g$2.replace("Account"); } catch { this.error = true; } } render() { const { id: e2, name: t2 } = this.getRouterData(), a2 = { "w3m-wrapper": true, "w3m-error": this.error }; return y`
${this.error ? null : y``}${this.error ? "Connection declined" : "Approve in your wallet"}
Try Again
`; } }; _e.styles = [u.globalCss, xn], $t([t$1()], _e.prototype, "error", 2), _e = $t([e$2("w3m-switch-network-view")], _e); const $n = i$3`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`; var On = Object.defineProperty, In = Object.getOwnPropertyDescriptor, xe = (e2, t2, a2, n2) => { for (var o3 = n2 > 1 ? void 0 : n2 ? In(t2, a2) : t2, r2 = e2.length - 1, i2; r2 >= 0; r2--) (i2 = e2[r2]) && (o3 = (n2 ? i2(t2, a2, o3) : i2(o3)) || o3); return n2 && o3 && On(t2, a2, o3), o3; }; const lt = 40; let Q = class extends s { constructor() { super(...arguments), this.loading = !A$1.state.wallets.listings.length, this.firstFetch = !A$1.state.wallets.listings.length, this.search = "", this.endReached = false, this.intersectionObserver = void 0, this.searchDebounce = h.debounce((e2) => { e2.length >= 3 ? (this.firstFetch = true, this.endReached = false, this.search = e2, A$1.resetSearch(), this.fetchWallets()) : this.search && (this.search = "", this.endReached = this.isLastPage(), A$1.resetSearch()); }); } firstUpdated() { this.createPaginationObserver(); } disconnectedCallback() { var e2; (e2 = this.intersectionObserver) == null || e2.disconnect(); } get placeholderEl() { return h.getShadowRootElement(this, ".w3m-placeholder-block"); } createPaginationObserver() { this.intersectionObserver = new IntersectionObserver(([e2]) => { e2.isIntersecting && !(this.search && this.firstFetch) && this.fetchWallets(); }), this.intersectionObserver.observe(this.placeholderEl); } isLastPage() { const { wallets: e2, search: t2 } = A$1.state, { listings: a2, total: n2 } = this.search ? t2 : e2; return n2 <= lt || a2.length >= n2; } async fetchWallets() { var e2; const { wallets: t2, search: a2 } = A$1.state, n2 = h.getExtensionWallets(), { listings: o3, total: r2, page: i2 } = this.search ? a2 : t2; if (!this.endReached && (this.firstFetch || r2 > lt && o3.length < r2)) try { this.loading = true; const c2 = (e2 = a$2.state.standaloneChains) == null ? void 0 : e2.join(","), { listings: m2 } = await A$1.getPaginatedWallets({ page: this.firstFetch ? 1 : i2 + 1, entries: lt, device: d$2.isMobile() ? "mobile" : "desktop", search: this.search, version: a$2.state.walletConnectVersion, chains: c2 }), s2 = m2.map(({ image_url: v2 }) => v2.lg), d3 = n2.map(({ id: v2 }) => h.getWalletIcon(v2)); await Promise.all([...s2.map(async (v2) => h.preloadImage(v2)), ...d3.map(async (v2) => h.preloadImage(v2)), d$2.wait(300)]), this.endReached = this.isLastPage(); } catch (c2) { console.error(c2), P$1.openToast(h.getErrorMessage(c2), "error"); } finally { this.loading = false, this.firstFetch = false; } } onConnectCustom({ name: e2, id: t2, links: a2 }) { d$2.isMobile() ? h.handleMobileLinking({ links: a2, name: e2, id: t2 }) : g$2.push("DesktopConnector", { DesktopConnector: { name: e2, walletId: t2, universal: a2.universal, native: a2.native } }); } onConnectListing(e2) { if (d$2.isMobile()) { const { id: t2, image_url: a2 } = e2, { native: n2, universal: o3 } = e2.mobile; h.handleMobileLinking({ links: { native: n2, universal: o3 }, name: e2.name, id: t2, image: a2.lg }); } else g$2.push("DesktopConnector", { DesktopConnector: { name: e2.name, icon: e2.image_url.lg, universal: e2.desktop.universal || e2.homepage, native: e2.desktop.native } }); } onConnectExtension(e2) { h.getWalletId("") === e2.id ? g$2.push("InjectedConnector") : g$2.push("InstallConnector", { InstallConnector: e2 }); } onSearchChange(e2) { const { value: t2 } = e2.target; this.searchDebounce(t2); } coinbaseConnectorTemplate() { try { const e2 = L.client().getConnectorById(Z.coinbaseWallet); return y``; } catch { return null; } } render() { const { wallets: e2, search: t2 } = A$1.state, { isStandalone: a2 } = a$2.state; let { listings: n2 } = this.search ? t2 : e2; n2 = R.allowedExplorerListings(n2); const o$12 = this.loading && !n2.length, r2 = this.search.length >= 3, i2 = !o$12 && (!r2 || h.caseSafeIncludes(Z.coinbaseWallet, this.search)); let c2 = !a2 && !d$2.isMobile() ? h.getExtensionWallets() : [], m2 = h.getCustomWallets(); r2 && (c2 = c2.filter(({ name: O }) => h.caseSafeIncludes(O, this.search)), m2 = m2.filter(({ name: O }) => h.caseSafeIncludes(O, this.search))); const s2 = !this.loading && !n2.length && !c2.length && !i2, d3 = Math.max(c2.length, n2.length), v2 = { "w3m-loading": o$12, "w3m-end-reached": this.endReached || !this.loading, "w3m-empty": s2 }; return y`
${o$12 ? null : [...Array(d3)].map((O, C2) => y`${m2[C2] ? y`` : null} ${c2[C2] ? y`` : null} ${n2[C2] ? y`` : null}`)} ${i2 ? this.coinbaseConnectorTemplate() : null}
${s2 ? y`No results found` : null} ${!s2 && this.loading ? y`` : null}
`; } }; Q.styles = [u.globalCss, $n], xe([t$1()], Q.prototype, "loading", 2), xe([t$1()], Q.prototype, "firstFetch", 2), xe([t$1()], Q.prototype, "search", 2), xe([t$1()], Q.prototype, "endReached", 2), Q = xe([e$2("w3m-wallet-explorer-view")], Q); export { We as W3mAccountButton, ae as W3mConnectButton, ne as W3mCoreButton, re as W3mModal, ie as W3mNetworkSwitch };