@headless-primitives/label
Advanced tools
+327
-321
@@ -1,11 +0,11 @@ | ||
| var R = globalThis, q = R.ShadowRoot && (R.ShadyCSS === void 0 || R.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, pt = Symbol(), G = /* @__PURE__ */ new WeakMap(), Et = class { | ||
| constructor(t, e, i) { | ||
| var R = globalThis, F = R.ShadowRoot && (R.ShadyCSS === void 0 || R.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, pt = Symbol(), G = /* @__PURE__ */ new WeakMap(), vt = class { | ||
| constructor(t, s, i) { | ||
| if (this._$cssResult$ = !0, i !== pt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); | ||
| this.cssText = t, this.t = e; | ||
| this.cssText = t, this.t = s; | ||
| } | ||
| get styleSheet() { | ||
| let t = this.o, e = this.t; | ||
| if (q && t === void 0) { | ||
| let i = e !== void 0 && e.length === 1; | ||
| i && (t = G.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && G.set(e, t)); | ||
| let t = this.o, s = this.t; | ||
| if (F && t === void 0) { | ||
| let i = s !== void 0 && s.length === 1; | ||
| i && (t = G.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && G.set(s, t)); | ||
| } | ||
@@ -17,32 +17,32 @@ return t; | ||
| } | ||
| }, bt = (s) => new Et(typeof s == "string" ? s : s + "", void 0, pt), St = (s, t) => { | ||
| if (q) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); | ||
| else for (let e of t) { | ||
| }, Et = (e) => new vt(typeof e == "string" ? e : e + "", void 0, pt), St = (e, t) => { | ||
| if (F) e.adoptedStyleSheets = t.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet); | ||
| else for (let s of t) { | ||
| let i = document.createElement("style"), r = R.litNonce; | ||
| r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i); | ||
| r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, e.appendChild(i); | ||
| } | ||
| }, Q = q ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => { | ||
| let e = ""; | ||
| for (let i of t.cssRules) e += i.cssText; | ||
| return bt(e); | ||
| })(s) : s, { is: wt, defineProperty: Ct, getOwnPropertyDescriptor: Pt, getOwnPropertyNames: Ut, getOwnPropertySymbols: Ot, getPrototypeOf: Mt } = Object, N = globalThis, X = N.trustedTypes, Rt = X ? X.emptyScript : "", xt = N.reactiveElementPolyfillSupport, S = (s, t) => s, z = { | ||
| toAttribute(s, t) { | ||
| }, Q = F ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => { | ||
| let s = ""; | ||
| for (let i of t.cssRules) s += i.cssText; | ||
| return Et(s); | ||
| })(e) : e, { is: wt, defineProperty: Ct, getOwnPropertyDescriptor: Pt, getOwnPropertyNames: Ut, getOwnPropertySymbols: Ot, getPrototypeOf: Mt } = Object, N = globalThis, X = N.trustedTypes, Rt = X ? X.emptyScript : "", xt = N.reactiveElementPolyfillSupport, S = (e, t) => e, z = { | ||
| toAttribute(e, t) { | ||
| switch (t) { | ||
| case Boolean: | ||
| s = s ? Rt : null; | ||
| e = e ? Rt : null; | ||
| break; | ||
| case Object: | ||
| case Array: | ||
| s = s == null ? s : JSON.stringify(s); | ||
| e = e == null ? e : JSON.stringify(e); | ||
| } | ||
| return s; | ||
| return e; | ||
| }, | ||
| fromAttribute(s, t) { | ||
| let e = s; | ||
| fromAttribute(e, t) { | ||
| let s = e; | ||
| switch (t) { | ||
| case Boolean: | ||
| e = s !== null; | ||
| s = e !== null; | ||
| break; | ||
| case Number: | ||
| e = s === null ? null : Number(s); | ||
| s = e === null ? null : Number(e); | ||
| break; | ||
@@ -52,10 +52,10 @@ case Object: | ||
| try { | ||
| e = JSON.parse(s); | ||
| s = JSON.parse(e); | ||
| } catch { | ||
| e = null; | ||
| s = null; | ||
| } | ||
| } | ||
| return e; | ||
| return s; | ||
| } | ||
| }, ut = (s, t) => !wt(s, t), Y = { | ||
| }, ut = (e, t) => !wt(e, t), Y = { | ||
| attribute: !0, | ||
@@ -70,4 +70,4 @@ type: String, | ||
| var g = class extends HTMLElement { | ||
| static addInitializer(t) { | ||
| this._$Ei(), (this.l ??= []).push(t); | ||
| static addInitializer(e) { | ||
| this._$Ei(), (this.l ??= []).push(e); | ||
| } | ||
@@ -77,22 +77,22 @@ static get observedAttributes() { | ||
| } | ||
| static createProperty(t, e = Y) { | ||
| if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) { | ||
| let i = Symbol(), r = this.getPropertyDescriptor(t, i, e); | ||
| r !== void 0 && Ct(this.prototype, t, r); | ||
| static createProperty(e, t = Y) { | ||
| if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) { | ||
| let s = Symbol(), i = this.getPropertyDescriptor(e, s, t); | ||
| i !== void 0 && Ct(this.prototype, e, i); | ||
| } | ||
| } | ||
| static getPropertyDescriptor(t, e, i) { | ||
| let { get: r, set: o } = Pt(this.prototype, t) ?? { | ||
| static getPropertyDescriptor(e, t, s) { | ||
| let { get: i, set: r } = Pt(this.prototype, e) ?? { | ||
| get() { | ||
| return this[e]; | ||
| return this[t]; | ||
| }, | ||
| set(n) { | ||
| this[e] = n; | ||
| set(o) { | ||
| this[t] = o; | ||
| } | ||
| }; | ||
| return { | ||
| get: r, | ||
| set(n) { | ||
| let h = r?.call(this); | ||
| o?.call(this, n), this.requestUpdate(t, h, i); | ||
| get: i, | ||
| set(o) { | ||
| let n = i?.call(this); | ||
| r?.call(this, o), this.requestUpdate(e, n, s); | ||
| }, | ||
@@ -103,9 +103,9 @@ configurable: !0, | ||
| } | ||
| static getPropertyOptions(t) { | ||
| return this.elementProperties.get(t) ?? Y; | ||
| static getPropertyOptions(e) { | ||
| return this.elementProperties.get(e) ?? Y; | ||
| } | ||
| static _$Ei() { | ||
| if (this.hasOwnProperty(S("elementProperties"))) return; | ||
| let t = Mt(this); | ||
| t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties); | ||
| let e = Mt(this); | ||
| e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties); | ||
| } | ||
@@ -115,28 +115,28 @@ static finalize() { | ||
| if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(S("properties"))) { | ||
| let e = this.properties, i = [...Ut(e), ...Ot(e)]; | ||
| for (let r of i) this.createProperty(r, e[r]); | ||
| let t = this.properties, s = [...Ut(t), ...Ot(t)]; | ||
| for (let i of s) this.createProperty(i, t[i]); | ||
| } | ||
| let t = this[Symbol.metadata]; | ||
| if (t !== null) { | ||
| let e = litPropertyMetadata.get(t); | ||
| if (e !== void 0) for (let [i, r] of e) this.elementProperties.set(i, r); | ||
| let e = this[Symbol.metadata]; | ||
| if (e !== null) { | ||
| let t = litPropertyMetadata.get(e); | ||
| if (t !== void 0) for (let [s, i] of t) this.elementProperties.set(s, i); | ||
| } | ||
| this._$Eh = /* @__PURE__ */ new Map(); | ||
| for (let [e, i] of this.elementProperties) { | ||
| let r = this._$Eu(e, i); | ||
| r !== void 0 && this._$Eh.set(r, e); | ||
| for (let [t, s] of this.elementProperties) { | ||
| let i = this._$Eu(t, s); | ||
| i !== void 0 && this._$Eh.set(i, t); | ||
| } | ||
| this.elementStyles = this.finalizeStyles(this.styles); | ||
| } | ||
| static finalizeStyles(t) { | ||
| let e = []; | ||
| if (Array.isArray(t)) { | ||
| let i = new Set(t.flat(1 / 0).reverse()); | ||
| for (let r of i) e.unshift(Q(r)); | ||
| } else t !== void 0 && e.push(Q(t)); | ||
| return e; | ||
| static finalizeStyles(e) { | ||
| let t = []; | ||
| if (Array.isArray(e)) { | ||
| let s = new Set(e.flat(1 / 0).reverse()); | ||
| for (let i of s) t.unshift(Q(i)); | ||
| } else e !== void 0 && t.push(Q(e)); | ||
| return t; | ||
| } | ||
| static _$Eu(t, e) { | ||
| let i = e.attribute; | ||
| return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0; | ||
| static _$Eu(e, t) { | ||
| let s = t.attribute; | ||
| return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0; | ||
| } | ||
@@ -147,56 +147,56 @@ constructor() { | ||
| _$Ev() { | ||
| this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this)); | ||
| this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this)); | ||
| } | ||
| addController(t) { | ||
| (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.(); | ||
| addController(e) { | ||
| (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.(); | ||
| } | ||
| removeController(t) { | ||
| this._$EO?.delete(t); | ||
| removeController(e) { | ||
| this._$EO?.delete(e); | ||
| } | ||
| _$E_() { | ||
| let t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties; | ||
| for (let i of e.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]); | ||
| t.size > 0 && (this._$Ep = t); | ||
| let e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties; | ||
| for (let s of t.keys()) this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]); | ||
| e.size > 0 && (this._$Ep = e); | ||
| } | ||
| createRenderRoot() { | ||
| let t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); | ||
| return St(t, this.constructor.elementStyles), t; | ||
| let e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); | ||
| return St(e, this.constructor.elementStyles), e; | ||
| } | ||
| connectedCallback() { | ||
| this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.()); | ||
| this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.()); | ||
| } | ||
| enableUpdating(t) { | ||
| enableUpdating(e) { | ||
| } | ||
| disconnectedCallback() { | ||
| this._$EO?.forEach((t) => t.hostDisconnected?.()); | ||
| this._$EO?.forEach((e) => e.hostDisconnected?.()); | ||
| } | ||
| attributeChangedCallback(t, e, i) { | ||
| this._$AK(t, i); | ||
| attributeChangedCallback(e, t, s) { | ||
| this._$AK(e, s); | ||
| } | ||
| _$ET(t, e) { | ||
| let i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i); | ||
| if (r !== void 0 && i.reflect === !0) { | ||
| let o = (i.converter?.toAttribute === void 0 ? z : i.converter).toAttribute(e, i.type); | ||
| this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null; | ||
| _$ET(e, t) { | ||
| let s = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, s); | ||
| if (i !== void 0 && s.reflect === !0) { | ||
| let r = (s.converter?.toAttribute === void 0 ? z : s.converter).toAttribute(t, s.type); | ||
| this._$Em = e, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null; | ||
| } | ||
| } | ||
| _$AK(t, e) { | ||
| let i = this.constructor, r = i._$Eh.get(t); | ||
| if (r !== void 0 && this._$Em !== r) { | ||
| let o = i.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute === void 0 ? z : o.converter; | ||
| this._$Em = r; | ||
| let h = n.fromAttribute(e, o.type); | ||
| this[r] = h ?? this._$Ej?.get(r) ?? h, this._$Em = null; | ||
| _$AK(e, t) { | ||
| let s = this.constructor, i = s._$Eh.get(e); | ||
| if (i !== void 0 && this._$Em !== i) { | ||
| let r = s.getPropertyOptions(i), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute === void 0 ? z : r.converter; | ||
| this._$Em = i; | ||
| let n = o.fromAttribute(t, r.type); | ||
| this[i] = n ?? this._$Ej?.get(i) ?? n, this._$Em = null; | ||
| } | ||
| } | ||
| requestUpdate(t, e, i, r = !1, o) { | ||
| if (t !== void 0) { | ||
| let n = this.constructor; | ||
| if (r === !1 && (o = this[t]), i ??= n.getPropertyOptions(t), !((i.hasChanged ?? ut)(o, e) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(n._$Eu(t, i)))) return; | ||
| this.C(t, e, i); | ||
| requestUpdate(e, t, s, i = !1, r) { | ||
| if (e !== void 0) { | ||
| let o = this.constructor; | ||
| if (i === !1 && (r = this[e]), s ??= o.getPropertyOptions(e), !((s.hasChanged ?? ut)(r, t) || s.useDefault && s.reflect && r === this._$Ej?.get(e) && !this.hasAttribute(o._$Eu(e, s)))) return; | ||
| this.C(e, t, s); | ||
| } | ||
| this.isUpdatePending === !1 && (this._$ES = this._$EP()); | ||
| } | ||
| C(t, e, { useDefault: i, reflect: r, wrapped: o }, n) { | ||
| i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t)); | ||
| C(e, t, { useDefault: s, reflect: i, wrapped: r }, o) { | ||
| s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, o ?? t ?? this[e]), r !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), i === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e)); | ||
| } | ||
@@ -207,7 +207,7 @@ async _$EP() { | ||
| await this._$ES; | ||
| } catch (e) { | ||
| Promise.reject(e); | ||
| } catch (t) { | ||
| Promise.reject(t); | ||
| } | ||
| let t = this.scheduleUpdate(); | ||
| return t != null && await t, !this.isUpdatePending; | ||
| let e = this.scheduleUpdate(); | ||
| return e != null && await e, !this.isUpdatePending; | ||
| } | ||
@@ -221,23 +221,23 @@ scheduleUpdate() { | ||
| if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { | ||
| for (let [r, o] of this._$Ep) this[r] = o; | ||
| for (let [i, r] of this._$Ep) this[i] = r; | ||
| this._$Ep = void 0; | ||
| } | ||
| let i = this.constructor.elementProperties; | ||
| if (i.size > 0) for (let [r, o] of i) { | ||
| let { wrapped: n } = o, h = this[r]; | ||
| n !== !0 || this._$AL.has(r) || h === void 0 || this.C(r, void 0, o, h); | ||
| let s = this.constructor.elementProperties; | ||
| if (s.size > 0) for (let [i, r] of s) { | ||
| let { wrapped: o } = r, n = this[i]; | ||
| o !== !0 || this._$AL.has(i) || n === void 0 || this.C(i, void 0, r, n); | ||
| } | ||
| } | ||
| let t = !1, e = this._$AL; | ||
| let e = !1, t = this._$AL; | ||
| try { | ||
| t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(e)) : this._$EM(); | ||
| } catch (i) { | ||
| throw t = !1, this._$EM(), i; | ||
| e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(t)) : this._$EM(); | ||
| } catch (s) { | ||
| throw e = !1, this._$EM(), s; | ||
| } | ||
| t && this._$AE(e); | ||
| e && this._$AE(t); | ||
| } | ||
| willUpdate(t) { | ||
| willUpdate(e) { | ||
| } | ||
| _$AE(t) { | ||
| this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); | ||
| _$AE(e) { | ||
| this._$EO?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e); | ||
| } | ||
@@ -253,36 +253,36 @@ _$EM() { | ||
| } | ||
| shouldUpdate(t) { | ||
| shouldUpdate(e) { | ||
| return !0; | ||
| } | ||
| update(t) { | ||
| this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM(); | ||
| update(e) { | ||
| this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM(); | ||
| } | ||
| updated(t) { | ||
| updated(e) { | ||
| } | ||
| firstUpdated(t) { | ||
| firstUpdated(e) { | ||
| } | ||
| }; | ||
| g.elementStyles = [], g.shadowRootOptions = { mode: "open" }, g[S("elementProperties")] = /* @__PURE__ */ new Map(), g[S("finalized")] = /* @__PURE__ */ new Map(), xt?.({ ReactiveElement: g }), (N.reactiveElementVersions ??= []).push("2.1.2"); | ||
| var B = globalThis, tt = (s) => s, T = B.trustedTypes, et = T ? T.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ft = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, $t = "?" + $, Tt = `<${$t}>`, y = document, P = () => y.createComment(""), U = (s) => s === null || typeof s != "object" && typeof s != "function", V = Array.isArray, kt = (s) => V(s) || typeof s?.[Symbol.iterator] == "function", L = `[ | ||
| \f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, it = />/g, _ = RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ | ||
| var B = globalThis, tt = (e) => e, T = B.trustedTypes, et = T ? T.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ft = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, $t = "?" + $, Tt = `<${$t}>`, y = document, P = () => y.createComment(""), U = (e) => e === null || typeof e != "object" && typeof e != "function", V = Array.isArray, kt = (e) => V(e) || typeof e?.[Symbol.iterator] == "function", L = `[ | ||
| \f\r]`, v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, it = />/g, _ = RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ | ||
| \f\r"'\`<>=]|("|')|))|$)`, "g"), rt = /'/g, ot = /"/g, _t = /^(?:script|style|textarea|title)$/i, A = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), nt = /* @__PURE__ */ new WeakMap(), m = y.createTreeWalker(y, 129); | ||
| function mt(s, t) { | ||
| if (!V(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array"); | ||
| function mt(e, t) { | ||
| if (!V(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array"); | ||
| return et === void 0 ? t : et.createHTML(t); | ||
| } | ||
| var Nt = (s, t) => { | ||
| let e = s.length - 1, i = [], r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = E; | ||
| for (let h = 0; h < e; h++) { | ||
| let a = s[h], O, p, l = -1, u = 0; | ||
| for (; u < a.length && (n.lastIndex = u, p = n.exec(a), p !== null); ) u = n.lastIndex, n === E ? p[1] === "!--" ? n = st : p[1] === void 0 ? p[2] === void 0 ? p[3] !== void 0 && (n = _) : (_t.test(p[2]) && (r = RegExp("</" + p[2], "g")), n = _) : n = it : n === _ ? p[0] === ">" ? (n = r ?? E, l = -1) : p[1] === void 0 ? l = -2 : (l = n.lastIndex - p[2].length, O = p[1], n = p[3] === void 0 ? _ : p[3] === '"' ? ot : rt) : n === ot || n === rt ? n = _ : n === st || n === it ? n = E : (n = _, r = void 0); | ||
| let f = n === _ && s[h + 1].startsWith("/>") ? " " : ""; | ||
| o += n === E ? a + Tt : l >= 0 ? (i.push(O), a.slice(0, l) + ft + a.slice(l) + $ + f) : a + $ + (l === -2 ? h : f); | ||
| var Nt = (e, t) => { | ||
| let s = e.length - 1, i = [], r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = v; | ||
| for (let h = 0; h < s; h++) { | ||
| let a = e[h], O, p, l = -1, u = 0; | ||
| for (; u < a.length && (n.lastIndex = u, p = n.exec(a), p !== null); ) u = n.lastIndex, n === v ? p[1] === "!--" ? n = st : p[1] === void 0 ? p[2] === void 0 ? p[3] !== void 0 && (n = _) : (_t.test(p[2]) && (r = RegExp("</" + p[2], "g")), n = _) : n = it : n === _ ? p[0] === ">" ? (n = r ?? v, l = -1) : p[1] === void 0 ? l = -2 : (l = n.lastIndex - p[2].length, O = p[1], n = p[3] === void 0 ? _ : p[3] === '"' ? ot : rt) : n === ot || n === rt ? n = _ : n === st || n === it ? n = v : (n = _, r = void 0); | ||
| let f = n === _ && e[h + 1].startsWith("/>") ? " " : ""; | ||
| o += n === v ? a + Tt : l >= 0 ? (i.push(O), a.slice(0, l) + ft + a.slice(l) + $ + f) : a + $ + (l === -2 ? h : f); | ||
| } | ||
| return [mt(s, o + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i]; | ||
| return [mt(e, o + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i]; | ||
| }, I = class yt { | ||
| constructor({ strings: t, _$litType$: e }, i) { | ||
| constructor({ strings: t, _$litType$: s }, i) { | ||
| let r; | ||
| this.parts = []; | ||
| let o = 0, n = 0, h = t.length - 1, a = this.parts, [O, p] = Nt(t, e); | ||
| if (this.el = yt.createElement(O, i), m.currentNode = this.el.content, e === 2 || e === 3) { | ||
| let o = 0, n = 0, h = t.length - 1, a = this.parts, [O, p] = Nt(t, s); | ||
| if (this.el = yt.createElement(O, i), m.currentNode = this.el.content, s === 2 || s === 3) { | ||
| let l = this.el.content.firstChild; | ||
@@ -331,3 +331,3 @@ l.replaceWith(...l.childNodes); | ||
| } | ||
| static createElement(t, e) { | ||
| static createElement(t, s) { | ||
| let i = y.createElement("template"); | ||
@@ -337,10 +337,10 @@ return i.innerHTML = t, i; | ||
| }; | ||
| function v(s, t, e = s, i) { | ||
| function b(e, t, s = e, i) { | ||
| if (t === A) return t; | ||
| let r = i === void 0 ? e._$Cl : e._$Co?.[i], o = U(t) ? void 0 : t._$litDirective$; | ||
| return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(s), r._$AT(s, e, i)), i === void 0 ? e._$Cl = r : (e._$Co ??= [])[i] = r), r !== void 0 && (t = v(s, r._$AS(s, t.values), r, i)), t; | ||
| let r = i === void 0 ? s._$Cl : s._$Co?.[i], o = U(t) ? void 0 : t._$litDirective$; | ||
| return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(e), r._$AT(e, s, i)), i === void 0 ? s._$Cl = r : (s._$Co ??= [])[i] = r), r !== void 0 && (t = b(e, r._$AS(e, t.values), r, i)), t; | ||
| } | ||
| var Ht = class { | ||
| constructor(s, t) { | ||
| this._$AV = [], this._$AN = void 0, this._$AD = s, this._$AM = t; | ||
| constructor(e, t) { | ||
| this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t; | ||
| } | ||
@@ -353,10 +353,10 @@ get parentNode() { | ||
| } | ||
| u(s) { | ||
| let { el: { content: t }, parts: e } = this._$AD, i = (s?.creationScope ?? y).importNode(t, !0); | ||
| u(e) { | ||
| let { el: { content: t }, parts: s } = this._$AD, i = (e?.creationScope ?? y).importNode(t, !0); | ||
| m.currentNode = i; | ||
| let r = m.nextNode(), o = 0, n = 0, h = e[0]; | ||
| let r = m.nextNode(), o = 0, n = 0, h = s[0]; | ||
| for (; h !== void 0; ) { | ||
| if (o === h.index) { | ||
| let a; | ||
| h.type === 2 ? a = new W(r, r.nextSibling, this, s) : h.type === 1 ? a = new h.ctor(r, h.name, h.strings, this, s) : h.type === 6 && (a = new zt(r, this, s)), this._$AV.push(a), h = e[++n]; | ||
| h.type === 2 ? a = new W(r, r.nextSibling, this, e) : h.type === 1 ? a = new h.ctor(r, h.name, h.strings, this, e) : h.type === 6 && (a = new zt(r, this, e)), this._$AV.push(a), h = s[++n]; | ||
| } | ||
@@ -367,5 +367,5 @@ o !== h?.index && (r = m.nextNode(), o++); | ||
| } | ||
| p(s) { | ||
| p(e) { | ||
| let t = 0; | ||
| for (let e of this._$AV) e !== void 0 && (e.strings === void 0 ? e._$AI(s[t]) : (e._$AI(s, e, t), t += e.strings.length - 2)), t++; | ||
| for (let s of this._$AV) s !== void 0 && (s.strings === void 0 ? s._$AI(e[t]) : (s._$AI(e, s, t), t += s.strings.length - 2)), t++; | ||
| } | ||
@@ -376,8 +376,8 @@ }, W = class gt { | ||
| } | ||
| constructor(t, e, i, r) { | ||
| this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0; | ||
| constructor(t, s, i, r) { | ||
| this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = s, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0; | ||
| } | ||
| get parentNode() { | ||
| let t = this._$AA.parentNode, e = this._$AM; | ||
| return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t; | ||
| let t = this._$AA.parentNode, s = this._$AM; | ||
| return s !== void 0 && t?.nodeType === 11 && (t = s.parentNode), t; | ||
| } | ||
@@ -390,4 +390,4 @@ get startNode() { | ||
| } | ||
| _$AI(t, e = this) { | ||
| t = v(this, t, e), U(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== A && this._(t) : t._$litType$ === void 0 ? t.nodeType === void 0 ? kt(t) ? this.k(t) : this._(t) : this.T(t) : this.$(t); | ||
| _$AI(t, s = this) { | ||
| t = b(this, t, s), U(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== A && this._(t) : t._$litType$ === void 0 ? t.nodeType === void 0 ? kt(t) ? this.k(t) : this._(t) : this.T(t) : this.$(t); | ||
| } | ||
@@ -404,21 +404,21 @@ O(t) { | ||
| $(t) { | ||
| let { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = I.createElement(mt(i.h, i.h[0]), this.options)), i); | ||
| if (this._$AH?._$AD === r) this._$AH.p(e); | ||
| let { values: s, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = I.createElement(mt(i.h, i.h[0]), this.options)), i); | ||
| if (this._$AH?._$AD === r) this._$AH.p(s); | ||
| else { | ||
| let o = new Ht(r, this), n = o.u(this.options); | ||
| o.p(e), this.T(n), this._$AH = o; | ||
| o.p(s), this.T(n), this._$AH = o; | ||
| } | ||
| } | ||
| _$AC(t) { | ||
| let e = nt.get(t.strings); | ||
| return e === void 0 && nt.set(t.strings, e = new I(t)), e; | ||
| let s = nt.get(t.strings); | ||
| return s === void 0 && nt.set(t.strings, s = new I(t)), s; | ||
| } | ||
| k(t) { | ||
| V(this._$AH) || (this._$AH = [], this._$AR()); | ||
| let e = this._$AH, i, r = 0; | ||
| for (let o of t) r === e.length ? e.push(i = new gt(this.O(P()), this.O(P()), this, this.options)) : i = e[r], i._$AI(o), r++; | ||
| r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r); | ||
| let s = this._$AH, i, r = 0; | ||
| for (let o of t) r === s.length ? s.push(i = new gt(this.O(P()), this.O(P()), this, this.options)) : i = s[r], i._$AI(o), r++; | ||
| r < s.length && (this._$AR(i && i._$AB.nextSibling, r), s.length = r); | ||
| } | ||
| _$AR(t = this._$AA.nextSibling, e) { | ||
| for (this._$AP?.(!1, !0, e); t !== this._$AB; ) { | ||
| _$AR(t = this._$AA.nextSibling, s) { | ||
| for (this._$AP?.(!1, !0, s); t !== this._$AB; ) { | ||
| let i = tt(t).nextSibling; | ||
@@ -438,16 +438,16 @@ tt(t).remove(), t = i; | ||
| } | ||
| constructor(s, t, e, i, r) { | ||
| this.type = 1, this._$AH = d, this._$AN = void 0, this.element = s, this.name = t, this._$AM = i, this.options = r, e.length > 2 || e[0] !== "" || e[1] !== "" ? (this._$AH = Array(e.length - 1).fill(/* @__PURE__ */ new String()), this.strings = e) : this._$AH = d; | ||
| constructor(e, t, s, i, r) { | ||
| this.type = 1, this._$AH = d, this._$AN = void 0, this.element = e, this.name = t, this._$AM = i, this.options = r, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(/* @__PURE__ */ new String()), this.strings = s) : this._$AH = d; | ||
| } | ||
| _$AI(s, t = this, e, i) { | ||
| _$AI(e, t = this, s, i) { | ||
| let r = this.strings, o = !1; | ||
| if (r === void 0) s = v(this, s, t, 0), o = !U(s) || s !== this._$AH && s !== A, o && (this._$AH = s); | ||
| if (r === void 0) e = b(this, e, t, 0), o = !U(e) || e !== this._$AH && e !== A, o && (this._$AH = e); | ||
| else { | ||
| let n = s, h, a; | ||
| for (s = r[0], h = 0; h < r.length - 1; h++) a = v(this, n[e + h], t, h), a === A && (a = this._$AH[h]), o ||= !U(a) || a !== this._$AH[h], a === d ? s = d : s !== d && (s += (a ?? "") + r[h + 1]), this._$AH[h] = a; | ||
| let n = e, h, a; | ||
| for (e = r[0], h = 0; h < r.length - 1; h++) a = b(this, n[s + h], t, h), a === A && (a = this._$AH[h]), o ||= !U(a) || a !== this._$AH[h], a === d ? e = d : e !== d && (e += (a ?? "") + r[h + 1]), this._$AH[h] = a; | ||
| } | ||
| o && !i && this.j(s); | ||
| o && !i && this.j(e); | ||
| } | ||
| j(s) { | ||
| s === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, s ?? ""); | ||
| j(e) { | ||
| e === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? ""); | ||
| } | ||
@@ -458,4 +458,4 @@ }, Dt = class extends H { | ||
| } | ||
| j(s) { | ||
| this.element[this.name] = s === d ? void 0 : s; | ||
| j(e) { | ||
| this.element[this.name] = e === d ? void 0 : e; | ||
| } | ||
@@ -466,20 +466,20 @@ }, Lt = class extends H { | ||
| } | ||
| j(s) { | ||
| this.element.toggleAttribute(this.name, !!s && s !== d); | ||
| j(e) { | ||
| this.element.toggleAttribute(this.name, !!e && e !== d); | ||
| } | ||
| }, jt = class extends H { | ||
| constructor(s, t, e, i, r) { | ||
| super(s, t, e, i, r), this.type = 5; | ||
| constructor(e, t, s, i, r) { | ||
| super(e, t, s, i, r), this.type = 5; | ||
| } | ||
| _$AI(s, t = this) { | ||
| if ((s = v(this, s, t, 0) ?? d) === A) return; | ||
| let e = this._$AH, i = s === d && e !== d || s.capture !== e.capture || s.once !== e.once || s.passive !== e.passive, r = s !== d && (e === d || i); | ||
| i && this.element.removeEventListener(this.name, this, e), r && this.element.addEventListener(this.name, this, s), this._$AH = s; | ||
| _$AI(e, t = this) { | ||
| if ((e = b(this, e, t, 0) ?? d) === A) return; | ||
| let s = this._$AH, i = e === d && s !== d || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, r = e !== d && (s === d || i); | ||
| i && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, e), this._$AH = e; | ||
| } | ||
| handleEvent(s) { | ||
| typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, s) : this._$AH.handleEvent(s); | ||
| handleEvent(e) { | ||
| typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e); | ||
| } | ||
| }, zt = class { | ||
| constructor(s, t, e) { | ||
| this.element = s, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = e; | ||
| constructor(e, t, s) { | ||
| this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s; | ||
| } | ||
@@ -489,14 +489,14 @@ get _$AU() { | ||
| } | ||
| _$AI(s) { | ||
| v(this, s); | ||
| _$AI(e) { | ||
| b(this, e); | ||
| } | ||
| }, It = B.litHtmlPolyfillSupport; | ||
| It?.(I, W), (B.litHtmlVersions ??= []).push("3.3.2"); | ||
| var Ft = (s, t, e) => { | ||
| let i = e?.renderBefore ?? t, r = i._$litPart$; | ||
| var qt = (e, t, s) => { | ||
| let i = s?.renderBefore ?? t, r = i._$litPart$; | ||
| if (r === void 0) { | ||
| let o = e?.renderBefore ?? null; | ||
| i._$litPart$ = r = new W(t.insertBefore(P(), o), o, void 0, e ?? {}); | ||
| let o = s?.renderBefore ?? null; | ||
| i._$litPart$ = r = new W(t.insertBefore(P(), o), o, void 0, s ?? {}); | ||
| } | ||
| return r._$AI(s), r; | ||
| return r._$AI(e), r; | ||
| }, J = globalThis, w = class extends g { | ||
@@ -507,8 +507,8 @@ constructor() { | ||
| createRenderRoot() { | ||
| let s = super.createRenderRoot(); | ||
| return this.renderOptions.renderBefore ??= s.firstChild, s; | ||
| let e = super.createRenderRoot(); | ||
| return this.renderOptions.renderBefore ??= e.firstChild, e; | ||
| } | ||
| update(s) { | ||
| update(e) { | ||
| let t = this.render(); | ||
| this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(s), this._$Do = Ft(t, this.renderRoot, this.renderOptions); | ||
| this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = qt(t, this.renderRoot, this.renderOptions); | ||
| } | ||
@@ -526,8 +526,8 @@ connectedCallback() { | ||
| w._$litElement$ = !0, w.finalized = !0, J.litElementHydrateSupport?.({ LitElement: w }); | ||
| var qt = J.litElementPolyfillSupport; | ||
| qt?.({ LitElement: w }), (J.litElementVersions ??= []).push("4.2.2"); | ||
| var Ft = J.litElementPolyfillSupport; | ||
| Ft?.({ LitElement: w }), (J.litElementVersions ??= []).push("4.2.2"); | ||
| var c = []; | ||
| for (let s = 0; s < 256; ++s) c.push((s + 256).toString(16).slice(1)); | ||
| function Bt(s, t = 0) { | ||
| return (c[s[t + 0]] + c[s[t + 1]] + c[s[t + 2]] + c[s[t + 3]] + "-" + c[s[t + 4]] + c[s[t + 5]] + "-" + c[s[t + 6]] + c[s[t + 7]] + "-" + c[s[t + 8]] + c[s[t + 9]] + "-" + c[s[t + 10]] + c[s[t + 11]] + c[s[t + 12]] + c[s[t + 13]] + c[s[t + 14]] + c[s[t + 15]]).toLowerCase(); | ||
| for (let e = 0; e < 256; ++e) c.push((e + 256).toString(16).slice(1)); | ||
| function Bt(e, t = 0) { | ||
| return (c[e[t + 0]] + c[e[t + 1]] + c[e[t + 2]] + c[e[t + 3]] + "-" + c[e[t + 4]] + c[e[t + 5]] + "-" + c[e[t + 6]] + c[e[t + 7]] + "-" + c[e[t + 8]] + c[e[t + 9]] + "-" + c[e[t + 10]] + c[e[t + 11]] + c[e[t + 12]] + c[e[t + 13]] + c[e[t + 14]] + c[e[t + 15]]).toLowerCase(); | ||
| } | ||
@@ -543,13 +543,13 @@ var j, Vt = new Uint8Array(16); | ||
| var ht = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) }; | ||
| function Jt(s, t, e) { | ||
| s ||= {}; | ||
| let i = s.random ?? s.rng?.() ?? Wt(); | ||
| function Jt(e, t, s) { | ||
| e ||= {}; | ||
| let i = e.random ?? e.rng?.() ?? Wt(); | ||
| if (i.length < 16) throw Error("Random bytes length must be >= 16"); | ||
| return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Bt(i); | ||
| } | ||
| function Kt(s, t, e) { | ||
| return ht.randomUUID && !t && !s ? ht.randomUUID() : Jt(s, t); | ||
| function Kt(e, t, s) { | ||
| return ht.randomUUID && !t && !e ? ht.randomUUID() : Jt(e, t); | ||
| } | ||
| function Zt(s = "hp") { | ||
| return `${s}-${Kt()}`; | ||
| function Zt(e = "hp") { | ||
| return `${e}-${Kt()}`; | ||
| } | ||
@@ -560,4 +560,4 @@ var Gt = class extends w { | ||
| } | ||
| emit(s, t) { | ||
| let e = new CustomEvent(`hp-${s}`, { | ||
| emit(e, t) { | ||
| let s = new CustomEvent(`hp-${e}`, { | ||
| detail: t, | ||
@@ -568,3 +568,3 @@ bubbles: !0, | ||
| }); | ||
| return this.dispatchEvent(e), e; | ||
| return this.dispatchEvent(s), s; | ||
| } | ||
@@ -575,6 +575,16 @@ _hpId = Zt(); | ||
| } | ||
| _abortController = null; | ||
| get signal() { | ||
| return (!this._abortController || this._abortController.signal.aborted) && (this._abortController = new AbortController()), this._abortController.signal; | ||
| } | ||
| connectedCallback() { | ||
| super.connectedCallback(), (!this._abortController || this._abortController.signal.aborted) && (this._abortController = new AbortController()); | ||
| } | ||
| disconnectedCallback() { | ||
| super.disconnectedCallback(), this._abortController?.abort(), this._abortController = null; | ||
| } | ||
| }; | ||
| function Qt(s) { | ||
| function Qt(e) { | ||
| return function(t) { | ||
| typeof window < "u" && (customElements.get(s) || customElements.define(s, t)); | ||
| typeof window < "u" && (customElements.get(e) || customElements.define(e, t)); | ||
| }; | ||
@@ -589,12 +599,12 @@ } | ||
| let Xt = class { | ||
| constructor(t, e, i) { | ||
| constructor(t, s, i) { | ||
| if (this._$cssResult$ = !0, i !== At) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); | ||
| this.cssText = t, this.t = e; | ||
| this.cssText = t, this.t = s; | ||
| } | ||
| get styleSheet() { | ||
| let t = this.o; | ||
| const e = this.t; | ||
| const s = this.t; | ||
| if (K && t === void 0) { | ||
| const i = e !== void 0 && e.length === 1; | ||
| i && (t = at.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && at.set(e, t)); | ||
| const i = s !== void 0 && s.length === 1; | ||
| i && (t = at.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && at.set(s, t)); | ||
| } | ||
@@ -607,13 +617,13 @@ return t; | ||
| }; | ||
| const Yt = (s) => new Xt(typeof s == "string" ? s : s + "", void 0, At), te = (s, t) => { | ||
| if (K) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); | ||
| else for (const e of t) { | ||
| const Yt = (e) => new Xt(typeof e == "string" ? e : e + "", void 0, At), te = (e, t) => { | ||
| if (K) e.adoptedStyleSheets = t.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet); | ||
| else for (const s of t) { | ||
| const i = document.createElement("style"), r = x.litNonce; | ||
| r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i); | ||
| r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, e.appendChild(i); | ||
| } | ||
| }, lt = K ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => { | ||
| let e = ""; | ||
| for (const i of t.cssRules) e += i.cssText; | ||
| return Yt(e); | ||
| })(s) : s; | ||
| }, lt = K ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => { | ||
| let s = ""; | ||
| for (const i of t.cssRules) s += i.cssText; | ||
| return Yt(s); | ||
| })(e) : e; | ||
| /** | ||
@@ -624,20 +634,20 @@ * @license | ||
| */ | ||
| const { is: ee, defineProperty: se, getOwnPropertyDescriptor: ie, getOwnPropertyNames: re, getOwnPropertySymbols: oe, getPrototypeOf: ne } = Object, D = globalThis, dt = D.trustedTypes, he = dt ? dt.emptyScript : "", ae = D.reactiveElementPolyfillSupport, C = (s, t) => s, k = { toAttribute(s, t) { | ||
| const { is: ee, defineProperty: se, getOwnPropertyDescriptor: ie, getOwnPropertyNames: re, getOwnPropertySymbols: oe, getPrototypeOf: ne } = Object, D = globalThis, dt = D.trustedTypes, he = dt ? dt.emptyScript : "", ae = D.reactiveElementPolyfillSupport, C = (e, t) => e, k = { toAttribute(e, t) { | ||
| switch (t) { | ||
| case Boolean: | ||
| s = s ? he : null; | ||
| e = e ? he : null; | ||
| break; | ||
| case Object: | ||
| case Array: | ||
| s = s == null ? s : JSON.stringify(s); | ||
| e = e == null ? e : JSON.stringify(e); | ||
| } | ||
| return s; | ||
| }, fromAttribute(s, t) { | ||
| let e = s; | ||
| return e; | ||
| }, fromAttribute(e, t) { | ||
| let s = e; | ||
| switch (t) { | ||
| case Boolean: | ||
| e = s !== null; | ||
| s = e !== null; | ||
| break; | ||
| case Number: | ||
| e = s === null ? null : Number(s); | ||
| s = e === null ? null : Number(e); | ||
| break; | ||
@@ -647,11 +657,11 @@ case Object: | ||
| try { | ||
| e = JSON.parse(s); | ||
| s = JSON.parse(e); | ||
| } catch { | ||
| e = null; | ||
| s = null; | ||
| } | ||
| } | ||
| return e; | ||
| } }, Z = (s, t) => !ee(s, t), ct = { attribute: !0, type: String, converter: k, reflect: !1, useDefault: !1, hasChanged: Z }; | ||
| return s; | ||
| } }, Z = (e, t) => !ee(e, t), ct = { attribute: !0, type: String, converter: k, reflect: !1, useDefault: !1, hasChanged: Z }; | ||
| Symbol.metadata ??= Symbol("metadata"), D.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); | ||
| class b extends HTMLElement { | ||
| class E extends HTMLElement { | ||
| static addInitializer(t) { | ||
@@ -663,13 +673,13 @@ this._$Ei(), (this.l ??= []).push(t); | ||
| } | ||
| static createProperty(t, e = ct) { | ||
| if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) { | ||
| const i = Symbol(), r = this.getPropertyDescriptor(t, i, e); | ||
| static createProperty(t, s = ct) { | ||
| if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(t, s), !s.noAccessor) { | ||
| const i = Symbol(), r = this.getPropertyDescriptor(t, i, s); | ||
| r !== void 0 && se(this.prototype, t, r); | ||
| } | ||
| } | ||
| static getPropertyDescriptor(t, e, i) { | ||
| static getPropertyDescriptor(t, s, i) { | ||
| const { get: r, set: o } = ie(this.prototype, t) ?? { get() { | ||
| return this[e]; | ||
| return this[s]; | ||
| }, set(n) { | ||
| this[e] = n; | ||
| this[s] = n; | ||
| } }; | ||
@@ -692,14 +702,14 @@ return { get: r, set(n) { | ||
| if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(C("properties"))) { | ||
| const e = this.properties, i = [...re(e), ...oe(e)]; | ||
| for (const r of i) this.createProperty(r, e[r]); | ||
| const s = this.properties, i = [...re(s), ...oe(s)]; | ||
| for (const r of i) this.createProperty(r, s[r]); | ||
| } | ||
| const t = this[Symbol.metadata]; | ||
| if (t !== null) { | ||
| const e = litPropertyMetadata.get(t); | ||
| if (e !== void 0) for (const [i, r] of e) this.elementProperties.set(i, r); | ||
| const s = litPropertyMetadata.get(t); | ||
| if (s !== void 0) for (const [i, r] of s) this.elementProperties.set(i, r); | ||
| } | ||
| this._$Eh = /* @__PURE__ */ new Map(); | ||
| for (const [e, i] of this.elementProperties) { | ||
| const r = this._$Eu(e, i); | ||
| r !== void 0 && this._$Eh.set(r, e); | ||
| for (const [s, i] of this.elementProperties) { | ||
| const r = this._$Eu(s, i); | ||
| r !== void 0 && this._$Eh.set(r, s); | ||
| } | ||
@@ -709,11 +719,11 @@ this.elementStyles = this.finalizeStyles(this.styles); | ||
| static finalizeStyles(t) { | ||
| const e = []; | ||
| const s = []; | ||
| if (Array.isArray(t)) { | ||
| const i = new Set(t.flat(1 / 0).reverse()); | ||
| for (const r of i) e.unshift(lt(r)); | ||
| } else t !== void 0 && e.push(lt(t)); | ||
| return e; | ||
| for (const r of i) s.unshift(lt(r)); | ||
| } else t !== void 0 && s.push(lt(t)); | ||
| return s; | ||
| } | ||
| static _$Eu(t, e) { | ||
| const i = e.attribute; | ||
| static _$Eu(t, s) { | ||
| const i = s.attribute; | ||
| return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0; | ||
@@ -734,4 +744,4 @@ } | ||
| _$E_() { | ||
| const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties; | ||
| for (const i of e.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]); | ||
| const t = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties; | ||
| for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]); | ||
| t.size > 0 && (this._$Ep = t); | ||
@@ -751,13 +761,13 @@ } | ||
| } | ||
| attributeChangedCallback(t, e, i) { | ||
| attributeChangedCallback(t, s, i) { | ||
| this._$AK(t, i); | ||
| } | ||
| _$ET(t, e) { | ||
| _$ET(t, s) { | ||
| const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i); | ||
| if (r !== void 0 && i.reflect === !0) { | ||
| const o = (i.converter?.toAttribute !== void 0 ? i.converter : k).toAttribute(e, i.type); | ||
| const o = (i.converter?.toAttribute !== void 0 ? i.converter : k).toAttribute(s, i.type); | ||
| this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null; | ||
| } | ||
| } | ||
| _$AK(t, e) { | ||
| _$AK(t, s) { | ||
| const i = this.constructor, r = i._$Eh.get(t); | ||
@@ -767,16 +777,16 @@ if (r !== void 0 && this._$Em !== r) { | ||
| this._$Em = r; | ||
| const h = n.fromAttribute(e, o.type); | ||
| const h = n.fromAttribute(s, o.type); | ||
| this[r] = h ?? this._$Ej?.get(r) ?? h, this._$Em = null; | ||
| } | ||
| } | ||
| requestUpdate(t, e, i, r = !1, o) { | ||
| requestUpdate(t, s, i, r = !1, o) { | ||
| if (t !== void 0) { | ||
| const n = this.constructor; | ||
| if (r === !1 && (o = this[t]), i ??= n.getPropertyOptions(t), !((i.hasChanged ?? Z)(o, e) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(n._$Eu(t, i)))) return; | ||
| this.C(t, e, i); | ||
| if (r === !1 && (o = this[t]), i ??= n.getPropertyOptions(t), !((i.hasChanged ?? Z)(o, s) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(n._$Eu(t, i)))) return; | ||
| this.C(t, s, i); | ||
| } | ||
| this.isUpdatePending === !1 && (this._$ES = this._$EP()); | ||
| } | ||
| C(t, e, { useDefault: i, reflect: r, wrapped: o }, n) { | ||
| i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t)); | ||
| C(t, s, { useDefault: i, reflect: r, wrapped: o }, n) { | ||
| i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? s ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t)); | ||
| } | ||
@@ -787,4 +797,4 @@ async _$EP() { | ||
| await this._$ES; | ||
| } catch (e) { | ||
| Promise.reject(e); | ||
| } catch (s) { | ||
| Promise.reject(s); | ||
| } | ||
@@ -811,9 +821,9 @@ const t = this.scheduleUpdate(); | ||
| let t = !1; | ||
| const e = this._$AL; | ||
| const s = this._$AL; | ||
| try { | ||
| t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(e)) : this._$EM(); | ||
| t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(s)) : this._$EM(); | ||
| } catch (i) { | ||
| throw t = !1, this._$EM(), i; | ||
| } | ||
| t && this._$AE(e); | ||
| t && this._$AE(s); | ||
| } | ||
@@ -823,3 +833,3 @@ willUpdate(t) { | ||
| _$AE(t) { | ||
| this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); | ||
| this._$EO?.forEach((s) => s.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); | ||
| } | ||
@@ -839,3 +849,3 @@ _$EM() { | ||
| update(t) { | ||
| this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM(); | ||
| this._$Eq &&= this._$Eq.forEach((s) => this._$ET(s, this[s])), this._$EM(); | ||
| } | ||
@@ -847,3 +857,3 @@ updated(t) { | ||
| } | ||
| b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[C("elementProperties")] = /* @__PURE__ */ new Map(), b[C("finalized")] = /* @__PURE__ */ new Map(), ae?.({ ReactiveElement: b }), (D.reactiveElementVersions ??= []).push("2.1.2"); | ||
| E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[C("elementProperties")] = /* @__PURE__ */ new Map(), E[C("finalized")] = /* @__PURE__ */ new Map(), ae?.({ ReactiveElement: E }), (D.reactiveElementVersions ??= []).push("2.1.2"); | ||
| /** | ||
@@ -854,19 +864,19 @@ * @license | ||
| */ | ||
| const le = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: Z }, de = (s = le, t, e) => { | ||
| const { kind: i, metadata: r } = e; | ||
| const le = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: Z }, de = (e = le, t, s) => { | ||
| const { kind: i, metadata: r } = s; | ||
| let o = globalThis.litPropertyMetadata.get(r); | ||
| if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), o.set(e.name, s), i === "accessor") { | ||
| const { name: n } = e; | ||
| if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((e = Object.create(e)).wrapped = !0), o.set(s.name, e), i === "accessor") { | ||
| const { name: n } = s; | ||
| return { set(h) { | ||
| const a = t.get.call(this); | ||
| t.set.call(this, h), this.requestUpdate(n, a, s, !0, h); | ||
| t.set.call(this, h), this.requestUpdate(n, a, e, !0, h); | ||
| }, init(h) { | ||
| return h !== void 0 && this.C(n, void 0, s, h), h; | ||
| return h !== void 0 && this.C(n, void 0, e, h), h; | ||
| } }; | ||
| } | ||
| if (i === "setter") { | ||
| const { name: n } = e; | ||
| const { name: n } = s; | ||
| return function(h) { | ||
| const a = this[n]; | ||
| t.call(this, h), this.requestUpdate(n, a, s, !0, h); | ||
| t.call(this, h), this.requestUpdate(n, a, e, !0, h); | ||
| }; | ||
@@ -876,20 +886,20 @@ } | ||
| }; | ||
| function ce(s) { | ||
| return (t, e) => typeof e == "object" ? de(s, t, e) : ((i, r, o) => { | ||
| function ce(e) { | ||
| return (t, s) => typeof s == "object" ? de(e, t, s) : ((i, r, o) => { | ||
| const n = r.hasOwnProperty(o); | ||
| return r.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(r, o) : void 0; | ||
| })(s, t, e); | ||
| })(e, t, s); | ||
| } | ||
| var pe = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, vt = (s, t, e, i) => { | ||
| for (var r = i > 1 ? void 0 : i ? ue(t, e) : t, o = s.length - 1, n; o >= 0; o--) | ||
| (n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r); | ||
| return i && r && pe(t, e, r), r; | ||
| var pe = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, bt = (e, t, s, i) => { | ||
| for (var r = i > 1 ? void 0 : i ? ue(t, s) : t, o = e.length - 1, n; o >= 0; o--) | ||
| (n = e[o]) && (r = (i ? n(t, s, r) : n(r)) || r); | ||
| return i && r && pe(t, s, r), r; | ||
| }; | ||
| let F = class extends Gt { | ||
| let q = class extends Gt { | ||
| get htmlFor() { | ||
| return this._htmlFor; | ||
| } | ||
| set htmlFor(s) { | ||
| set htmlFor(e) { | ||
| const t = this._htmlFor; | ||
| this._htmlFor = s, this.requestUpdate("htmlFor", t), this.isConnected && this._updateAriaLink(); | ||
| this._htmlFor = e, this.requestUpdate("htmlFor", t), this.isConnected && this._updateAriaLink(); | ||
| } | ||
@@ -899,36 +909,32 @@ _htmlFor = null; | ||
| super.connectedCallback(), this.setAttribute("data-hp-component", "label"); | ||
| const s = this.getAttribute("for"); | ||
| s && (this._htmlFor = s), this.addEventListener("click", this._handleClick), this.addEventListener("mousedown", this._handleMouseDown), requestAnimationFrame(() => this._updateAriaLink()); | ||
| const e = this.getAttribute("for"); | ||
| e && (this._htmlFor = e), this.addEventListener("click", this._handleClick, { signal: this.signal }), this.addEventListener("mousedown", this._handleMouseDown, { signal: this.signal }), this._updateAriaLink(), requestAnimationFrame(() => { | ||
| requestAnimationFrame(() => this._updateAriaLink()); | ||
| }); | ||
| } | ||
| disconnectedCallback() { | ||
| super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this.removeEventListener("mousedown", this._handleMouseDown); | ||
| attributeChangedCallback(e, t, s) { | ||
| super.attributeChangedCallback(e, t, s), e === "for" && t !== s && this.isConnected && (this._htmlFor = s, this._updateAriaLink()); | ||
| } | ||
| updated(s) { | ||
| s.has("htmlFor") && this._updateAriaLink(); | ||
| } | ||
| attributeChangedCallback(s, t, e) { | ||
| super.attributeChangedCallback(s, t, e), s === "for" && t !== e && this.isConnected && (this._htmlFor = e, this._updateAriaLink()); | ||
| } | ||
| _handleClick = (s) => { | ||
| _handleClick = (e) => { | ||
| if (!this.htmlFor) return; | ||
| const t = document.getElementById(this.htmlFor); | ||
| t && (t.focus(), t !== s.target && t.click()); | ||
| t && (t.focus(), t !== e.target && t.click()); | ||
| }; | ||
| _handleMouseDown = (s) => { | ||
| s.detail > 1 && s.preventDefault(); | ||
| _handleMouseDown = (e) => { | ||
| e.detail > 1 && e.preventDefault(); | ||
| }; | ||
| _updateAriaLink() { | ||
| if (!this.htmlFor) return; | ||
| const s = document.getElementById(this.htmlFor); | ||
| s && (this.id || (this.id = `hp-label-${this.hpId}`), s.setAttribute("aria-labelledby", this.id)); | ||
| const e = document.getElementById(this.htmlFor); | ||
| e && (this.id || (this.id = `hp-label-${this.hpId}`), e.setAttribute("aria-labelledby", this.id)); | ||
| } | ||
| }; | ||
| vt([ | ||
| bt([ | ||
| ce({ type: String, reflect: !0, attribute: "for" }) | ||
| ], F.prototype, "htmlFor", 1); | ||
| F = vt([ | ||
| ], q.prototype, "htmlFor", 1); | ||
| q = bt([ | ||
| Qt("hp-label") | ||
| ], F); | ||
| ], q); | ||
| export { | ||
| F as HeadlessLabel | ||
| q as HeadlessLabel | ||
| }; |
@@ -1,15 +0,15 @@ | ||
| (function(u,$){typeof exports=="object"&&typeof module<"u"?$(exports):typeof define=="function"&&define.amd?define(["exports"],$):(u=typeof globalThis<"u"?globalThis:u||self,$(u.HeadlessPrimitivesSwitch={}))})(this,function(u){"use strict";var $=globalThis,j=$.ShadowRoot&&($.ShadyCSS===void 0||$.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,G=Symbol(),Q=new WeakMap,Et=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==G)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(j&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=Q.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Q.set(e,t))}return t}toString(){return this.cssText}},bt=s=>new Et(typeof s=="string"?s:s+"",void 0,G),St=(s,t)=>{if(j)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),r=$.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},X=j?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return bt(e)})(s):s,{is:wt,defineProperty:Pt,getOwnPropertyDescriptor:Ct,getOwnPropertyNames:Ut,getOwnPropertySymbols:Ot,getPrototypeOf:Mt}=Object,R=globalThis,Y=R.trustedTypes,Rt=Y?Y.emptyScript:"",Tt=R.reactiveElementPolyfillSupport,S=(s,t)=>s,z={toAttribute(s,t){switch(t){case Boolean:s=s?Rt:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},tt=(s,t)=>!wt(s,t),et={attribute:!0,type:String,converter:z,reflect:!1,useDefault:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),R.litPropertyMetadata??=new WeakMap;var v=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=et){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&Pt(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:o}=Ct(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:r,set(n){let h=r?.call(this);o?.call(this,n),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??et}static _$Ei(){if(this.hasOwnProperty(S("elementProperties")))return;let t=Mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(S("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(S("properties"))){let e=this.properties,i=[...Ut(e),...Ot(e)];for(let r of i)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let r of i)e.unshift(X(r))}else t!==void 0&&e.push(X(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return St(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){let o=(i.converter?.toAttribute===void 0?z:i.converter).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){let i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let o=i.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute===void 0?z:o.converter;this._$Em=r;let h=n.fromAttribute(e,o.type);this[r]=h??this._$Ej?.get(r)??h,this._$Em=null}}requestUpdate(t,e,i,r=!1,o){if(t!==void 0){let n=this.constructor;if(r===!1&&(o=this[t]),i??=n.getPropertyOptions(t),!((i.hasChanged??tt)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,o]of i){let{wrapped:n}=o,h=this[r];n!==!0||this._$AL.has(r)||h===void 0||this.C(r,void 0,o,h)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[S("elementProperties")]=new Map,v[S("finalized")]=new Map,Tt?.({ReactiveElement:v}),(R.reactiveElementVersions??=[]).push("2.1.2");var I=globalThis,st=s=>s,T=I.trustedTypes,it=T?T.createPolicy("lit-html",{createHTML:s=>s}):void 0,rt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,ot="?"+_,xt=`<${ot}>`,y=document,w=()=>y.createComment(""),P=s=>s===null||typeof s!="object"&&typeof s!="function",F=Array.isArray,Ht=s=>F(s)||typeof s?.[Symbol.iterator]=="function",q=`[ | ||
| \f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,ht=/>/g,g=RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^ | ||
| \f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,lt=/"/g,dt=/^(?:script|style|textarea|title)$/i,E=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),ct=new WeakMap,A=y.createTreeWalker(y,129);function pt(s,t){if(!F(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return it===void 0?t:it.createHTML(t)}var kt=(s,t)=>{let e=s.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",n=C;for(let h=0;h<e;h++){let a=s[h],N,p,l=-1,f=0;for(;f<a.length&&(n.lastIndex=f,p=n.exec(a),p!==null);)f=n.lastIndex,n===C?p[1]==="!--"?n=nt:p[1]===void 0?p[2]===void 0?p[3]!==void 0&&(n=g):(dt.test(p[2])&&(r=RegExp("</"+p[2],"g")),n=g):n=ht:n===g?p[0]===">"?(n=r??C,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,N=p[1],n=p[3]===void 0?g:p[3]==='"'?lt:at):n===lt||n===at?n=g:n===nt||n===ht?n=C:(n=g,r=void 0);let m=n===g&&s[h+1].startsWith("/>")?" ":"";o+=n===C?a+xt:l>=0?(i.push(N),a.slice(0,l)+rt+a.slice(l)+_+m):a+_+(l===-2?h:m)}return[pt(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},B=class At{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[N,p]=kt(t,e);if(this.el=At.createElement(N,i),A.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(r=A.nextNode())!==null&&a.length<h;){if(r.nodeType===1){if(r.hasAttributes())for(let l of r.getAttributeNames())if(l.endsWith(rt)){let f=p[n++],m=r.getAttribute(l).split(_),D=/([.?@])?(.*)/.exec(f);a.push({type:1,index:o,name:D[2],strings:m,ctor:D[1]==="."?Nt:D[1]==="?"?Dt:D[1]==="@"?jt:x}),r.removeAttribute(l)}else l.startsWith(_)&&(a.push({type:6,index:o}),r.removeAttribute(l));if(dt.test(r.tagName)){let l=r.textContent.split(_),f=l.length-1;if(f>0){r.textContent=T?T.emptyScript:"";for(let m=0;m<f;m++)r.append(l[m],w()),A.nextNode(),a.push({type:2,index:++o});r.append(l[f],w())}}}else if(r.nodeType===8)if(r.data===ot)a.push({type:2,index:o});else{let l=-1;for(;(l=r.data.indexOf(_,l+1))!==-1;)a.push({type:7,index:o}),l+=_.length-1}o++}}static createElement(t,e){let i=y.createElement("template");return i.innerHTML=t,i}};function b(s,t,e=s,i){if(t===E)return t;let r=i===void 0?e._$Cl:e._$Co?.[i],o=P(t)?void 0:t._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(s),r._$AT(s,e,i)),i===void 0?e._$Cl=r:(e._$Co??=[])[i]=r),r!==void 0&&(t=b(s,r._$AS(s,t.values),r,i)),t}var Lt=class{constructor(s,t){this._$AV=[],this._$AN=void 0,this._$AD=s,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(s){let{el:{content:t},parts:e}=this._$AD,i=(s?.creationScope??y).importNode(t,!0);A.currentNode=i;let r=A.nextNode(),o=0,n=0,h=e[0];for(;h!==void 0;){if(o===h.index){let a;h.type===2?a=new V(r,r.nextSibling,this,s):h.type===1?a=new h.ctor(r,h.name,h.strings,this,s):h.type===6&&(a=new zt(r,this,s)),this._$AV.push(a),h=e[++n]}o!==h?.index&&(r=A.nextNode(),o++)}return A.currentNode=y,i}p(s){let t=0;for(let e of this._$AV)e!==void 0&&(e.strings===void 0?e._$AI(s[t]):(e._$AI(s,e,t),t+=e.strings.length-2)),t++}},V=class vt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=b(this,t,e),P(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==E&&this._(t):t._$litType$===void 0?t.nodeType===void 0?Ht(t)?this.k(t):this._(t):this.T(t):this.$(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&P(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=B.createElement(pt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{let o=new Lt(r,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=ct.get(t.strings);return e===void 0&&ct.set(t.strings,e=new B(t)),e}k(t){F(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,r=0;for(let o of t)r===e.length?e.push(i=new vt(this.O(w()),this.O(w()),this,this.options)):i=e[r],i._$AI(o),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let i=st(t).nextSibling;st(t).remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},x=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(s,t,e,i,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=s,this.name=t,this._$AM=i,this.options=r,e.length>2||e[0]!==""||e[1]!==""?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=d}_$AI(s,t=this,e,i){let r=this.strings,o=!1;if(r===void 0)s=b(this,s,t,0),o=!P(s)||s!==this._$AH&&s!==E,o&&(this._$AH=s);else{let n=s,h,a;for(s=r[0],h=0;h<r.length-1;h++)a=b(this,n[e+h],t,h),a===E&&(a=this._$AH[h]),o||=!P(a)||a!==this._$AH[h],a===d?s=d:s!==d&&(s+=(a??"")+r[h+1]),this._$AH[h]=a}o&&!i&&this.j(s)}j(s){s===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,s??"")}},Nt=class extends x{constructor(){super(...arguments),this.type=3}j(s){this.element[this.name]=s===d?void 0:s}},Dt=class extends x{constructor(){super(...arguments),this.type=4}j(s){this.element.toggleAttribute(this.name,!!s&&s!==d)}},jt=class extends x{constructor(s,t,e,i,r){super(s,t,e,i,r),this.type=5}_$AI(s,t=this){if((s=b(this,s,t,0)??d)===E)return;let e=this._$AH,i=s===d&&e!==d||s.capture!==e.capture||s.once!==e.once||s.passive!==e.passive,r=s!==d&&(e===d||i);i&&this.element.removeEventListener(this.name,this,e),r&&this.element.addEventListener(this.name,this,s),this._$AH=s}handleEvent(s){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,s):this._$AH.handleEvent(s)}},zt=class{constructor(s,t,e){this.element=s,this.type=6,this._$AN=void 0,this._$AM=t,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(s){b(this,s)}},It=I.litHtmlPolyfillSupport;It?.(B,V),(I.litHtmlVersions??=[]).push("3.3.2");var Ft=(s,t,e)=>{let i=e?.renderBefore??t,r=i._$litPart$;if(r===void 0){let o=e?.renderBefore??null;i._$litPart$=r=new V(t.insertBefore(w(),o),o,void 0,e??{})}return r._$AI(s),r},W=globalThis,U=class extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let s=super.createRenderRoot();return this.renderOptions.renderBefore??=s.firstChild,s}update(s){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(s),this._$Do=Ft(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return E}};U._$litElement$=!0,U.finalized=!0,W.litElementHydrateSupport?.({LitElement:U});var qt=W.litElementPolyfillSupport;qt?.({LitElement:U}),(W.litElementVersions??=[]).push("4.2.2");var c=[];for(let s=0;s<256;++s)c.push((s+256).toString(16).slice(1));function Bt(s,t=0){return(c[s[t+0]]+c[s[t+1]]+c[s[t+2]]+c[s[t+3]]+"-"+c[s[t+4]]+c[s[t+5]]+"-"+c[s[t+6]]+c[s[t+7]]+"-"+c[s[t+8]]+c[s[t+9]]+"-"+c[s[t+10]]+c[s[t+11]]+c[s[t+12]]+c[s[t+13]]+c[s[t+14]]+c[s[t+15]]).toLowerCase()}var J,Vt=new Uint8Array(16);function Wt(){if(!J){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");J=crypto.getRandomValues.bind(crypto)}return J(Vt)}var ut={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Jt(s,t,e){s||={};let i=s.random??s.rng?.()??Wt();if(i.length<16)throw Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Bt(i)}function Kt(s,t,e){return ut.randomUUID&&!t&&!s?ut.randomUUID():Jt(s,t)}function Zt(s="hp"){return`${s}-${Kt()}`}var Gt=class extends U{createRenderRoot(){return this}emit(s,t){let e=new CustomEvent(`hp-${s}`,{detail:t,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(e),e}_hpId=Zt();get hpId(){return this._hpId}};function Qt(s){return function(t){typeof window<"u"&&(customElements.get(s)||customElements.define(s,t))}}/** | ||
| (function(u,$){typeof exports=="object"&&typeof module<"u"?$(exports):typeof define=="function"&&define.amd?define(["exports"],$):(u=typeof globalThis<"u"?globalThis:u||self,$(u.HeadlessPrimitivesSwitch={}))})(this,function(u){"use strict";var $=globalThis,j=$.ShadowRoot&&($.ShadyCSS===void 0||$.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,G=Symbol(),Q=new WeakMap,vt=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==G)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o,s=this.t;if(j&&t===void 0){let i=s!==void 0&&s.length===1;i&&(t=Q.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Q.set(s,t))}return t}toString(){return this.cssText}},Et=e=>new vt(typeof e=="string"?e:e+"",void 0,G),St=(e,t)=>{if(j)e.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(let s of t){let i=document.createElement("style"),r=$.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=s.cssText,e.appendChild(i)}},X=j?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(let i of t.cssRules)s+=i.cssText;return Et(s)})(e):e,{is:wt,defineProperty:Ct,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:Ut,getOwnPropertySymbols:Ot,getPrototypeOf:Mt}=Object,R=globalThis,Y=R.trustedTypes,Rt=Y?Y.emptyScript:"",Tt=R.reactiveElementPolyfillSupport,S=(e,t)=>e,z={toAttribute(e,t){switch(t){case Boolean:e=e?Rt:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=e!==null;break;case Number:s=e===null?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch{s=null}}return s}},tt=(e,t)=>!wt(e,t),et={attribute:!0,type:String,converter:z,reflect:!1,useDefault:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),R.litPropertyMetadata??=new WeakMap;var b=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=et){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(e,s,t);i!==void 0&&Ct(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){let{get:i,set:r}=Pt(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:i,set(o){let n=i?.call(this);r?.call(this,o),this.requestUpdate(e,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??et}static _$Ei(){if(this.hasOwnProperty(S("elementProperties")))return;let e=Mt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(S("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(S("properties"))){let t=this.properties,s=[...Ut(t),...Ot(t)];for(let i of s)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[s,i]of t)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[t,s]of this.elementProperties){let i=this._$Eu(t,s);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let s=new Set(e.flat(1/0).reverse());for(let i of s)t.unshift(X(i))}else e!==void 0&&t.push(X(e));return t}static _$Eu(e,t){let s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return St(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){let s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute===void 0?z:s.converter).toAttribute(t,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,t){let s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute===void 0?z:r.converter;this._$Em=i;let n=o.fromAttribute(t,r.type);this[i]=n??this._$Ej?.get(i)??n,this._$Em=null}}requestUpdate(e,t,s,i=!1,r){if(e!==void 0){let o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??tt)(r,t)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s){let{wrapped:o}=r,n=this[i];o!==!0||this._$AL.has(i)||n===void 0||this.C(i,void 0,r,n)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[S("elementProperties")]=new Map,b[S("finalized")]=new Map,Tt?.({ReactiveElement:b}),(R.reactiveElementVersions??=[]).push("2.1.2");var I=globalThis,st=e=>e,T=I.trustedTypes,it=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,rt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,ot="?"+_,xt=`<${ot}>`,y=document,w=()=>y.createComment(""),C=e=>e===null||typeof e!="object"&&typeof e!="function",q=Array.isArray,Ht=e=>q(e)||typeof e?.[Symbol.iterator]=="function",F=`[ | ||
| \f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,ht=/>/g,g=RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ | ||
| \f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,lt=/"/g,dt=/^(?:script|style|textarea|title)$/i,v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),ct=new WeakMap,A=y.createTreeWalker(y,129);function pt(e,t){if(!q(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return it===void 0?t:it.createHTML(t)}var kt=(e,t)=>{let s=e.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",n=P;for(let h=0;h<s;h++){let a=e[h],L,p,l=-1,f=0;for(;f<a.length&&(n.lastIndex=f,p=n.exec(a),p!==null);)f=n.lastIndex,n===P?p[1]==="!--"?n=nt:p[1]===void 0?p[2]===void 0?p[3]!==void 0&&(n=g):(dt.test(p[2])&&(r=RegExp("</"+p[2],"g")),n=g):n=ht:n===g?p[0]===">"?(n=r??P,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,L=p[1],n=p[3]===void 0?g:p[3]==='"'?lt:at):n===lt||n===at?n=g:n===nt||n===ht?n=P:(n=g,r=void 0);let m=n===g&&e[h+1].startsWith("/>")?" ":"";o+=n===P?a+xt:l>=0?(i.push(L),a.slice(0,l)+rt+a.slice(l)+_+m):a+_+(l===-2?h:m)}return[pt(e,o+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},B=class At{constructor({strings:t,_$litType$:s},i){let r;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[L,p]=kt(t,s);if(this.el=At.createElement(L,i),A.currentNode=this.el.content,s===2||s===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(r=A.nextNode())!==null&&a.length<h;){if(r.nodeType===1){if(r.hasAttributes())for(let l of r.getAttributeNames())if(l.endsWith(rt)){let f=p[n++],m=r.getAttribute(l).split(_),D=/([.?@])?(.*)/.exec(f);a.push({type:1,index:o,name:D[2],strings:m,ctor:D[1]==="."?Lt:D[1]==="?"?Dt:D[1]==="@"?jt:x}),r.removeAttribute(l)}else l.startsWith(_)&&(a.push({type:6,index:o}),r.removeAttribute(l));if(dt.test(r.tagName)){let l=r.textContent.split(_),f=l.length-1;if(f>0){r.textContent=T?T.emptyScript:"";for(let m=0;m<f;m++)r.append(l[m],w()),A.nextNode(),a.push({type:2,index:++o});r.append(l[f],w())}}}else if(r.nodeType===8)if(r.data===ot)a.push({type:2,index:o});else{let l=-1;for(;(l=r.data.indexOf(_,l+1))!==-1;)a.push({type:7,index:o}),l+=_.length-1}o++}}static createElement(t,s){let i=y.createElement("template");return i.innerHTML=t,i}};function E(e,t,s=e,i){if(t===v)return t;let r=i===void 0?s._$Cl:s._$Co?.[i],o=C(t)?void 0:t._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(e),r._$AT(e,s,i)),i===void 0?s._$Cl=r:(s._$Co??=[])[i]=r),r!==void 0&&(t=E(e,r._$AS(e,t.values),r,i)),t}var Nt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:s}=this._$AD,i=(e?.creationScope??y).importNode(t,!0);A.currentNode=i;let r=A.nextNode(),o=0,n=0,h=s[0];for(;h!==void 0;){if(o===h.index){let a;h.type===2?a=new V(r,r.nextSibling,this,e):h.type===1?a=new h.ctor(r,h.name,h.strings,this,e):h.type===6&&(a=new zt(r,this,e)),this._$AV.push(a),h=s[++n]}o!==h?.index&&(r=A.nextNode(),o++)}return A.currentNode=y,i}p(e){let t=0;for(let s of this._$AV)s!==void 0&&(s.strings===void 0?s._$AI(e[t]):(s._$AI(e,s,t),t+=s.strings.length-2)),t++}},V=class bt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,i,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,s=this._$AM;return s!==void 0&&t?.nodeType===11&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=E(this,t,s),C(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==v&&this._(t):t._$litType$===void 0?t.nodeType===void 0?Ht(t)?this.k(t):this._(t):this.T(t):this.$(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){let{values:s,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=B.createElement(pt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(s);else{let o=new Nt(r,this),n=o.u(this.options);o.p(s),this.T(n),this._$AH=o}}_$AC(t){let s=ct.get(t.strings);return s===void 0&&ct.set(t.strings,s=new B(t)),s}k(t){q(this._$AH)||(this._$AH=[],this._$AR());let s=this._$AH,i,r=0;for(let o of t)r===s.length?s.push(i=new bt(this.O(w()),this.O(w()),this,this.options)):i=s[r],i._$AI(o),r++;r<s.length&&(this._$AR(i&&i._$AB.nextSibling,r),s.length=r)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){let i=st(t).nextSibling;st(t).remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},x=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(e,t=this,s,i){let r=this.strings,o=!1;if(r===void 0)e=E(this,e,t,0),o=!C(e)||e!==this._$AH&&e!==v,o&&(this._$AH=e);else{let n=e,h,a;for(e=r[0],h=0;h<r.length-1;h++)a=E(this,n[s+h],t,h),a===v&&(a=this._$AH[h]),o||=!C(a)||a!==this._$AH[h],a===d?e=d:e!==d&&(e+=(a??"")+r[h+1]),this._$AH[h]=a}o&&!i&&this.j(e)}j(e){e===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Lt=class extends x{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===d?void 0:e}},Dt=class extends x{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==d)}},jt=class extends x{constructor(e,t,s,i,r){super(e,t,s,i,r),this.type=5}_$AI(e,t=this){if((e=E(this,e,t,0)??d)===v)return;let s=this._$AH,i=e===d&&s!==d||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},zt=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){E(this,e)}},It=I.litHtmlPolyfillSupport;It?.(B,V),(I.litHtmlVersions??=[]).push("3.3.2");var qt=(e,t,s)=>{let i=s?.renderBefore??t,r=i._$litPart$;if(r===void 0){let o=s?.renderBefore??null;i._$litPart$=r=new V(t.insertBefore(w(),o),o,void 0,s??{})}return r._$AI(e),r},W=globalThis,U=class extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=qt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return v}};U._$litElement$=!0,U.finalized=!0,W.litElementHydrateSupport?.({LitElement:U});var Ft=W.litElementPolyfillSupport;Ft?.({LitElement:U}),(W.litElementVersions??=[]).push("4.2.2");var c=[];for(let e=0;e<256;++e)c.push((e+256).toString(16).slice(1));function Bt(e,t=0){return(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase()}var J,Vt=new Uint8Array(16);function Wt(){if(!J){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");J=crypto.getRandomValues.bind(crypto)}return J(Vt)}var ut={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Jt(e,t,s){e||={};let i=e.random??e.rng?.()??Wt();if(i.length<16)throw Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Bt(i)}function Kt(e,t,s){return ut.randomUUID&&!t&&!e?ut.randomUUID():Jt(e,t)}function Zt(e="hp"){return`${e}-${Kt()}`}var Gt=class extends U{createRenderRoot(){return this}emit(e,t){let s=new CustomEvent(`hp-${e}`,{detail:t,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(s),s}_hpId=Zt();get hpId(){return this._hpId}_abortController=null;get signal(){return(!this._abortController||this._abortController.signal.aborted)&&(this._abortController=new AbortController),this._abortController.signal}connectedCallback(){super.connectedCallback(),(!this._abortController||this._abortController.signal.aborted)&&(this._abortController=new AbortController)}disconnectedCallback(){super.disconnectedCallback(),this._abortController?.abort(),this._abortController=null}};function Qt(e){return function(t){typeof window<"u"&&(customElements.get(e)||customElements.define(e,t))}}/** | ||
| * @license | ||
| * Copyright 2019 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */const H=globalThis,K=H.ShadowRoot&&(H.ShadyCSS===void 0||H.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ft=Symbol(),$t=new WeakMap;let Xt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==ft)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(K&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=$t.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&$t.set(e,t))}return t}toString(){return this.cssText}};const Yt=s=>new Xt(typeof s=="string"?s:s+"",void 0,ft),te=(s,t)=>{if(K)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=H.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},_t=K?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return Yt(e)})(s):s;/** | ||
| */const H=globalThis,K=H.ShadowRoot&&(H.ShadyCSS===void 0||H.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ft=Symbol(),$t=new WeakMap;let Xt=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==ft)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o;const s=this.t;if(K&&t===void 0){const i=s!==void 0&&s.length===1;i&&(t=$t.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&$t.set(s,t))}return t}toString(){return this.cssText}};const Yt=e=>new Xt(typeof e=="string"?e:e+"",void 0,ft),te=(e,t)=>{if(K)e.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of t){const i=document.createElement("style"),r=H.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=s.cssText,e.appendChild(i)}},_t=K?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(const i of t.cssRules)s+=i.cssText;return Yt(s)})(e):e;/** | ||
| * @license | ||
| * Copyright 2017 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */const{is:ee,defineProperty:se,getOwnPropertyDescriptor:ie,getOwnPropertyNames:re,getOwnPropertySymbols:oe,getPrototypeOf:ne}=Object,k=globalThis,mt=k.trustedTypes,he=mt?mt.emptyScript:"",ae=k.reactiveElementPolyfillSupport,O=(s,t)=>s,L={toAttribute(s,t){switch(t){case Boolean:s=s?he:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Z=(s,t)=>!ee(s,t),yt={attribute:!0,type:String,converter:L,reflect:!1,useDefault:!1,hasChanged:Z};Symbol.metadata??=Symbol("metadata"),k.litPropertyMetadata??=new WeakMap;class M extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=yt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&se(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:o}=ie(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:r,set(n){const h=r?.call(this);o?.call(this,n),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??yt}static _$Ei(){if(this.hasOwnProperty(O("elementProperties")))return;const t=ne(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(O("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(O("properties"))){const e=this.properties,i=[...re(e),...oe(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)e.unshift(_t(r))}else t!==void 0&&e.push(_t(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return te(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const o=(i.converter?.toAttribute!==void 0?i.converter:L).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:L;this._$Em=r;const h=n.fromAttribute(e,o.type);this[r]=h??this._$Ej?.get(r)??h,this._$Em=null}}requestUpdate(t,e,i,r=!1,o){if(t!==void 0){const n=this.constructor;if(r===!1&&(o=this[t]),i??=n.getPropertyOptions(t),!((i.hasChanged??Z)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i){const{wrapped:n}=o,h=this[r];n!==!0||this._$AL.has(r)||h===void 0||this.C(r,void 0,o,h)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}}M.elementStyles=[],M.shadowRootOptions={mode:"open"},M[O("elementProperties")]=new Map,M[O("finalized")]=new Map,ae?.({ReactiveElement:M}),(k.reactiveElementVersions??=[]).push("2.1.2");/** | ||
| */const{is:ee,defineProperty:se,getOwnPropertyDescriptor:ie,getOwnPropertyNames:re,getOwnPropertySymbols:oe,getPrototypeOf:ne}=Object,k=globalThis,mt=k.trustedTypes,he=mt?mt.emptyScript:"",ae=k.reactiveElementPolyfillSupport,O=(e,t)=>e,N={toAttribute(e,t){switch(t){case Boolean:e=e?he:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=e!==null;break;case Number:s=e===null?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch{s=null}}return s}},Z=(e,t)=>!ee(e,t),yt={attribute:!0,type:String,converter:N,reflect:!1,useDefault:!1,hasChanged:Z};Symbol.metadata??=Symbol("metadata"),k.litPropertyMetadata??=new WeakMap;class M extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=yt){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);r!==void 0&&se(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:r,set:o}=ie(this.prototype,t)??{get(){return this[s]},set(n){this[s]=n}};return{get:r,set(n){const h=r?.call(this);o?.call(this,n),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??yt}static _$Ei(){if(this.hasOwnProperty(O("elementProperties")))return;const t=ne(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(O("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(O("properties"))){const s=this.properties,i=[...re(s),...oe(s)];for(const r of i)this.createProperty(r,s[r])}const t=this[Symbol.metadata];if(t!==null){const s=litPropertyMetadata.get(t);if(s!==void 0)for(const[i,r]of s)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const r=this._$Eu(s,i);r!==void 0&&this._$Eh.set(r,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)s.unshift(_t(r))}else t!==void 0&&s.push(_t(t));return s}static _$Eu(t,s){const i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return te(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const o=(i.converter?.toAttribute!==void 0?i.converter:N).toAttribute(s,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,s){const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:N;this._$Em=r;const h=n.fromAttribute(s,o.type);this[r]=h??this._$Ej?.get(r)??h,this._$Em=null}}requestUpdate(t,s,i,r=!1,o){if(t!==void 0){const n=this.constructor;if(r===!1&&(o=this[t]),i??=n.getPropertyOptions(t),!((i.hasChanged??Z)(o,s)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??s??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i){const{wrapped:n}=o,h=this[r];n!==!0||this._$AL.has(r)||h===void 0||this.C(r,void 0,o,h)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(s)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach(s=>s.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(s=>this._$ET(s,this[s])),this._$EM()}updated(t){}firstUpdated(t){}}M.elementStyles=[],M.shadowRootOptions={mode:"open"},M[O("elementProperties")]=new Map,M[O("finalized")]=new Map,ae?.({ReactiveElement:M}),(k.reactiveElementVersions??=[]).push("2.1.2");/** | ||
| * @license | ||
| * Copyright 2017 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */const le={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:Z},de=(s=le,t,e)=>{const{kind:i,metadata:r}=e;let o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(e.name,s),i==="accessor"){const{name:n}=e;return{set(h){const a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,s,!0,h)},init(h){return h!==void 0&&this.C(n,void 0,s,h),h}}}if(i==="setter"){const{name:n}=e;return function(h){const a=this[n];t.call(this,h),this.requestUpdate(n,a,s,!0,h)}}throw Error("Unsupported decorator location: "+i)};function ce(s){return(t,e)=>typeof e=="object"?de(s,t,e):((i,r,o)=>{const n=r.hasOwnProperty(o);return r.constructor.createProperty(o,i),n?Object.getOwnPropertyDescriptor(r,o):void 0})(s,t,e)}var pe=Object.defineProperty,ue=Object.getOwnPropertyDescriptor,gt=(s,t,e,i)=>{for(var r=i>1?void 0:i?ue(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&pe(t,e,r),r};u.HeadlessLabel=class extends Gt{get htmlFor(){return this._htmlFor}set htmlFor(t){const e=this._htmlFor;this._htmlFor=t,this.requestUpdate("htmlFor",e),this.isConnected&&this._updateAriaLink()}_htmlFor=null;connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","label");const t=this.getAttribute("for");t&&(this._htmlFor=t),this.addEventListener("click",this._handleClick),this.addEventListener("mousedown",this._handleMouseDown),requestAnimationFrame(()=>this._updateAriaLink())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._handleClick),this.removeEventListener("mousedown",this._handleMouseDown)}updated(t){t.has("htmlFor")&&this._updateAriaLink()}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),t==="for"&&e!==i&&this.isConnected&&(this._htmlFor=i,this._updateAriaLink())}_handleClick=t=>{if(!this.htmlFor)return;const e=document.getElementById(this.htmlFor);e&&(e.focus(),e!==t.target&&e.click())};_handleMouseDown=t=>{t.detail>1&&t.preventDefault()};_updateAriaLink(){if(!this.htmlFor)return;const t=document.getElementById(this.htmlFor);t&&(this.id||(this.id=`hp-label-${this.hpId}`),t.setAttribute("aria-labelledby",this.id))}},gt([ce({type:String,reflect:!0,attribute:"for"})],u.HeadlessLabel.prototype,"htmlFor",1),u.HeadlessLabel=gt([Qt("hp-label")],u.HeadlessLabel),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}); | ||
| */const le={attribute:!0,type:String,converter:N,reflect:!1,hasChanged:Z},de=(e=le,t,s)=>{const{kind:i,metadata:r}=s;let o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),i==="setter"&&((e=Object.create(e)).wrapped=!0),o.set(s.name,e),i==="accessor"){const{name:n}=s;return{set(h){const a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,e,!0,h)},init(h){return h!==void 0&&this.C(n,void 0,e,h),h}}}if(i==="setter"){const{name:n}=s;return function(h){const a=this[n];t.call(this,h),this.requestUpdate(n,a,e,!0,h)}}throw Error("Unsupported decorator location: "+i)};function ce(e){return(t,s)=>typeof s=="object"?de(e,t,s):((i,r,o)=>{const n=r.hasOwnProperty(o);return r.constructor.createProperty(o,i),n?Object.getOwnPropertyDescriptor(r,o):void 0})(e,t,s)}var pe=Object.defineProperty,ue=Object.getOwnPropertyDescriptor,gt=(e,t,s,i)=>{for(var r=i>1?void 0:i?ue(t,s):t,o=e.length-1,n;o>=0;o--)(n=e[o])&&(r=(i?n(t,s,r):n(r))||r);return i&&r&&pe(t,s,r),r};u.HeadlessLabel=class extends Gt{get htmlFor(){return this._htmlFor}set htmlFor(t){const s=this._htmlFor;this._htmlFor=t,this.requestUpdate("htmlFor",s),this.isConnected&&this._updateAriaLink()}_htmlFor=null;connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","label");const t=this.getAttribute("for");t&&(this._htmlFor=t),this.addEventListener("click",this._handleClick,{signal:this.signal}),this.addEventListener("mousedown",this._handleMouseDown,{signal:this.signal}),this._updateAriaLink(),requestAnimationFrame(()=>{requestAnimationFrame(()=>this._updateAriaLink())})}attributeChangedCallback(t,s,i){super.attributeChangedCallback(t,s,i),t==="for"&&s!==i&&this.isConnected&&(this._htmlFor=i,this._updateAriaLink())}_handleClick=t=>{if(!this.htmlFor)return;const s=document.getElementById(this.htmlFor);s&&(s.focus(),s!==t.target&&s.click())};_handleMouseDown=t=>{t.detail>1&&t.preventDefault()};_updateAriaLink(){if(!this.htmlFor)return;const t=document.getElementById(this.htmlFor);t&&(this.id||(this.id=`hp-label-${this.hpId}`),t.setAttribute("aria-labelledby",this.id))}},gt([ce({type:String,reflect:!0,attribute:"for"})],u.HeadlessLabel.prototype,"htmlFor",1),u.HeadlessLabel=gt([Qt("hp-label")],u.HeadlessLabel),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}); |
+2
-2
| { | ||
| "name": "@headless-primitives/label", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "Headless label primitive", | ||
@@ -34,3 +34,3 @@ "keywords": [ | ||
| "lit": "^3.3.2", | ||
| "@headless-primitives/utils": "1.0.0" | ||
| "@headless-primitives/utils": "1.1.0" | ||
| }, | ||
@@ -37,0 +37,0 @@ "devDependencies": { |
62053
1.14%1007
0.7%+ Added
- Removed