UNPKG

@simplepay-ai/widget

Version:

SimplePay Payment Widget

1,349 lines 226 kB
import { p as process$1, a5 as ModalCtrl, a6 as RouterCtrl, a7 as ToastCtrl, a8 as ThemeCtrl, a9 as EventsCtrl, aa as ExplorerCtrl, ab as ConfigCtrl, ac as CoreUtil, ad as OptionsCtrl } from "./main-oDQ_krE7.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$5 = /* @__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$5.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && n$5.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$1 = r$1 ? r$1.emptyScript : "", o$3 = e$4.reactiveElementPolyfillSupport, n$4 = { toAttribute(t2, i2) { switch (i2) { case Boolean: t2 = t2 ? h$1 : 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$4, reflect: false, hasChanged: a$1 }, d$1 = "finalized"; let u$1 = class u extends HTMLElement { constructor() { super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = false, this.hasUpdated = false, this._$El = null, this._$Eu(); } 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(d$1)) return false; this[d$1] = 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; } _$Eu() { 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$4).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$4; 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) { } }; u$1[d$1] = true, u$1.elementProperties = /* @__PURE__ */ new Map(), u$1.elementStyles = [], u$1.shadowRootOptions = { mode: "open" }, null == o$3 || o$3({ ReactiveElement: u$1 }), (null !== (s$2 = e$4.reactiveElementVersions) && void 0 !== s$2 ? s$2 : e$4.reactiveElementVersions = []).push("1.6.3"); /** * @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$", n$3 = `lit$${(Math.random() + "").slice(9)}$`, l$2 = "?" + n$3, h = `<${l$2}>`, r = document, u2 = () => r.createComment(""), d = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, c = Array.isArray, v = (t2) => c(t2) || "function" == typeof (null == t2 ? void 0 : t2[Symbol.iterator]), a = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, _ = /-->/g, m = />/g, p = RegExp(`>|${a}(?:([^\\s"'>=/]+)(${a}*=${a}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"), g = /'/g, $ = /"/g, y = /^(?:script|style|textarea|title)$/i, w = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), x = w(1), b = w(2), T = Symbol.for("lit-noChange"), A = Symbol.for("lit-nothing"), E = /* @__PURE__ */ new WeakMap(), C = r.createTreeWalker(r, 129, null, false); function P(t2, i2) { if (!Array.isArray(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); return void 0 !== e$3 ? e$3.createHTML(i2) : i2; } const V = (t2, i2) => { const s2 = t2.length - 1, e2 = []; let l2, r2 = 2 === i2 ? "<svg>" : "", u3 = f; for (let i3 = 0; i3 < s2; i3++) { const s3 = t2[i3]; let d2, c2, v2 = -1, a2 = 0; for (; a2 < s3.length && (u3.lastIndex = a2, c2 = u3.exec(s3), null !== c2); ) a2 = u3.lastIndex, u3 === f ? "!--" === c2[1] ? u3 = _ : void 0 !== c2[1] ? u3 = m : void 0 !== c2[2] ? (y.test(c2[2]) && (l2 = RegExp("</" + c2[2], "g")), u3 = p) : void 0 !== c2[3] && (u3 = p) : u3 === p ? ">" === c2[0] ? (u3 = null != l2 ? l2 : f, v2 = -1) : void 0 === c2[1] ? v2 = -2 : (v2 = u3.lastIndex - c2[2].length, d2 = c2[1], u3 = void 0 === c2[3] ? p : '"' === c2[3] ? $ : g) : u3 === $ || u3 === g ? u3 = p : u3 === _ || u3 === m ? u3 = f : (u3 = p, l2 = void 0); const w2 = u3 === p && t2[i3 + 1].startsWith("/>") ? " " : ""; r2 += u3 === f ? s3 + h : v2 >= 0 ? (e2.push(d2), s3.slice(0, v2) + o$2 + s3.slice(v2) + n$3 + w2) : s3 + n$3 + (-2 === v2 ? (e2.push(void 0), i3) : w2); } return [P(t2, r2 + (t2[s2] || "<?>") + (2 === i2 ? "</svg>" : "")), e2]; }; class N { constructor({ strings: t2, _$litType$: i2 }, e2) { let h2; this.parts = []; let r2 = 0, d2 = 0; const c2 = t2.length - 1, v2 = this.parts, [a2, f2] = V(t2, i2); if (this.el = N.createElement(a2, e2), C.currentNode = this.el.content, 2 === i2) { const t3 = this.el.content, i3 = t3.firstChild; i3.remove(), t3.append(...i3.childNodes); } for (; null !== (h2 = C.nextNode()) && v2.length < c2; ) { if (1 === h2.nodeType) { if (h2.hasAttributes()) { const t3 = []; for (const i3 of h2.getAttributeNames()) if (i3.endsWith(o$2) || i3.startsWith(n$3)) { const s2 = f2[d2++]; if (t3.push(i3), void 0 !== s2) { const t4 = h2.getAttribute(s2.toLowerCase() + o$2).split(n$3), i4 = /([.?@])?(.*)/.exec(s2); v2.push({ type: 1, index: r2, name: i4[2], strings: t4, ctor: "." === i4[1] ? H : "?" === i4[1] ? L : "@" === i4[1] ? z : k }); } else v2.push({ type: 6, index: r2 }); } for (const i3 of t3) h2.removeAttribute(i3); } if (y.test(h2.tagName)) { const t3 = h2.textContent.split(n$3), i3 = t3.length - 1; if (i3 > 0) { h2.textContent = s$1 ? s$1.emptyScript : ""; for (let s2 = 0; s2 < i3; s2++) h2.append(t3[s2], u2()), C.nextNode(), v2.push({ type: 2, index: ++r2 }); h2.append(t3[i3], u2()); } } } else if (8 === h2.nodeType) if (h2.data === l$2) v2.push({ type: 2, index: r2 }); else { let t3 = -1; for (; -1 !== (t3 = h2.data.indexOf(n$3, t3 + 1)); ) v2.push({ type: 7, index: r2 }), t3 += n$3.length - 1; } r2++; } } static createElement(t2, i2) { const s2 = r.createElement("template"); return s2.innerHTML = t2, s2; } } function S(t2, i2, s2 = t2, e2) { var o3, n2, l2, h2; if (i2 === T) return i2; let r2 = void 0 !== e2 ? null === (o3 = s2._$Co) || void 0 === o3 ? void 0 : o3[e2] : s2._$Cl; const u3 = d(i2) ? void 0 : i2._$litDirective$; return (null == r2 ? void 0 : r2.constructor) !== u3 && (null === (n2 = null == r2 ? void 0 : r2._$AO) || void 0 === n2 || n2.call(r2, false), void 0 === u3 ? r2 = void 0 : (r2 = new u3(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 = S(t2, r2._$AS(t2, i2.values), r2, e2)), i2; } class M { constructor(t2, i2) { this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } u(t2) { var i2; const { el: { content: s2 }, parts: e2 } = this._$AD, o3 = (null !== (i2 = null == t2 ? void 0 : t2.creationScope) && void 0 !== i2 ? i2 : r).importNode(s2, true); C.currentNode = o3; let n2 = C.nextNode(), l2 = 0, h2 = 0, u3 = e2[0]; for (; void 0 !== u3; ) { if (l2 === u3.index) { let i3; 2 === u3.type ? i3 = new R(n2, n2.nextSibling, this, t2) : 1 === u3.type ? i3 = new u3.ctor(n2, u3.name, u3.strings, this, t2) : 6 === u3.type && (i3 = new Z(n2, this, t2)), this._$AV.push(i3), u3 = e2[++h2]; } l2 !== (null == u3 ? void 0 : u3.index) && (n2 = C.nextNode(), l2++); } return C.currentNode = r, o3; } v(t2) { let i2 = 0; for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++; } } class R { constructor(t2, i2, s2, e2) { var o3; this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cp = 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._$Cp; } get parentNode() { let t2 = this._$AA.parentNode; const i2 = this._$AM; return void 0 !== i2 && 11 === (null == t2 ? void 0 : t2.nodeType) && (t2 = i2.parentNode), t2; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(t2, i2 = this) { t2 = S(this, t2, i2), d(t2) ? t2 === A || null == t2 || "" === t2 ? (this._$AH !== A && this._$AR(), this._$AH = A) : t2 !== this._$AH && t2 !== T && this._(t2) : void 0 !== t2._$litType$ ? this.g(t2) : void 0 !== t2.nodeType ? this.$(t2) : v(t2) ? this.T(t2) : this._(t2); } k(t2) { return this._$AA.parentNode.insertBefore(t2, this._$AB); } $(t2) { this._$AH !== t2 && (this._$AR(), this._$AH = this.k(t2)); } _(t2) { this._$AH !== A && d(this._$AH) ? this._$AA.nextSibling.data = t2 : this.$(r.createTextNode(t2)), this._$AH = t2; } g(t2) { var i2; const { values: s2, _$litType$: e2 } = t2, o3 = "number" == typeof e2 ? this._$AC(t2) : (void 0 === e2.el && (e2.el = N.createElement(P(e2.h, e2.h[0]), this.options)), e2); if ((null === (i2 = this._$AH) || void 0 === i2 ? void 0 : i2._$AD) === o3) this._$AH.v(s2); else { const t3 = new M(o3, this), i3 = t3.u(this.options); t3.v(s2), this.$(i3), this._$AH = t3; } } _$AC(t2) { let i2 = E.get(t2.strings); return void 0 === i2 && E.set(t2.strings, i2 = new N(t2)), i2; } T(t2) { c(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 R(this.k(u2()), this.k(u2()), 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._$Cp = t2, null === (i2 = this._$AP) || void 0 === i2 || i2.call(this, t2)); } } class k { constructor(t2, i2, s2, e2, o3) { this.type = 1, this._$AH = A, 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 = A; } 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 = S(this, t2, i2, 0), n2 = !d(t2) || t2 !== this._$AH && t2 !== T, n2 && (this._$AH = t2); else { const e3 = t2; let l2, h2; for (t2 = o3[0], l2 = 0; l2 < o3.length - 1; l2++) h2 = S(this, e3[s2 + l2], i2, l2), h2 === T && (h2 = this._$AH[l2]), n2 || (n2 = !d(h2) || h2 !== this._$AH[l2]), h2 === A ? t2 = A : t2 !== A && (t2 += (null != h2 ? h2 : "") + o3[l2 + 1]), this._$AH[l2] = h2; } n2 && !e2 && this.j(t2); } j(t2) { t2 === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, null != t2 ? t2 : ""); } } class H extends k { constructor() { super(...arguments), this.type = 3; } j(t2) { this.element[this.name] = t2 === A ? void 0 : t2; } } const I = s$1 ? s$1.emptyScript : ""; class L extends k { constructor() { super(...arguments), this.type = 4; } j(t2) { t2 && t2 !== A ? this.element.setAttribute(this.name, I) : this.element.removeAttribute(this.name); } } class z extends k { 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 = S(this, t2, i2, 0)) && void 0 !== s2 ? s2 : A) === T) return; const e2 = this._$AH, o3 = t2 === A && e2 !== A || t2.capture !== e2.capture || t2.once !== e2.once || t2.passive !== e2.passive, n2 = t2 !== A && (e2 === A || 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 Z { 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) { S(this, t2); } } const B = i$2.litHtmlPolyfillSupport; null == B || B(N, R), (null !== (t$2 = i$2.litHtmlVersions) && void 0 !== t$2 ? t$2 : i$2.litHtmlVersions = []).push("2.8.0"); const D = (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 R(i2.insertBefore(u2(), 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 u$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 = D(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 T; } } s.finalized = true, s._$litElement$ = true, null === (l$1 = globalThis.litElementHydrateSupport) || void 0 === l$1 || l$1.call(globalThis, { LitElement: s }); const n$2 = globalThis.litElementPolyfillSupport; null == n$2 || n$2({ LitElement: s }); (null !== (o$1 = globalThis.litElementVersions) && void 0 !== o$1 ? o$1 : globalThis.litElementVersions = []).push("3.3.3"); /** * @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); } }, e$1 = (i2, e2, n2) => { e2.constructor.createProperty(n2, i2); }; function n$1(n2) { return (t2, o3) => void 0 !== o3 ? e$1(n2, t2, o3) : i$1(n2, t2); } /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ function t$1(t2) { return n$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 }, 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.it) { this.it = /* @__PURE__ */ new Set(), void 0 !== i2.strings && (this.nt = new Set(i2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2))); for (const t2 in s2) s2[t2] && !(null === (r2 = this.nt) || void 0 === r2 ? void 0 : r2.has(t2)) && this.it.add(t2); return this.render(s2); } const e2 = i2.element.classList; this.it.forEach((t2) => { t2 in s2 || (e2.remove(t2), this.it.delete(t2)); }); for (const t2 in s2) { const i3 = !!s2[t2]; i3 === this.it.has(t2) || (null === (o3 = this.nt) || void 0 === o3 ? void 0 : o3.has(t2)) || (i3 ? (e2.add(t2), this.it.add(t2)) : (e2.remove(t2), this.it.delete(t2))); } return T; } }); 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 = { 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 }; 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); const namedEasing = namedEasings[definition]; if (namedEasing) return namedEasing; 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.duration, delay = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, offset, direction = "normal", autoplay = true } = {}) { 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.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 _a; 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"; (_a = this.resolve) === null || _a === void 0 ? void 0 : _a.call(this, latest); } else if (this.playState !== "idle") { this.frameRequestId = requestAnimationFrame(this.tick); } }; if (autoplay) 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 _a; this.playState = "idle"; if (this.frameRequestId !== void 0) { cancelAnimationFrame(this.frameRequestId); } (_a = this.reject) === null || _a === void 0 ? void 0 : _a.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; } } var invariant = function() { }; if (process$1.env.NODE_ENV !== "production") { invariant = function(check, message) { if (!check) { throw new Error(message); } }; } 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: "<angle>", initialValue: "0deg", toDefaultUnit: (v2) => v2 + "deg" }; const baseTransformProperties = { translate: { syntax: "<length-percentage>", initialValue: "0px", toDefaultUnit: (v2) => v2 + "px" }, rotate: rotation, scale: { syntax: "<number>", 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.easing; } else { return isCubicBezier(easing) ? cubicBezierAsString(easing) : easing; } }; const cubicBezierAsString = ([a2, b2, c2, d2]) => `cubic-bezier(${a2}, ${b2}, ${c2}, ${d2})`; 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 _a; let toUnit = (definition === null || definition === void 0 ? void 0 : definition.toDefaultUnit) || noopReturn; const finalKeyframe = keyframes[keyframes.length - 1]; if (isString(finalKeyframe)) { const unit = ((_a = finalKeyframe.match(/(-?[\d.]+)([a-z%]*)/)) === null || _a === void 0 ? void 0 : _a[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.duration, delay = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, easing = defaults.easing, persist = false, direction, offset, allowWebkitAcceleration = false, autoplay = true } = 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 _a, _b; return (_b = (_a = style.get(element, name)) !== null && _a !== void 0 ? _a : 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); if (animation && !autoplay) animation.pause(); 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) { if (typeof elements === "string") { { 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.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 "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; invariant(Boolean(numElements), "No valid element provided."); invariant(Boolean(keyframes), "No keyframes defined."); 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); 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 : A; 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,