pollcatch 2.4.1 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pc.js +737 -659
package/pc.js CHANGED
@@ -3,18 +3,18 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const wt = globalThis, Yt = wt.ShadowRoot && (wt.ShadyCSS === void 0 || wt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Kt = Symbol(), ee = /* @__PURE__ */ new WeakMap();
7
- let Ee = class {
6
+ const St = globalThis, Kt = St.ShadowRoot && (St.ShadyCSS === void 0 || St.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Gt = Symbol(), re = /* @__PURE__ */ new WeakMap();
7
+ let Pe = class {
8
8
  constructor(t, o, r) {
9
- if (this._$cssResult$ = !0, r !== Kt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
9
+ if (this._$cssResult$ = !0, r !== Gt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
10
  this.cssText = t, this.t = o;
11
11
  }
12
12
  get styleSheet() {
13
13
  let t = this.o;
14
14
  const o = this.t;
15
- if (Yt && t === void 0) {
15
+ if (Kt && t === void 0) {
16
16
  const r = o !== void 0 && o.length === 1;
17
- r && (t = ee.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && ee.set(o, t));
17
+ r && (t = re.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && re.set(o, t));
18
18
  }
19
19
  return t;
20
20
  }
@@ -22,33 +22,33 @@ let Ee = class {
22
22
  return this.cssText;
23
23
  }
24
24
  };
25
- const Fe = (e) => new Ee(typeof e == "string" ? e : e + "", void 0, Kt), U = (e, ...t) => {
25
+ const We = (e) => new Pe(typeof e == "string" ? e : e + "", void 0, Gt), U = (e, ...t) => {
26
26
  const o = e.length === 1 ? e[0] : t.reduce((r, s, i) => r + ((a) => {
27
27
  if (a._$cssResult$ === !0) return a.cssText;
28
28
  if (typeof a == "number") return a;
29
29
  throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
30
30
  })(s) + e[i + 1], e[0]);
31
- return new Ee(o, e, Kt);
32
- }, Ye = (e, t) => {
33
- if (Yt) e.adoptedStyleSheets = t.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
31
+ return new Pe(o, e, Gt);
32
+ }, Ke = (e, t) => {
33
+ if (Kt) e.adoptedStyleSheets = t.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
34
34
  else for (const o of t) {
35
- const r = document.createElement("style"), s = wt.litNonce;
35
+ const r = document.createElement("style"), s = St.litNonce;
36
36
  s !== void 0 && r.setAttribute("nonce", s), r.textContent = o.cssText, e.appendChild(r);
37
37
  }
38
- }, oe = Yt ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
38
+ }, se = Kt ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
39
39
  let o = "";
40
40
  for (const r of t.cssRules) o += r.cssText;
41
- return Fe(o);
41
+ return We(o);
42
42
  })(e) : e;
43
43
  /**
44
44
  * @license
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
47
  */
48
- const { is: Ke, defineProperty: We, getOwnPropertyDescriptor: Ge, getOwnPropertyNames: Ze, getOwnPropertySymbols: Je, getPrototypeOf: Xe } = Object, q = globalThis, re = q.trustedTypes, Qe = re ? re.emptyScript : "", Mt = q.reactiveElementPolyfillSupport, dt = (e, t) => e, St = { toAttribute(e, t) {
48
+ const { is: Ge, defineProperty: Ze, getOwnPropertyDescriptor: Je, getOwnPropertyNames: Xe, getOwnPropertySymbols: Qe, getPrototypeOf: to } = Object, q = globalThis, ie = q.trustedTypes, eo = ie ? ie.emptyScript : "", Mt = q.reactiveElementPolyfillSupport, pt = (e, t) => e, kt = { toAttribute(e, t) {
49
49
  switch (t) {
50
50
  case Boolean:
51
- e = e ? Qe : null;
51
+ e = e ? eo : null;
52
52
  break;
53
53
  case Object:
54
54
  case Array:
@@ -73,23 +73,23 @@ const { is: Ke, defineProperty: We, getOwnPropertyDescriptor: Ge, getOwnProperty
73
73
  }
74
74
  }
75
75
  return o;
76
- } }, Wt = (e, t) => !Ke(e, t), se = { attribute: !0, type: String, converter: St, reflect: !1, hasChanged: Wt };
76
+ } }, Zt = (e, t) => !Ge(e, t), ae = { attribute: !0, type: String, converter: kt, reflect: !1, hasChanged: Zt };
77
77
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), q.litPropertyMetadata ?? (q.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
- let ot = class extends HTMLElement {
78
+ let rt = class extends HTMLElement {
79
79
  static addInitializer(t) {
80
80
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
81
81
  }
82
82
  static get observedAttributes() {
83
83
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
84
84
  }
85
- static createProperty(t, o = se) {
85
+ static createProperty(t, o = ae) {
86
86
  if (o.state && (o.attribute = !1), this._$Ei(), this.elementProperties.set(t, o), !o.noAccessor) {
87
87
  const r = Symbol(), s = this.getPropertyDescriptor(t, r, o);
88
- s !== void 0 && We(this.prototype, t, s);
88
+ s !== void 0 && Ze(this.prototype, t, s);
89
89
  }
90
90
  }
91
91
  static getPropertyDescriptor(t, o, r) {
92
- const { get: s, set: i } = Ge(this.prototype, t) ?? { get() {
92
+ const { get: s, set: i } = Je(this.prototype, t) ?? { get() {
93
93
  return this[o];
94
94
  }, set(a) {
95
95
  this[o] = a;
@@ -102,17 +102,17 @@ let ot = class extends HTMLElement {
102
102
  }, configurable: !0, enumerable: !0 };
103
103
  }
104
104
  static getPropertyOptions(t) {
105
- return this.elementProperties.get(t) ?? se;
105
+ return this.elementProperties.get(t) ?? ae;
106
106
  }
107
107
  static _$Ei() {
108
- if (this.hasOwnProperty(dt("elementProperties"))) return;
109
- const t = Xe(this);
108
+ if (this.hasOwnProperty(pt("elementProperties"))) return;
109
+ const t = to(this);
110
110
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
111
111
  }
112
112
  static finalize() {
113
- if (this.hasOwnProperty(dt("finalized"))) return;
114
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(dt("properties"))) {
115
- const o = this.properties, r = [...Ze(o), ...Je(o)];
113
+ if (this.hasOwnProperty(pt("finalized"))) return;
114
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(pt("properties"))) {
115
+ const o = this.properties, r = [...Xe(o), ...Qe(o)];
116
116
  for (const s of r) this.createProperty(s, o[s]);
117
117
  }
118
118
  const t = this[Symbol.metadata];
@@ -131,8 +131,8 @@ let ot = class extends HTMLElement {
131
131
  const o = [];
132
132
  if (Array.isArray(t)) {
133
133
  const r = new Set(t.flat(1 / 0).reverse());
134
- for (const s of r) o.unshift(oe(s));
135
- } else t !== void 0 && o.push(oe(t));
134
+ for (const s of r) o.unshift(se(s));
135
+ } else t !== void 0 && o.push(se(t));
136
136
  return o;
137
137
  }
138
138
  static _$Eu(t, o) {
@@ -161,7 +161,7 @@ let ot = class extends HTMLElement {
161
161
  }
162
162
  createRenderRoot() {
163
163
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
164
- return Ye(t, this.constructor.elementStyles), t;
164
+ return Ke(t, this.constructor.elementStyles), t;
165
165
  }
166
166
  connectedCallback() {
167
167
  var t;
@@ -186,7 +186,7 @@ let ot = class extends HTMLElement {
186
186
  var i;
187
187
  const r = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, r);
188
188
  if (s !== void 0 && r.reflect === !0) {
189
- const a = (((i = r.converter) == null ? void 0 : i.toAttribute) !== void 0 ? r.converter : St).toAttribute(o, r.type);
189
+ const a = (((i = r.converter) == null ? void 0 : i.toAttribute) !== void 0 ? r.converter : kt).toAttribute(o, r.type);
190
190
  this._$Em = t, a == null ? this.removeAttribute(s) : this.setAttribute(s, a), this._$Em = null;
191
191
  }
192
192
  }
@@ -194,13 +194,13 @@ let ot = class extends HTMLElement {
194
194
  var i;
195
195
  const r = this.constructor, s = r._$Eh.get(t);
196
196
  if (s !== void 0 && this._$Em !== s) {
197
- const a = r.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((i = a.converter) == null ? void 0 : i.fromAttribute) !== void 0 ? a.converter : St;
197
+ const a = r.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((i = a.converter) == null ? void 0 : i.fromAttribute) !== void 0 ? a.converter : kt;
198
198
  this._$Em = s, this[s] = l.fromAttribute(o, a.type), this._$Em = null;
199
199
  }
200
200
  }
201
201
  requestUpdate(t, o, r) {
202
202
  if (t !== void 0) {
203
- if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? Wt)(this[t], o)) return;
203
+ if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? Zt)(this[t], o)) return;
204
204
  this.P(t, o, r);
205
205
  }
206
206
  this.isUpdatePending === !1 && (this._$ES = this._$ET());
@@ -273,56 +273,56 @@ let ot = class extends HTMLElement {
273
273
  firstUpdated(t) {
274
274
  }
275
275
  };
276
- ot.elementStyles = [], ot.shadowRootOptions = { mode: "open" }, ot[dt("elementProperties")] = /* @__PURE__ */ new Map(), ot[dt("finalized")] = /* @__PURE__ */ new Map(), Mt == null || Mt({ ReactiveElement: ot }), (q.reactiveElementVersions ?? (q.reactiveElementVersions = [])).push("2.0.4");
276
+ rt.elementStyles = [], rt.shadowRootOptions = { mode: "open" }, rt[pt("elementProperties")] = /* @__PURE__ */ new Map(), rt[pt("finalized")] = /* @__PURE__ */ new Map(), Mt == null || Mt({ ReactiveElement: rt }), (q.reactiveElementVersions ?? (q.reactiveElementVersions = [])).push("2.0.4");
277
277
  /**
278
278
  * @license
279
279
  * Copyright 2017 Google LLC
280
280
  * SPDX-License-Identifier: BSD-3-Clause
281
281
  */
282
- const pt = globalThis, Ct = pt.trustedTypes, ie = Ct ? Ct.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Ae = "$lit$", j = `lit$${Math.random().toFixed(9).slice(2)}$`, Pe = "?" + j, to = `<${Pe}>`, J = document, ht = () => J.createComment(""), ft = (e) => e === null || typeof e != "object" && typeof e != "function", Gt = Array.isArray, eo = (e) => Gt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", Lt = `[
283
- \f\r]`, lt = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ae = /-->/g, ne = />/g, G = RegExp(`>|${Lt}(?:([^\\s"'>=/]+)(${Lt}*=${Lt}*(?:[^
284
- \f\r"'\`<>=]|("|')|))|$)`, "g"), le = /'/g, ce = /"/g, Te = /^(?:script|style|textarea|title)$/i, oo = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), c = oo(1), H = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), de = /* @__PURE__ */ new WeakMap(), Z = J.createTreeWalker(J, 129);
285
- function _e(e, t) {
286
- if (!Gt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
- return ie !== void 0 ? ie.createHTML(t) : t;
282
+ const ut = globalThis, Et = ut.trustedTypes, ne = Et ? Et.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Te = "$lit$", j = `lit$${Math.random().toFixed(9).slice(2)}$`, _e = "?" + j, oo = `<${_e}>`, X = document, gt = () => X.createComment(""), mt = (e) => e === null || typeof e != "object" && typeof e != "function", Jt = Array.isArray, ro = (e) => Jt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", Lt = `[
283
+ \f\r]`, ct = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, le = /-->/g, ce = />/g, Z = RegExp(`>|${Lt}(?:([^\\s"'>=/]+)(${Lt}*=${Lt}*(?:[^
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), de = /'/g, pe = /"/g, Oe = /^(?:script|style|textarea|title)$/i, so = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), c = so(1), H = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), ue = /* @__PURE__ */ new WeakMap(), J = X.createTreeWalker(X, 129);
285
+ function Ie(e, t) {
286
+ if (!Jt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
+ return ne !== void 0 ? ne.createHTML(t) : t;
288
288
  }
289
- const ro = (e, t) => {
289
+ const io = (e, t) => {
290
290
  const o = e.length - 1, r = [];
291
- let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = lt;
291
+ let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = ct;
292
292
  for (let l = 0; l < o; l++) {
293
293
  const n = e[l];
294
- let d, p, h = -1, b = 0;
295
- for (; b < n.length && (a.lastIndex = b, p = a.exec(n), p !== null); ) b = a.lastIndex, a === lt ? p[1] === "!--" ? a = ae : p[1] !== void 0 ? a = ne : p[2] !== void 0 ? (Te.test(p[2]) && (s = RegExp("</" + p[2], "g")), a = G) : p[3] !== void 0 && (a = G) : a === G ? p[0] === ">" ? (a = s ?? lt, h = -1) : p[1] === void 0 ? h = -2 : (h = a.lastIndex - p[2].length, d = p[1], a = p[3] === void 0 ? G : p[3] === '"' ? ce : le) : a === ce || a === le ? a = G : a === ae || a === ne ? a = lt : (a = G, s = void 0);
296
- const x = a === G && e[l + 1].startsWith("/>") ? " " : "";
297
- i += a === lt ? n + to : h >= 0 ? (r.push(d), n.slice(0, h) + Ae + n.slice(h) + j + x) : n + j + (h === -2 ? l : x);
294
+ let d, p, h = -1, v = 0;
295
+ for (; v < n.length && (a.lastIndex = v, p = a.exec(n), p !== null); ) v = a.lastIndex, a === ct ? p[1] === "!--" ? a = le : p[1] !== void 0 ? a = ce : p[2] !== void 0 ? (Oe.test(p[2]) && (s = RegExp("</" + p[2], "g")), a = Z) : p[3] !== void 0 && (a = Z) : a === Z ? p[0] === ">" ? (a = s ?? ct, h = -1) : p[1] === void 0 ? h = -2 : (h = a.lastIndex - p[2].length, d = p[1], a = p[3] === void 0 ? Z : p[3] === '"' ? pe : de) : a === pe || a === de ? a = Z : a === le || a === ce ? a = ct : (a = Z, s = void 0);
296
+ const x = a === Z && e[l + 1].startsWith("/>") ? " " : "";
297
+ i += a === ct ? n + oo : h >= 0 ? (r.push(d), n.slice(0, h) + Te + n.slice(h) + j + x) : n + j + (h === -2 ? l : x);
298
298
  }
299
- return [_e(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
299
+ return [Ie(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
300
300
  };
301
- let Ft = class Oe {
301
+ let Ft = class ze {
302
302
  constructor({ strings: t, _$litType$: o }, r) {
303
303
  let s;
304
304
  this.parts = [];
305
305
  let i = 0, a = 0;
306
- const l = t.length - 1, n = this.parts, [d, p] = ro(t, o);
307
- if (this.el = Oe.createElement(d, r), Z.currentNode = this.el.content, o === 2 || o === 3) {
306
+ const l = t.length - 1, n = this.parts, [d, p] = io(t, o);
307
+ if (this.el = ze.createElement(d, r), J.currentNode = this.el.content, o === 2 || o === 3) {
308
308
  const h = this.el.content.firstChild;
309
309
  h.replaceWith(...h.childNodes);
310
310
  }
311
- for (; (s = Z.nextNode()) !== null && n.length < l; ) {
311
+ for (; (s = J.nextNode()) !== null && n.length < l; ) {
312
312
  if (s.nodeType === 1) {
313
- if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Ae)) {
314
- const b = p[a++], x = s.getAttribute(h).split(j), E = /([.?@])?(.*)/.exec(b);
315
- n.push({ type: 1, index: i, name: E[2], strings: x, ctor: E[1] === "." ? io : E[1] === "?" ? ao : E[1] === "@" ? no : Pt }), s.removeAttribute(h);
313
+ if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Te)) {
314
+ const v = p[a++], x = s.getAttribute(h).split(j), k = /([.?@])?(.*)/.exec(v);
315
+ n.push({ type: 1, index: i, name: k[2], strings: x, ctor: k[1] === "." ? no : k[1] === "?" ? lo : k[1] === "@" ? co : Tt }), s.removeAttribute(h);
316
316
  } else h.startsWith(j) && (n.push({ type: 6, index: i }), s.removeAttribute(h));
317
- if (Te.test(s.tagName)) {
318
- const h = s.textContent.split(j), b = h.length - 1;
319
- if (b > 0) {
320
- s.textContent = Ct ? Ct.emptyScript : "";
321
- for (let x = 0; x < b; x++) s.append(h[x], ht()), Z.nextNode(), n.push({ type: 2, index: ++i });
322
- s.append(h[b], ht());
317
+ if (Oe.test(s.tagName)) {
318
+ const h = s.textContent.split(j), v = h.length - 1;
319
+ if (v > 0) {
320
+ s.textContent = Et ? Et.emptyScript : "";
321
+ for (let x = 0; x < v; x++) s.append(h[x], gt()), J.nextNode(), n.push({ type: 2, index: ++i });
322
+ s.append(h[v], gt());
323
323
  }
324
324
  }
325
- } else if (s.nodeType === 8) if (s.data === Pe) n.push({ type: 2, index: i });
325
+ } else if (s.nodeType === 8) if (s.data === _e) n.push({ type: 2, index: i });
326
326
  else {
327
327
  let h = -1;
328
328
  for (; (h = s.data.indexOf(j, h + 1)) !== -1; ) n.push({ type: 7, index: i }), h += j.length - 1;
@@ -331,18 +331,18 @@ let Ft = class Oe {
331
331
  }
332
332
  }
333
333
  static createElement(t, o) {
334
- const r = J.createElement("template");
334
+ const r = X.createElement("template");
335
335
  return r.innerHTML = t, r;
336
336
  }
337
337
  };
338
- function st(e, t, o = e, r) {
338
+ function it(e, t, o = e, r) {
339
339
  var a, l;
340
340
  if (t === H) return t;
341
341
  let s = r !== void 0 ? (a = o._$Co) == null ? void 0 : a[r] : o._$Cl;
342
- const i = ft(t) ? void 0 : t._$litDirective$;
343
- return (s == null ? void 0 : s.constructor) !== i && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), i === void 0 ? s = void 0 : (s = new i(e), s._$AT(e, o, r)), r !== void 0 ? (o._$Co ?? (o._$Co = []))[r] = s : o._$Cl = s), s !== void 0 && (t = st(e, s._$AS(e, t.values), s, r)), t;
342
+ const i = mt(t) ? void 0 : t._$litDirective$;
343
+ return (s == null ? void 0 : s.constructor) !== i && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), i === void 0 ? s = void 0 : (s = new i(e), s._$AT(e, o, r)), r !== void 0 ? (o._$Co ?? (o._$Co = []))[r] = s : o._$Cl = s), s !== void 0 && (t = it(e, s._$AS(e, t.values), s, r)), t;
344
344
  }
345
- let so = class {
345
+ let ao = class {
346
346
  constructor(t, o) {
347
347
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = o;
348
348
  }
@@ -353,24 +353,24 @@ let so = class {
353
353
  return this._$AM._$AU;
354
354
  }
355
355
  u(t) {
356
- const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? J).importNode(o, !0);
357
- Z.currentNode = s;
358
- let i = Z.nextNode(), a = 0, l = 0, n = r[0];
356
+ const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? X).importNode(o, !0);
357
+ J.currentNode = s;
358
+ let i = J.nextNode(), a = 0, l = 0, n = r[0];
359
359
  for (; n !== void 0; ) {
360
360
  if (a === n.index) {
361
361
  let d;
362
- n.type === 2 ? d = new gt(i, i.nextSibling, this, t) : n.type === 1 ? d = new n.ctor(i, n.name, n.strings, this, t) : n.type === 6 && (d = new lo(i, this, t)), this._$AV.push(d), n = r[++l];
362
+ n.type === 2 ? d = new vt(i, i.nextSibling, this, t) : n.type === 1 ? d = new n.ctor(i, n.name, n.strings, this, t) : n.type === 6 && (d = new po(i, this, t)), this._$AV.push(d), n = r[++l];
363
363
  }
364
- a !== (n == null ? void 0 : n.index) && (i = Z.nextNode(), a++);
364
+ a !== (n == null ? void 0 : n.index) && (i = J.nextNode(), a++);
365
365
  }
366
- return Z.currentNode = J, s;
366
+ return J.currentNode = X, s;
367
367
  }
368
368
  p(t) {
369
369
  let o = 0;
370
370
  for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, o), o += r.strings.length - 2) : r._$AI(t[o])), o++;
371
371
  }
372
372
  };
373
- class gt {
373
+ class vt {
374
374
  get _$AU() {
375
375
  var t;
376
376
  return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
@@ -390,7 +390,7 @@ class gt {
390
390
  return this._$AB;
391
391
  }
392
392
  _$AI(t, o = this) {
393
- t = st(this, t, o), ft(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : eo(t) ? this.k(t) : this._(t);
393
+ t = it(this, t, o), mt(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ro(t) ? this.k(t) : this._(t);
394
394
  }
395
395
  O(t) {
396
396
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -399,26 +399,26 @@ class gt {
399
399
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
400
400
  }
401
401
  _(t) {
402
- this._$AH !== u && ft(this._$AH) ? this._$AA.nextSibling.data = t : this.T(J.createTextNode(t)), this._$AH = t;
402
+ this._$AH !== u && mt(this._$AH) ? this._$AA.nextSibling.data = t : this.T(X.createTextNode(t)), this._$AH = t;
403
403
  }
404
404
  $(t) {
405
405
  var i;
406
- const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Ft.createElement(_e(r.h, r.h[0]), this.options)), r);
406
+ const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Ft.createElement(Ie(r.h, r.h[0]), this.options)), r);
407
407
  if (((i = this._$AH) == null ? void 0 : i._$AD) === s) this._$AH.p(o);
408
408
  else {
409
- const a = new so(s, this), l = a.u(this.options);
409
+ const a = new ao(s, this), l = a.u(this.options);
410
410
  a.p(o), this.T(l), this._$AH = a;
411
411
  }
412
412
  }
413
413
  _$AC(t) {
414
- let o = de.get(t.strings);
415
- return o === void 0 && de.set(t.strings, o = new Ft(t)), o;
414
+ let o = ue.get(t.strings);
415
+ return o === void 0 && ue.set(t.strings, o = new Ft(t)), o;
416
416
  }
417
417
  k(t) {
418
- Gt(this._$AH) || (this._$AH = [], this._$AR());
418
+ Jt(this._$AH) || (this._$AH = [], this._$AR());
419
419
  const o = this._$AH;
420
420
  let r, s = 0;
421
- for (const i of t) s === o.length ? o.push(r = new gt(this.O(ht()), this.O(ht()), this, this.options)) : r = o[s], r._$AI(i), s++;
421
+ for (const i of t) s === o.length ? o.push(r = new vt(this.O(gt()), this.O(gt()), this, this.options)) : r = o[s], r._$AI(i), s++;
422
422
  s < o.length && (this._$AR(r && r._$AB.nextSibling, s), o.length = s);
423
423
  }
424
424
  _$AR(t = this._$AA.nextSibling, o) {
@@ -433,7 +433,7 @@ class gt {
433
433
  this._$AM === void 0 && (this._$Cv = t, (o = this._$AP) == null || o.call(this, t));
434
434
  }
435
435
  }
436
- class Pt {
436
+ class Tt {
437
437
  get tagName() {
438
438
  return this.element.tagName;
439
439
  }
@@ -446,11 +446,11 @@ class Pt {
446
446
  _$AI(t, o = this, r, s) {
447
447
  const i = this.strings;
448
448
  let a = !1;
449
- if (i === void 0) t = st(this, t, o, 0), a = !ft(t) || t !== this._$AH && t !== H, a && (this._$AH = t);
449
+ if (i === void 0) t = it(this, t, o, 0), a = !mt(t) || t !== this._$AH && t !== H, a && (this._$AH = t);
450
450
  else {
451
451
  const l = t;
452
452
  let n, d;
453
- for (t = i[0], n = 0; n < i.length - 1; n++) d = st(this, l[r + n], o, n), d === H && (d = this._$AH[n]), a || (a = !ft(d) || d !== this._$AH[n]), d === u ? t = u : t !== u && (t += (d ?? "") + i[n + 1]), this._$AH[n] = d;
453
+ for (t = i[0], n = 0; n < i.length - 1; n++) d = it(this, l[r + n], o, n), d === H && (d = this._$AH[n]), a || (a = !mt(d) || d !== this._$AH[n]), d === u ? t = u : t !== u && (t += (d ?? "") + i[n + 1]), this._$AH[n] = d;
454
454
  }
455
455
  a && !s && this.j(t);
456
456
  }
@@ -458,7 +458,7 @@ class Pt {
458
458
  t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
459
459
  }
460
460
  }
461
- let io = class extends Pt {
461
+ let no = class extends Tt {
462
462
  constructor() {
463
463
  super(...arguments), this.type = 3;
464
464
  }
@@ -466,7 +466,7 @@ let io = class extends Pt {
466
466
  this.element[this.name] = t === u ? void 0 : t;
467
467
  }
468
468
  };
469
- class ao extends Pt {
469
+ class lo extends Tt {
470
470
  constructor() {
471
471
  super(...arguments), this.type = 4;
472
472
  }
@@ -474,12 +474,12 @@ class ao extends Pt {
474
474
  this.element.toggleAttribute(this.name, !!t && t !== u);
475
475
  }
476
476
  }
477
- class no extends Pt {
477
+ class co extends Tt {
478
478
  constructor(t, o, r, s, i) {
479
479
  super(t, o, r, s, i), this.type = 5;
480
480
  }
481
481
  _$AI(t, o = this) {
482
- if ((t = st(this, t, o, 0) ?? u) === H) return;
482
+ if ((t = it(this, t, o, 0) ?? u) === H) return;
483
483
  const r = this._$AH, s = t === u && r !== u || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, i = t !== u && (r === u || s);
484
484
  s && this.element.removeEventListener(this.name, this, r), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
485
485
  }
@@ -488,7 +488,7 @@ class no extends Pt {
488
488
  typeof this._$AH == "function" ? this._$AH.call(((o = this.options) == null ? void 0 : o.host) ?? this.element, t) : this._$AH.handleEvent(t);
489
489
  }
490
490
  }
491
- class lo {
491
+ class po {
492
492
  constructor(t, o, r) {
493
493
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = o, this.options = r;
494
494
  }
@@ -496,17 +496,17 @@ class lo {
496
496
  return this._$AM._$AU;
497
497
  }
498
498
  _$AI(t) {
499
- st(this, t);
499
+ it(this, t);
500
500
  }
501
501
  }
502
- const Nt = pt.litHtmlPolyfillSupport;
503
- Nt == null || Nt(Ft, gt), (pt.litHtmlVersions ?? (pt.litHtmlVersions = [])).push("3.2.1");
504
- const co = (e, t, o) => {
502
+ const Dt = ut.litHtmlPolyfillSupport;
503
+ Dt == null || Dt(Ft, vt), (ut.litHtmlVersions ?? (ut.litHtmlVersions = [])).push("3.2.1");
504
+ const uo = (e, t, o) => {
505
505
  const r = (o == null ? void 0 : o.renderBefore) ?? t;
506
506
  let s = r._$litPart$;
507
507
  if (s === void 0) {
508
508
  const i = (o == null ? void 0 : o.renderBefore) ?? null;
509
- r._$litPart$ = s = new gt(t.insertBefore(ht(), i), i, void 0, o ?? {});
509
+ r._$litPart$ = s = new vt(t.insertBefore(gt(), i), i, void 0, o ?? {});
510
510
  }
511
511
  return s._$AI(e), s;
512
512
  };
@@ -515,7 +515,7 @@ const co = (e, t, o) => {
515
515
  * Copyright 2017 Google LLC
516
516
  * SPDX-License-Identifier: BSD-3-Clause
517
517
  */
518
- let R = class extends ot {
518
+ let R = class extends rt {
519
519
  constructor() {
520
520
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
521
521
  }
@@ -526,7 +526,7 @@ let R = class extends ot {
526
526
  }
527
527
  update(t) {
528
528
  const o = this.render();
529
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = co(o, this.renderRoot, this.renderOptions);
529
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = uo(o, this.renderRoot, this.renderOptions);
530
530
  }
531
531
  connectedCallback() {
532
532
  var t;
@@ -540,17 +540,17 @@ let R = class extends ot {
540
540
  return H;
541
541
  }
542
542
  };
543
- var ke;
544
- R._$litElement$ = !0, R.finalized = !0, (ke = globalThis.litElementHydrateSupport) == null || ke.call(globalThis, { LitElement: R });
545
- const Dt = globalThis.litElementPolyfillSupport;
546
- Dt == null || Dt({ LitElement: R });
543
+ var Ae;
544
+ R._$litElement$ = !0, R.finalized = !0, (Ae = globalThis.litElementHydrateSupport) == null || Ae.call(globalThis, { LitElement: R });
545
+ const Nt = globalThis.litElementPolyfillSupport;
546
+ Nt == null || Nt({ LitElement: R });
547
547
  (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
548
548
  /**
549
549
  * @license
550
550
  * Copyright 2017 Google LLC
551
551
  * SPDX-License-Identifier: BSD-3-Clause
552
552
  */
553
- const Y = (e) => (t, o) => {
553
+ const W = (e) => (t, o) => {
554
554
  o !== void 0 ? o.addInitializer(() => {
555
555
  customElements.define(e, t);
556
556
  }) : customElements.define(e, t);
@@ -560,7 +560,7 @@ const Y = (e) => (t, o) => {
560
560
  * Copyright 2017 Google LLC
561
561
  * SPDX-License-Identifier: BSD-3-Clause
562
562
  */
563
- const po = { attribute: !0, type: String, converter: St, reflect: !1, hasChanged: Wt }, uo = (e = po, t, o) => {
563
+ const ho = { attribute: !0, type: String, converter: kt, reflect: !1, hasChanged: Zt }, fo = (e = ho, t, o) => {
564
564
  const { kind: r, metadata: s } = o;
565
565
  let i = globalThis.litPropertyMetadata.get(s);
566
566
  if (i === void 0 && globalThis.litPropertyMetadata.set(s, i = /* @__PURE__ */ new Map()), i.set(o.name, e), r === "accessor") {
@@ -582,7 +582,7 @@ const po = { attribute: !0, type: String, converter: St, reflect: !1, hasChanged
582
582
  throw Error("Unsupported decorator location: " + r);
583
583
  };
584
584
  function f(e) {
585
- return (t, o) => typeof o == "object" ? uo(e, t, o) : ((r, s, i) => {
585
+ return (t, o) => typeof o == "object" ? fo(e, t, o) : ((r, s, i) => {
586
586
  const a = s.hasOwnProperty(i);
587
587
  return s.constructor.createProperty(i, a ? { ...r, wrapped: !0 } : r), a ? Object.getOwnPropertyDescriptor(s, i) : void 0;
588
588
  })(e, t, o);
@@ -592,7 +592,7 @@ function f(e) {
592
592
  * Copyright 2017 Google LLC
593
593
  * SPDX-License-Identifier: BSD-3-Clause
594
594
  */
595
- function k(e) {
595
+ function A(e) {
596
596
  return f({ ...e, state: !0, attribute: !1 });
597
597
  }
598
598
  /**
@@ -600,25 +600,25 @@ function k(e) {
600
600
  * Copyright 2017 Google LLC
601
601
  * SPDX-License-Identifier: BSD-3-Clause
602
602
  */
603
- const ho = (e, t, o) => (o.configurable = !0, o.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, o), o);
603
+ const go = (e, t, o) => (o.configurable = !0, o.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, o), o);
604
604
  /**
605
605
  * @license
606
606
  * Copyright 2017 Google LLC
607
607
  * SPDX-License-Identifier: BSD-3-Clause
608
608
  */
609
- function mt(e, t) {
609
+ function bt(e, t) {
610
610
  return (o, r, s) => {
611
611
  const i = (a) => {
612
612
  var l;
613
613
  return ((l = a.renderRoot) == null ? void 0 : l.querySelector(e)) ?? null;
614
614
  };
615
- return ho(o, r, { get() {
615
+ return go(o, r, { get() {
616
616
  return i(this);
617
617
  } });
618
618
  };
619
619
  }
620
620
  var S = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))(S || {});
621
- const Zt = c`
621
+ const Xt = c`
622
622
  <svg
623
623
  xmlns="http://www.w3.org/2000/svg"
624
624
  height="24px"
@@ -628,7 +628,7 @@ const Zt = c`
628
628
  >
629
629
  <path d="M640-160v-280h160v280H640Zm-240 0v-640h160v640H400Zm-240 0v-440h160v440H160Z" />
630
630
  </svg>
631
- `, Jt = c`
631
+ `, Qt = c`
632
632
  <svg
633
633
  xmlns="http://www.w3.org/2000/svg"
634
634
  height="24px"
@@ -640,7 +640,7 @@ const Zt = c`
640
640
  d="M160-160v-440h160v440H160Zm240 0v-400l160 160v240H400Zm160-354L400-674v-126h160v286Zm240 240L640-434v-6h160v166Zm-9 219L55-791l57-57 736 736-57 57Z"
641
641
  />
642
642
  </svg>
643
- `, kt = c`
643
+ `, At = c`
644
644
  <svg
645
645
  xmlns="http://www.w3.org/2000/svg"
646
646
  height="24px"
@@ -652,7 +652,7 @@ const Zt = c`
652
652
  d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"
653
653
  />
654
654
  </svg>
655
- `, Tt = c`
655
+ `, _t = c`
656
656
  <svg
657
657
  xmlns="http://www.w3.org/2000/svg"
658
658
  width="16"
@@ -664,7 +664,7 @@ const Zt = c`
664
664
  d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"
665
665
  />
666
666
  </svg>
667
- `, Ie = c`
667
+ `, Me = c`
668
668
  <svg
669
669
  xmlns="http://www.w3.org/2000/svg"
670
670
  height="24px"
@@ -675,95 +675,95 @@ const Zt = c`
675
675
  <path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z" />
676
676
  </svg>
677
677
  `;
678
- var fo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
678
+ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
679
679
  return typeof e == "string" ? e.length > 0 : typeof e == "number";
680
- }, $ = function(e, t, o) {
680
+ }, C = function(e, t, o) {
681
681
  return t === void 0 && (t = 0), o === void 0 && (o = Math.pow(10, t)), Math.round(o * e) / o + 0;
682
- }, P = function(e, t, o) {
682
+ }, T = function(e, t, o) {
683
683
  return t === void 0 && (t = 0), o === void 0 && (o = 1), e > o ? o : e > t ? e : t;
684
- }, ze = function(e) {
684
+ }, Le = function(e) {
685
685
  return (e = isFinite(e) ? e % 360 : 0) > 0 ? e : e + 360;
686
- }, pe = function(e) {
687
- return { r: P(e.r, 0, 255), g: P(e.g, 0, 255), b: P(e.b, 0, 255), a: P(e.a) };
686
+ }, he = function(e) {
687
+ return { r: T(e.r, 0, 255), g: T(e.g, 0, 255), b: T(e.b, 0, 255), a: T(e.a) };
688
688
  }, Rt = function(e) {
689
- return { r: $(e.r), g: $(e.g), b: $(e.b), a: $(e.a, 3) };
690
- }, go = /^#([0-9a-f]{3,8})$/i, yt = function(e) {
689
+ return { r: C(e.r), g: C(e.g), b: C(e.b), a: C(e.a, 3) };
690
+ }, vo = /^#([0-9a-f]{3,8})$/i, xt = function(e) {
691
691
  var t = e.toString(16);
692
692
  return t.length < 2 ? "0" + t : t;
693
- }, Me = function(e) {
693
+ }, De = function(e) {
694
694
  var t = e.r, o = e.g, r = e.b, s = e.a, i = Math.max(t, o, r), a = i - Math.min(t, o, r), l = a ? i === t ? (o - r) / a : i === o ? 2 + (r - t) / a : 4 + (t - o) / a : 0;
695
695
  return { h: 60 * (l < 0 ? l + 6 : l), s: i ? a / i * 100 : 0, v: i / 255 * 100, a: s };
696
- }, Le = function(e) {
696
+ }, Ne = function(e) {
697
697
  var t = e.h, o = e.s, r = e.v, s = e.a;
698
698
  t = t / 360 * 6, o /= 100, r /= 100;
699
699
  var i = Math.floor(t), a = r * (1 - o), l = r * (1 - (t - i) * o), n = r * (1 - (1 - t + i) * o), d = i % 6;
700
700
  return { r: 255 * [r, l, a, a, n, r][d], g: 255 * [n, r, r, l, a, a][d], b: 255 * [a, a, n, r, r, l][d], a: s };
701
- }, ue = function(e) {
702
- return { h: ze(e.h), s: P(e.s, 0, 100), l: P(e.l, 0, 100), a: P(e.a) };
703
- }, he = function(e) {
704
- return { h: $(e.h), s: $(e.s), l: $(e.l), a: $(e.a, 3) };
705
701
  }, fe = function(e) {
706
- return Le((o = (t = e).s, { h: t.h, s: (o *= ((r = t.l) < 50 ? r : 100 - r) / 100) > 0 ? 2 * o / (r + o) * 100 : 0, v: r + o, a: t.a }));
702
+ return { h: Le(e.h), s: T(e.s, 0, 100), l: T(e.l, 0, 100), a: T(e.a) };
703
+ }, ge = function(e) {
704
+ return { h: C(e.h), s: C(e.s), l: C(e.l), a: C(e.a, 3) };
705
+ }, me = function(e) {
706
+ return Ne((o = (t = e).s, { h: t.h, s: (o *= ((r = t.l) < 50 ? r : 100 - r) / 100) > 0 ? 2 * o / (r + o) * 100 : 0, v: r + o, a: t.a }));
707
707
  var t, o, r;
708
- }, ut = function(e) {
709
- return { h: (t = Me(e)).h, s: (s = (200 - (o = t.s)) * (r = t.v) / 100) > 0 && s < 200 ? o * r / 100 / (s <= 100 ? s : 200 - s) * 100 : 0, l: s / 2, a: t.a };
708
+ }, ht = function(e) {
709
+ return { h: (t = De(e)).h, s: (s = (200 - (o = t.s)) * (r = t.v) / 100) > 0 && s < 200 ? o * r / 100 / (s <= 100 ? s : 200 - s) * 100 : 0, l: s / 2, a: t.a };
710
710
  var t, o, r, s;
711
- }, mo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, vo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, bo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, yo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, ge = { string: [[function(e) {
712
- var t = go.exec(e);
713
- return t ? (e = t[1]).length <= 4 ? { r: parseInt(e[0] + e[0], 16), g: parseInt(e[1] + e[1], 16), b: parseInt(e[2] + e[2], 16), a: e.length === 4 ? $(parseInt(e[3] + e[3], 16) / 255, 2) : 1 } : e.length === 6 || e.length === 8 ? { r: parseInt(e.substr(0, 2), 16), g: parseInt(e.substr(2, 2), 16), b: parseInt(e.substr(4, 2), 16), a: e.length === 8 ? $(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
711
+ }, bo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, yo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, wo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, xo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, ve = { string: [[function(e) {
712
+ var t = vo.exec(e);
713
+ return t ? (e = t[1]).length <= 4 ? { r: parseInt(e[0] + e[0], 16), g: parseInt(e[1] + e[1], 16), b: parseInt(e[2] + e[2], 16), a: e.length === 4 ? C(parseInt(e[3] + e[3], 16) / 255, 2) : 1 } : e.length === 6 || e.length === 8 ? { r: parseInt(e.substr(0, 2), 16), g: parseInt(e.substr(2, 2), 16), b: parseInt(e.substr(4, 2), 16), a: e.length === 8 ? C(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
714
714
  }, "hex"], [function(e) {
715
- var t = bo.exec(e) || yo.exec(e);
716
- return t ? t[2] !== t[4] || t[4] !== t[6] ? null : pe({ r: Number(t[1]) / (t[2] ? 100 / 255 : 1), g: Number(t[3]) / (t[4] ? 100 / 255 : 1), b: Number(t[5]) / (t[6] ? 100 / 255 : 1), a: t[7] === void 0 ? 1 : Number(t[7]) / (t[8] ? 100 : 1) }) : null;
715
+ var t = wo.exec(e) || xo.exec(e);
716
+ return t ? t[2] !== t[4] || t[4] !== t[6] ? null : he({ r: Number(t[1]) / (t[2] ? 100 / 255 : 1), g: Number(t[3]) / (t[4] ? 100 / 255 : 1), b: Number(t[5]) / (t[6] ? 100 / 255 : 1), a: t[7] === void 0 ? 1 : Number(t[7]) / (t[8] ? 100 : 1) }) : null;
717
717
  }, "rgb"], [function(e) {
718
- var t = mo.exec(e) || vo.exec(e);
718
+ var t = bo.exec(e) || yo.exec(e);
719
719
  if (!t) return null;
720
- var o, r, s = ue({ h: (o = t[1], r = t[2], r === void 0 && (r = "deg"), Number(o) * (fo[r] || 1)), s: Number(t[3]), l: Number(t[4]), a: t[5] === void 0 ? 1 : Number(t[5]) / (t[6] ? 100 : 1) });
721
- return fe(s);
720
+ var o, r, s = fe({ h: (o = t[1], r = t[2], r === void 0 && (r = "deg"), Number(o) * (mo[r] || 1)), s: Number(t[3]), l: Number(t[4]), a: t[5] === void 0 ? 1 : Number(t[5]) / (t[6] ? 100 : 1) });
721
+ return me(s);
722
722
  }, "hsl"]], object: [[function(e) {
723
723
  var t = e.r, o = e.g, r = e.b, s = e.a, i = s === void 0 ? 1 : s;
724
- return L(t) && L(o) && L(r) ? pe({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
724
+ return L(t) && L(o) && L(r) ? he({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
725
725
  }, "rgb"], [function(e) {
726
726
  var t = e.h, o = e.s, r = e.l, s = e.a, i = s === void 0 ? 1 : s;
727
727
  if (!L(t) || !L(o) || !L(r)) return null;
728
- var a = ue({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
729
- return fe(a);
728
+ var a = fe({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
729
+ return me(a);
730
730
  }, "hsl"], [function(e) {
731
731
  var t = e.h, o = e.s, r = e.v, s = e.a, i = s === void 0 ? 1 : s;
732
732
  if (!L(t) || !L(o) || !L(r)) return null;
733
733
  var a = function(l) {
734
- return { h: ze(l.h), s: P(l.s, 0, 100), v: P(l.v, 0, 100), a: P(l.a) };
734
+ return { h: Le(l.h), s: T(l.s, 0, 100), v: T(l.v, 0, 100), a: T(l.a) };
735
735
  }({ h: Number(t), s: Number(o), v: Number(r), a: Number(i) });
736
- return Le(a);
737
- }, "hsv"]] }, me = function(e, t) {
736
+ return Ne(a);
737
+ }, "hsv"]] }, be = function(e, t) {
738
738
  for (var o = 0; o < t.length; o++) {
739
739
  var r = t[o][0](e);
740
740
  if (r) return [r, t[o][1]];
741
741
  }
742
742
  return [null, void 0];
743
- }, xo = function(e) {
744
- return typeof e == "string" ? me(e.trim(), ge.string) : typeof e == "object" && e !== null ? me(e, ge.object) : [null, void 0];
743
+ }, $o = function(e) {
744
+ return typeof e == "string" ? be(e.trim(), ve.string) : typeof e == "object" && e !== null ? be(e, ve.object) : [null, void 0];
745
745
  }, Bt = function(e, t) {
746
- var o = ut(e);
747
- return { h: o.h, s: P(o.s + 100 * t, 0, 100), l: o.l, a: o.a };
746
+ var o = ht(e);
747
+ return { h: o.h, s: T(o.s + 100 * t, 0, 100), l: o.l, a: o.a };
748
748
  }, Ut = function(e) {
749
749
  return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 / 255;
750
- }, ve = function(e, t) {
751
- var o = ut(e);
752
- return { h: o.h, s: o.s, l: P(o.l + 100 * t, 0, 100), a: o.a };
753
- }, be = function() {
750
+ }, ye = function(e, t) {
751
+ var o = ht(e);
752
+ return { h: o.h, s: o.s, l: T(o.l + 100 * t, 0, 100), a: o.a };
753
+ }, we = function() {
754
754
  function e(t) {
755
- this.parsed = xo(t)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
755
+ this.parsed = $o(t)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
756
756
  }
757
757
  return e.prototype.isValid = function() {
758
758
  return this.parsed !== null;
759
759
  }, e.prototype.brightness = function() {
760
- return $(Ut(this.rgba), 2);
760
+ return C(Ut(this.rgba), 2);
761
761
  }, e.prototype.isDark = function() {
762
762
  return Ut(this.rgba) < 0.5;
763
763
  }, e.prototype.isLight = function() {
764
764
  return Ut(this.rgba) >= 0.5;
765
765
  }, e.prototype.toHex = function() {
766
- return t = Rt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? yt($(255 * i)) : "", "#" + yt(o) + yt(r) + yt(s) + a;
766
+ return t = Rt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? xt(C(255 * i)) : "", "#" + xt(o) + xt(r) + xt(s) + a;
767
767
  var t, o, r, s, i, a;
768
768
  }, e.prototype.toRgb = function() {
769
769
  return Rt(this.rgba);
@@ -771,60 +771,68 @@ var fo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
771
771
  return t = Rt(this.rgba), o = t.r, r = t.g, s = t.b, (i = t.a) < 1 ? "rgba(" + o + ", " + r + ", " + s + ", " + i + ")" : "rgb(" + o + ", " + r + ", " + s + ")";
772
772
  var t, o, r, s, i;
773
773
  }, e.prototype.toHsl = function() {
774
- return he(ut(this.rgba));
774
+ return ge(ht(this.rgba));
775
775
  }, e.prototype.toHslString = function() {
776
- return t = he(ut(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
776
+ return t = ge(ht(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
777
777
  var t, o, r, s, i;
778
778
  }, e.prototype.toHsv = function() {
779
- return t = Me(this.rgba), { h: $(t.h), s: $(t.s), v: $(t.v), a: $(t.a, 3) };
779
+ return t = De(this.rgba), { h: C(t.h), s: C(t.s), v: C(t.v), a: C(t.a, 3) };
780
780
  var t;
781
781
  }, e.prototype.invert = function() {
782
- return T({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
782
+ return O({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
783
783
  var t;
784
784
  }, e.prototype.saturate = function(t) {
785
- return t === void 0 && (t = 0.1), T(Bt(this.rgba, t));
785
+ return t === void 0 && (t = 0.1), O(Bt(this.rgba, t));
786
786
  }, e.prototype.desaturate = function(t) {
787
- return t === void 0 && (t = 0.1), T(Bt(this.rgba, -t));
787
+ return t === void 0 && (t = 0.1), O(Bt(this.rgba, -t));
788
788
  }, e.prototype.grayscale = function() {
789
- return T(Bt(this.rgba, -1));
789
+ return O(Bt(this.rgba, -1));
790
790
  }, e.prototype.lighten = function(t) {
791
- return t === void 0 && (t = 0.1), T(ve(this.rgba, t));
791
+ return t === void 0 && (t = 0.1), O(ye(this.rgba, t));
792
792
  }, e.prototype.darken = function(t) {
793
- return t === void 0 && (t = 0.1), T(ve(this.rgba, -t));
793
+ return t === void 0 && (t = 0.1), O(ye(this.rgba, -t));
794
794
  }, e.prototype.rotate = function(t) {
795
795
  return t === void 0 && (t = 15), this.hue(this.hue() + t);
796
796
  }, e.prototype.alpha = function(t) {
797
- return typeof t == "number" ? T({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : $(this.rgba.a, 3);
797
+ return typeof t == "number" ? O({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : C(this.rgba.a, 3);
798
798
  var o;
799
799
  }, e.prototype.hue = function(t) {
800
- var o = ut(this.rgba);
801
- return typeof t == "number" ? T({ h: t, s: o.s, l: o.l, a: o.a }) : $(o.h);
800
+ var o = ht(this.rgba);
801
+ return typeof t == "number" ? O({ h: t, s: o.s, l: o.l, a: o.a }) : C(o.h);
802
802
  }, e.prototype.isEqual = function(t) {
803
- return this.toHex() === T(t).toHex();
803
+ return this.toHex() === O(t).toHex();
804
804
  }, e;
805
- }(), T = function(e) {
806
- return e instanceof be ? e : new be(e);
805
+ }(), O = function(e) {
806
+ return e instanceof we ? e : new we(e);
807
807
  };
808
- const Vt = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
809
- function wo(e) {
808
+ const So = typeof process < "u" ? process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test" : !1;
809
+ function Vt() {
810
+ if (So) return !0;
811
+ try {
812
+ return typeof localStorage < "u" && localStorage.getItem("pc-mode") === "development";
813
+ } catch {
814
+ return !1;
815
+ }
816
+ }
817
+ function Co(e) {
810
818
  return {
811
819
  debug: (t, ...o) => {
812
- Vt && console.debug(`[${e}]`, t, ...o);
820
+ Vt() && console.debug(`[${e}]`, t, ...o);
813
821
  },
814
822
  info: (t, ...o) => {
815
- Vt && console.info(`[${e}]`, t, ...o);
823
+ Vt() && console.info(`[${e}]`, t, ...o);
816
824
  },
817
825
  warn: (t, ...o) => {
818
- Vt && console.warn(`[${e}]`, t, ...o);
826
+ Vt() && console.warn(`[${e}]`, t, ...o);
819
827
  },
820
828
  error: (t, ...o) => {
821
829
  console.error(`[${e}]`, t, ...o);
822
830
  }
823
831
  };
824
832
  }
825
- const m = wo("Pollcatch");
826
- var Ne = /* @__PURE__ */ ((e) => (e[e.AA_NORMAL = 4.5] = "AA_NORMAL", e[e.AA_LARGE = 3] = "AA_LARGE", e[e.AAA_NORMAL = 7] = "AAA_NORMAL", e[e.AAA_LARGE = 4.5] = "AAA_LARGE", e))(Ne || {});
827
- const $o = {
833
+ const g = Co("Pollcatch");
834
+ var Re = /* @__PURE__ */ ((e) => (e[e.AA_NORMAL = 4.5] = "AA_NORMAL", e[e.AA_LARGE = 3] = "AA_LARGE", e[e.AAA_NORMAL = 7] = "AAA_NORMAL", e[e.AAA_LARGE = 4.5] = "AAA_LARGE", e))(Re || {});
835
+ const ko = {
828
836
  black: "#000000",
829
837
  white: "#ffffff",
830
838
  red: "#ff0000",
@@ -841,21 +849,21 @@ const $o = {
841
849
  teal: "#008080",
842
850
  navy: "#000080"
843
851
  };
844
- function So(e) {
852
+ function Eo(e) {
845
853
  const t = e.toLowerCase().trim();
846
- return $o[t] || null;
854
+ return ko[t] || null;
847
855
  }
848
856
  function jt(e, t) {
849
- const o = ye(e), r = ye(t), s = Math.max(o, r), i = Math.min(o, r);
857
+ const o = xe(e), r = xe(t), s = Math.max(o, r), i = Math.min(o, r);
850
858
  return (s + 0.05) / (i + 0.05);
851
859
  }
852
- function ye(e) {
853
- const t = ko(e), o = t.r / 255, r = t.g / 255, s = t.b / 255, i = o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4), a = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4), l = s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
860
+ function xe(e) {
861
+ const t = Po(e), o = t.r / 255, r = t.g / 255, s = t.b / 255, i = o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4), a = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4), l = s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
854
862
  return 0.2126 * i + 0.7152 * a + 0.0722 * l;
855
863
  }
856
- function Co(e, t = {}) {
857
- if (!T(e).isValid())
858
- return m.warn(`Invalid color provided: ${e}`), "black";
864
+ function Ao(e, t = {}) {
865
+ if (!O(e).isValid())
866
+ return g.warn(`Invalid color provided: ${e}`), "black";
859
867
  const {
860
868
  minContrast: r = 4.5,
861
869
  colorOptions: s = ["black", "white", "light", "dark"],
@@ -875,23 +883,23 @@ function Co(e, t = {}) {
875
883
  n = a, d = p;
876
884
  for (const h of l) {
877
885
  if (h === a) continue;
878
- const b = jt(e, h);
879
- b > d && (d = b, n = h);
886
+ const v = jt(e, h);
887
+ v > d && (d = v, n = h);
880
888
  }
881
- m.warn(
889
+ g.warn(
882
890
  `No color option met the minimum contrast ratio of ${r}:1 against ${e}. Using ${n} with contrast ratio ${d.toFixed(2)}:1 instead.`
883
891
  );
884
892
  }
885
893
  return n;
886
894
  }
887
- function ko(e) {
888
- const o = So(e) || e, r = T(o);
895
+ function Po(e) {
896
+ const o = Eo(e) || e, r = O(o);
889
897
  if (!r.isValid())
890
- return m.warn(`Invalid color provided: ${e}`), { r: 0, g: 0, b: 0 };
898
+ return g.warn(`Invalid color provided: ${e}`), { r: 0, g: 0, b: 0 };
891
899
  const { r: s, g: i, b: a } = r.toRgb();
892
900
  return { r: s, g: i, b: a };
893
901
  }
894
- function O(e, t) {
902
+ function z(e, t) {
895
903
  const r = t ? {
896
904
  left: "start",
897
905
  right: "end",
@@ -922,7 +930,7 @@ function qt(e, t = "1rem", o = 1) {
922
930
  const l = parseFloat(i);
923
931
  return isNaN(l) ? t : `${l}rem`;
924
932
  }
925
- function Eo(e, t = "4px") {
933
+ function To(e, t = "4px") {
926
934
  if (!e) return t;
927
935
  const o = {
928
936
  xs: "2px",
@@ -942,8 +950,8 @@ function Eo(e, t = "4px") {
942
950
  const a = parseFloat(s);
943
951
  return isNaN(a) ? t : `${a}px`;
944
952
  }
945
- var N = /* @__PURE__ */ ((e) => (e.BUTTON = "button", e.CHECKBOX = "checkbox", e.RADIO = "radio", e.RADIOGROUP = "radiogroup", e.SWITCH = "switch", e.TAB = "tab", e.TABLIST = "tablist", e.TABPANEL = "tabpanel", e.MENU = "menu", e.MENUITEM = "menuitem", e.MENUITEMCHECKBOX = "menuitemcheckbox", e.MENUITEMRADIO = "menuitemradio", e.SLIDER = "slider", e.TEXTBOX = "textbox", e.COMBOBOX = "combobox", e.LISTBOX = "listbox", e.OPTION = "option", e.PROGRESSBAR = "progressbar", e.STATUS = "status", e.ALERT = "alert", e.DIALOG = "dialog", e.GROUP = "group", e.REGION = "region", e.NONE = "none", e.PRESENTATION = "presentation", e))(N || {});
946
- function rt(e) {
953
+ var D = /* @__PURE__ */ ((e) => (e.BUTTON = "button", e.CHECKBOX = "checkbox", e.RADIO = "radio", e.RADIOGROUP = "radiogroup", e.SWITCH = "switch", e.TAB = "tab", e.TABLIST = "tablist", e.TABPANEL = "tabpanel", e.MENU = "menu", e.MENUITEM = "menuitem", e.MENUITEMCHECKBOX = "menuitemcheckbox", e.MENUITEMRADIO = "menuitemradio", e.SLIDER = "slider", e.TEXTBOX = "textbox", e.COMBOBOX = "combobox", e.LISTBOX = "listbox", e.OPTION = "option", e.PROGRESSBAR = "progressbar", e.STATUS = "status", e.ALERT = "alert", e.DIALOG = "dialog", e.GROUP = "group", e.REGION = "region", e.NONE = "none", e.PRESENTATION = "presentation", e))(D || {});
954
+ function st(e) {
947
955
  const t = {};
948
956
  e.role !== void 0 && (t.role = e.role);
949
957
  for (const [o, r] of Object.entries(e)) {
@@ -953,16 +961,16 @@ function rt(e) {
953
961
  }
954
962
  return t;
955
963
  }
956
- function Ao(e, t, o) {
957
- return rt({
964
+ function _o(e, t, o) {
965
+ return st({
958
966
  role: "button",
959
967
  ariaLabel: e,
960
968
  ariaPressed: t,
961
969
  ariaDisabled: o
962
970
  });
963
971
  }
964
- function Po(e, t, o, r = !1) {
965
- return rt({
972
+ function Oo(e, t, o, r = !1) {
973
+ return st({
966
974
  role: r ? "radio" : "checkbox",
967
975
  ariaLabel: e,
968
976
  ariaChecked: t,
@@ -972,79 +980,79 @@ function Po(e, t, o, r = !1) {
972
980
  function Ht(e, t, o) {
973
981
  typeof o == "boolean" ? e.setAttribute(t, o ? "true" : "false") : e.setAttribute(t, o);
974
982
  }
975
- function To(e) {
983
+ function Io(e) {
976
984
  if (typeof e != "string")
977
985
  return !1;
978
986
  const t = e.replace(/[<>"']/g, "").trim();
979
987
  return /^(#[0-9a-fA-F]{3,8}|rgb\([^)]+\)|rgba\([^)]+\)|hsl\([^)]+\)|hsla\([^)]+\)|[a-zA-Z]+)$/.test(t);
980
988
  }
981
- function et(e) {
982
- return To(e) ? e.replace(/[<>"']/g, "").trim() : (m.warn("Invalid color value:", e), "#000000");
989
+ function ot(e) {
990
+ return Io(e) ? e.replace(/[<>"']/g, "").trim() : (g.warn("Invalid color value:", e), "#000000");
983
991
  }
984
- function _o(e) {
992
+ function zo(e) {
985
993
  if (typeof e != "string")
986
- return m.warn("Non-string value passed to sanitizeCSS:", typeof e), "";
994
+ return g.warn("Non-string value passed to sanitizeCSS:", typeof e), "";
987
995
  let t = e;
988
996
  return t = t.replace(/@import[^;]+;/gi, "").replace(/expression\s*\([^)]*\)/gi, "").replace(/javascript:\s*[^"'\s;]*/gi, "").replace(/url\s*\(\s*["']?data:(?!image\/[^;]+;base64,)[^"')]*["']?\s*\)/gi, "").replace(/-moz-binding\s*:[^;]+;/gi, "").replace(/behavior\s*:[^;]+;/gi, ""), t;
989
997
  }
990
- function Oo(e) {
998
+ function Mo(e) {
991
999
  return typeof e != "string" || !e.trim() ? "" : e.replace(
992
1000
  /([^{}:;]+):\s*([^;{}!]+)(\s*!important)?\s*(;|})/gi,
993
1001
  (t, o, r, s, i) => s ? t : `${o}: ${r.trim()} !important${i}`
994
1002
  );
995
1003
  }
996
- const xe = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", Io = "pc_session_id", zo = 24 * 60 * 60 * 1e3;
997
- function we() {
998
- return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (m.warn("crypto.randomUUID not available, using fallback UUID generator"), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
1004
+ const Yt = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", Lo = "pc_session_id", Do = 24 * 60 * 60 * 1e3;
1005
+ function $e() {
1006
+ return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (g.warn("crypto.randomUUID not available, using fallback UUID generator"), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
999
1007
  const t = Math.random() * 16 | 0;
1000
1008
  return (e === "x" ? t : t & 3 | 8).toString(16);
1001
1009
  }));
1002
1010
  }
1003
- function Xt() {
1011
+ function te() {
1004
1012
  const e = "test-local-storage";
1005
1013
  try {
1006
1014
  return localStorage.setItem(e, e), localStorage.removeItem(e), !0;
1007
1015
  } catch {
1008
- return m.warn("localStorage not available, session ID will not persist"), !1;
1016
+ return g.warn("localStorage not available, session ID will not persist"), !1;
1009
1017
  }
1010
1018
  }
1011
- function De(e) {
1019
+ function Be(e) {
1012
1020
  try {
1013
1021
  const t = localStorage.getItem(e);
1014
1022
  return t ? JSON.parse(t) : void 0;
1015
1023
  } catch (t) {
1016
- m.warn(`Failed to get item from localStorage: ${e}`, t);
1024
+ g.warn(`Failed to get item from localStorage: ${e}`, t);
1017
1025
  return;
1018
1026
  }
1019
1027
  }
1020
- function Re(e, t) {
1028
+ function Ue(e, t) {
1021
1029
  try {
1022
1030
  return localStorage.setItem(e, JSON.stringify(t)), !0;
1023
1031
  } catch (o) {
1024
- return m.warn(`Failed to set item in localStorage: ${e}`, o), !1;
1032
+ return g.warn(`Failed to set item in localStorage: ${e}`, o), !1;
1025
1033
  }
1026
1034
  }
1027
- async function $e() {
1028
- const e = Io, t = zo;
1029
- if (Xt()) {
1030
- const o = De(e);
1035
+ async function Se() {
1036
+ const e = Lo, t = Do;
1037
+ if (te()) {
1038
+ const o = Be(e);
1031
1039
  if (o && o.id && o.timestamp && Date.now() - o.timestamp < t)
1032
- return m.debug("Using existing session ID from localStorage"), o.id;
1033
- m.debug(
1040
+ return g.debug("Using existing session ID from localStorage"), o.id;
1041
+ g.debug(
1034
1042
  o ? "Session ID expired" : "No session ID found",
1035
1043
  "generating new one"
1036
1044
  );
1037
- const r = we();
1038
- return Re(e, {
1045
+ const r = $e();
1046
+ return Ue(e, {
1039
1047
  id: r,
1040
1048
  timestamp: Date.now()
1041
- }) ? m.debug("Generated and stored new session ID") : m.warn("Generated session ID but failed to store it"), r;
1049
+ }) ? g.debug("Generated and stored new session ID") : g.warn("Generated session ID but failed to store it"), r;
1042
1050
  } else {
1043
- const o = we();
1044
- return m.debug("Generated non-persistent session ID"), o;
1051
+ const o = $e();
1052
+ return g.debug("Generated non-persistent session ID"), o;
1045
1053
  }
1046
1054
  }
1047
- function Et(e) {
1055
+ function ft(e) {
1048
1056
  if (!e || typeof e != "object")
1049
1057
  return 0;
1050
1058
  let t = 0, o = 0, r = 0;
@@ -1057,7 +1065,7 @@ function Et(e) {
1057
1065
  const s = t / r * 100, i = o / r * 100;
1058
1066
  return Math.round(s - i);
1059
1067
  }
1060
- function Mo(e) {
1068
+ function No(e) {
1061
1069
  if (!e || typeof e != "object")
1062
1070
  return { promoters: 0, passives: 0, detractors: 0 };
1063
1071
  let t = 0, o = 0, r = 0;
@@ -1067,14 +1075,14 @@ function Mo(e) {
1067
1075
  }
1068
1076
  return { promoters: t, passives: o, detractors: r };
1069
1077
  }
1070
- function Lo(e, t) {
1078
+ function Ro(e, t) {
1071
1079
  const o = {};
1072
1080
  for (const r of t)
1073
1081
  o[r] = e[r] || 0;
1074
1082
  return o;
1075
1083
  }
1076
- function No(e, t) {
1077
- const o = t ? Lo(e, t) : e;
1084
+ function Ce(e, t) {
1085
+ const o = t ? Ro(e, t) : e;
1078
1086
  let r = 0, s = 0;
1079
1087
  for (const [a, l] of Object.entries(o)) {
1080
1088
  s += l;
@@ -1083,7 +1091,7 @@ function No(e, t) {
1083
1091
  }
1084
1092
  return { avg: s > 0 ? Math.round(r / s * 10) / 10 : 0, count: s, sum: r, breakdown: o };
1085
1093
  }
1086
- function D() {
1094
+ function N() {
1087
1095
  return {
1088
1096
  count: 0,
1089
1097
  sum: 0,
@@ -1093,26 +1101,26 @@ function D() {
1093
1101
  updated: (/* @__PURE__ */ new Date()).toISOString()
1094
1102
  };
1095
1103
  }
1096
- function Do(e) {
1097
- if (!Xt())
1098
- return D();
1104
+ function Bo(e) {
1105
+ if (!te())
1106
+ return N();
1099
1107
  try {
1100
- const t = De(e);
1101
- return t ? { ...D(), ...t } : D();
1108
+ const t = Be(e);
1109
+ return t ? { ...N(), ...t } : N();
1102
1110
  } catch (t) {
1103
- return m.warn("Failed to load localStats from localStorage", t), D();
1111
+ return g.warn("Failed to load localStats from localStorage", t), N();
1104
1112
  }
1105
1113
  }
1106
- function Ro(e, t) {
1107
- if (!Xt())
1114
+ function Uo(e, t) {
1115
+ if (!te())
1108
1116
  return !1;
1109
1117
  try {
1110
- return Re(e, t) ? (m.debug("Saved localStats to localStorage", t), !0) : !1;
1118
+ return Ue(e, t) ? (g.debug("Saved localStats to localStorage", t), !0) : !1;
1111
1119
  } catch (o) {
1112
- return m.warn("Failed to save localStats to localStorage", o), !1;
1120
+ return g.warn("Failed to save localStats to localStorage", o), !1;
1113
1121
  }
1114
1122
  }
1115
- function Bo(e, t) {
1123
+ function Vo(e, t) {
1116
1124
  const o = {
1117
1125
  count: Math.max(0, e.count - t.count),
1118
1126
  sum: (e.sum || 0) - (t.sum || 0),
@@ -1125,11 +1133,11 @@ function Bo(e, t) {
1125
1133
  if (o.count > 0 && o.sum !== void 0 ? o.avg = Math.round(o.sum / o.count * 100) / 100 : o.avg = 0, t.breakdown && o.breakdown)
1126
1134
  for (const [r, s] of Object.entries(t.breakdown))
1127
1135
  o.breakdown[r] && (o.breakdown[r] = Math.max(0, o.breakdown[r] - s), o.breakdown[r] === 0 && delete o.breakdown[r]);
1128
- return o.nps = Et((o == null ? void 0 : o.breakdown) || {}), o;
1136
+ return o.nps = ft((o == null ? void 0 : o.breakdown) || {}), o;
1129
1137
  }
1130
- function Uo(e, t) {
1138
+ function jo(e, t) {
1131
1139
  if (!e.count && !t.count)
1132
- return D();
1140
+ return N();
1133
1141
  if (!e.count)
1134
1142
  return { ...t };
1135
1143
  const o = {
@@ -1146,12 +1154,12 @@ function Uo(e, t) {
1146
1154
  for (const [r, s] of Object.entries(t.breakdown))
1147
1155
  o.breakdown[r] = (o.breakdown[r] || 0) + s;
1148
1156
  }
1149
- return o.nps = Et((o == null ? void 0 : o.breakdown) || {}), o;
1157
+ return o.nps = ft((o == null ? void 0 : o.breakdown) || {}), o;
1150
1158
  }
1151
- function Be(e) {
1159
+ function Ve(e) {
1152
1160
  return !e || typeof e != "string" ? !1 : /^[\p{Emoji}]$/u.test(e) ? !0 : new RegExp("^\\p{Emoji}(\\p{Emoji_Modifier}|\\u200D\\p{Emoji})*$", "u").test(e);
1153
1161
  }
1154
- function _t(e) {
1162
+ function Ot(e) {
1155
1163
  if (!e || typeof e != "string")
1156
1164
  return !1;
1157
1165
  const t = e.trim();
@@ -1165,7 +1173,7 @@ function _t(e) {
1165
1173
  return !1;
1166
1174
  }
1167
1175
  }
1168
- function Vo(e) {
1176
+ function qo(e) {
1169
1177
  if (!e || typeof e != "string")
1170
1178
  return [];
1171
1179
  const t = e.trim();
@@ -1180,28 +1188,36 @@ function Vo(e) {
1180
1188
  }
1181
1189
  return t.split(",").map((o) => o.trim()).filter((o) => o !== "");
1182
1190
  }
1183
- function jo(e, t) {
1191
+ function Ho(e, t) {
1184
1192
  const o = /{([^{}]+)}/g;
1185
1193
  return e.replace(o, (r, s) => {
1186
1194
  const i = s.trim(), a = t[i];
1187
1195
  return a !== void 0 ? String(a) : r;
1188
1196
  });
1189
1197
  }
1190
- function qo(e, t) {
1198
+ function Fo(e, t) {
1191
1199
  let o = 2166136261;
1192
1200
  const r = e + ":" + t;
1193
1201
  for (let s = 0; s < r.length; s++)
1194
1202
  o ^= r.charCodeAt(s), o += (o << 1) + (o << 4) + (o << 7) + (o << 8) + (o << 24);
1195
1203
  return (o >>> 0).toString(16).padStart(8, "0");
1196
1204
  }
1197
- function Ho(e, t = 50) {
1205
+ function Yo(e, t = 50) {
1198
1206
  return e.length <= t ? e : e.substring(0, t).trim() + "...";
1199
1207
  }
1200
- const Se = 5;
1201
- class Fo {
1208
+ const Wt = /* @__PURE__ */ new Map();
1209
+ function Wo(e, t) {
1210
+ Wt.set(e, t);
1211
+ }
1212
+ function Ko(e) {
1213
+ const t = Wt.get(e);
1214
+ return t && Wt.delete(e), t;
1215
+ }
1216
+ const ke = 5;
1217
+ class Go {
1202
1218
  // Tracks if user has ever made a selection (even if later deselected)
1203
1219
  constructor(t) {
1204
- this.stats = D(), this.localStats = D(), this.prevLocalStats = D(), this.isLoading = !0, this.isLoadingConfig = !1, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
1220
+ this.stats = N(), this.localStats = N(), this.prevLocalStats = N(), this.isLoading = !0, this.isLoadingConfig = !1, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
1205
1221
  }
1206
1222
  hostConnected() {
1207
1223
  this.loadStats();
@@ -1212,13 +1228,13 @@ class Fo {
1212
1228
  */
1213
1229
  validateWidgetIdentifier() {
1214
1230
  const t = this.host;
1215
- return t.widgetId ? /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.widgetId) ? { type: "registered" } : { type: "none", error: `Invalid widget-id format: ${t.widgetId}` } : t.name ? t.name.length < Se ? {
1231
+ return t.widgetId ? /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.widgetId) ? { type: "registered" } : { type: "none", error: `Invalid widget-id format: ${t.widgetId}` } : t.name ? t.name.length < ke ? {
1216
1232
  type: "none",
1217
- error: `Widget name must be at least ${Se} characters long. Got: "${t.name}"`
1233
+ error: `Widget name must be at least ${ke} characters long. Got: "${t.name}"`
1218
1234
  } : { type: "public" } : { type: "none", error: "Widget requires either widget-id or name attribute" };
1219
1235
  }
1220
1236
  async getLocalStatsKey() {
1221
- const t = this.host, o = await $e(), r = t.widgetId || t.name || "unnamed";
1237
+ const t = this.host, o = await Se(), r = t.widgetId || t.name || "unnamed";
1222
1238
  return `pc-local-stats-${o}-${r}`;
1223
1239
  }
1224
1240
  /**
@@ -1238,7 +1254,7 @@ class Fo {
1238
1254
  for (const [s, i] of Object.entries(t)) {
1239
1255
  if (i == null) continue;
1240
1256
  const a = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1241
- typeof i == "boolean" ? i ? r.setAttribute(a, "") : r.removeAttribute(a) : typeof i == "object" ? r.setAttribute(a, JSON.stringify(i)) : r.setAttribute(a, String(i)), m.debug(`Applied widget attribute: ${a}=${i}`);
1257
+ typeof i == "boolean" ? i ? r.setAttribute(a, "") : r.removeAttribute(a) : typeof i == "object" ? r.setAttribute(a, JSON.stringify(i)) : r.setAttribute(a, String(i)), g.debug(`Applied widget attribute: ${a}=${i}`);
1242
1258
  }
1243
1259
  }
1244
1260
  /**
@@ -1250,61 +1266,78 @@ class Fo {
1250
1266
  this.isLoading = !1, this.stats = this.localStats, this.host.requestUpdate();
1251
1267
  const o = this.validateWidgetIdentifier();
1252
1268
  if (o.error) {
1253
- m.error(o.error);
1269
+ g.error(o.error);
1254
1270
  return;
1255
1271
  }
1272
+ if (o.type === "registered" && t.widgetId) {
1273
+ const a = Ko(t.widgetId);
1274
+ if (a) {
1275
+ g.debug("Using prefetched config from cache", { widgetId: t.widgetId }), this.applyWidgetAttributes(a.attributes);
1276
+ const l = this.getOptionsForDataFunc(t), n = Ce(a.stats.breakdown, l), d = n.count, p = n.sum, h = d > 0 ? Math.round(p / d * 10) / 10 : 0, v = d > 0 ? Math.round(p / d * 100) : 0;
1277
+ this.stats = {
1278
+ count: d,
1279
+ sum: p,
1280
+ avg: h,
1281
+ pct: v,
1282
+ nps: t.type === S.nps ? ft(n.breakdown) : 0,
1283
+ breakdown: n.breakdown,
1284
+ updated: a.stats.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
1285
+ }, this.isLoading = !1, this.isLoadingConfig = !1, this.host.requestUpdate();
1286
+ return;
1287
+ }
1288
+ }
1256
1289
  try {
1257
1290
  const a = t.type;
1258
1291
  let l;
1259
1292
  if (t.dataFunc && typeof window < "u") {
1260
- const w = t.dataFunc.replace(/^window\./, "").split(".");
1261
- let A = window;
1262
- for (const W of w)
1263
- if (A = A == null ? void 0 : A[W], A === void 0) break;
1264
- l = A;
1293
+ const y = t.dataFunc.replace(/^window\./, "").split(".");
1294
+ let E = window;
1295
+ for (const G of y)
1296
+ if (E = E == null ? void 0 : E[G], E === void 0) break;
1297
+ l = E;
1265
1298
  }
1266
1299
  let n, d = null;
1267
1300
  if (l && typeof l == "function") {
1268
- const C = this.getOptionsForDataFunc(t);
1269
- m.debug(`Using data function for: ${t.widgetId || t.name}`, {
1301
+ const $ = this.getOptionsForDataFunc(t);
1302
+ g.debug(`Using data function for: ${t.widgetId || t.name}`, {
1270
1303
  dataFuncName: t.dataFunc,
1271
- options: C
1304
+ options: $
1272
1305
  });
1273
- const w = await l(t.widgetId, t.name, C);
1274
- if (w && typeof w == "object" && "success" in w && "data" in w) {
1275
- if (!w.success)
1276
- throw m.error("Custom data function returned unsuccessful response", w), new Error("Custom data function returned unsuccessful response");
1277
- n = w.data || {};
1306
+ const y = await l(t.widgetId, t.name, $);
1307
+ if (y && typeof y == "object" && "success" in y && "data" in y) {
1308
+ if (!y.success)
1309
+ throw g.error("Custom data function returned unsuccessful response", y), new Error("Custom data function returned unsuccessful response");
1310
+ n = y.data || {};
1278
1311
  } else
1279
- n = w || {};
1312
+ n = y || {};
1280
1313
  } else {
1281
- const C = t.dataEndpoint || xe;
1282
- let w;
1283
- o.type === "registered" ? (w = `${C}/widgets/${encodeURIComponent(t.widgetId)}`, this.isLoadingConfig = !0, this.host.requestUpdate()) : w = `${C}/public-widgets/${encodeURIComponent(t.name)}`, m.debug("Fetching stats for widget", {
1284
- endpoint: w,
1314
+ const $ = t.dataEndpoint || Yt;
1315
+ let y;
1316
+ o.type === "registered" ? (y = `${$}/widgets/${encodeURIComponent(t.widgetId)}`, this.isLoadingConfig = !0, this.host.requestUpdate()) : y = `${$}/public-widgets/${encodeURIComponent(t.name)}`, g.debug("Fetching stats for widget", {
1317
+ endpoint: y,
1285
1318
  type: o.type
1286
1319
  });
1287
- const A = await fetch(w);
1288
- if (!A.ok)
1289
- throw new Error(`API request failed with status: ${A.status}`);
1290
- const W = await A.json();
1291
- if (!W.success)
1292
- throw m.error("Backend returned unsuccessful response", W), new Error("Backend returned unsuccessful response");
1293
- o.type === "registered" ? (d = ((s = (r = W.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null, n = ((i = W.data) == null ? void 0 : i.stats) || {}) : n = W.data || {};
1320
+ const E = await fetch(y);
1321
+ if (!E.ok)
1322
+ throw new Error(`API request failed with status: ${E.status}`);
1323
+ const G = await E.json();
1324
+ if (!G.success)
1325
+ throw g.error("Backend returned unsuccessful response", G), new Error("Backend returned unsuccessful response");
1326
+ o.type === "registered" ? (d = ((s = (r = G.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null, n = ((i = G.data) == null ? void 0 : i.stats) || {}) : n = G.data || {};
1294
1327
  }
1295
1328
  d && !l && this.applyWidgetAttributes(d);
1296
- const p = this.getOptionsForDataFunc(t), h = No(n.breakdown ?? {}, p), b = h.count, x = h.sum, E = b > 0 ? Math.round(x / b * 10) / 10 : 0, z = b > 0 ? Math.round(x / b * 100) : 0, M = {
1297
- count: b,
1329
+ const p = this.getOptionsForDataFunc(t), h = Ce(n.breakdown ?? {}, p), v = h.count, x = h.sum, k = v > 0 ? Math.round(x / v * 10) / 10 : 0, P = v > 0 ? Math.round(x / v * 100) : 0, _ = {
1330
+ count: v,
1298
1331
  sum: x,
1299
- avg: E,
1300
- pct: z,
1301
- nps: a === S.nps ? Et(h.breakdown) : 0,
1332
+ avg: k,
1333
+ pct: P,
1334
+ nps: a === S.nps ? ft(h.breakdown) : 0,
1302
1335
  breakdown: h.breakdown,
1303
1336
  updated: n.updatedAt || n.updated_at || (/* @__PURE__ */ new Date()).toISOString()
1304
1337
  };
1305
- this.stats = M;
1338
+ this.stats = _;
1306
1339
  } catch (a) {
1307
- throw m.error("Error loading stats:", a, this.localStats), a;
1340
+ throw g.error("Error loading stats:", a, this.localStats), a;
1308
1341
  } finally {
1309
1342
  this.isLoading = !1, this.isLoadingConfig = !1, this.host.requestUpdate();
1310
1343
  }
@@ -1335,10 +1368,10 @@ class Fo {
1335
1368
  async loadLocalStats() {
1336
1369
  const t = await this.getLocalStatsKey();
1337
1370
  try {
1338
- const o = Do(t);
1339
- m.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
1371
+ const o = Bo(t);
1372
+ g.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
1340
1373
  } catch (o) {
1341
- m.warn("Failed to generate localStorage key for localStats", o), this.localStats = D();
1374
+ g.warn("Failed to generate localStorage key for localStats", o), this.localStats = N();
1342
1375
  }
1343
1376
  this.host.requestUpdate();
1344
1377
  }
@@ -1348,9 +1381,9 @@ class Fo {
1348
1381
  async persistLocalStats() {
1349
1382
  try {
1350
1383
  const t = await this.getLocalStatsKey();
1351
- Ro(t, this.localStats) || m.warn("Failed to save localStats to localStorage");
1384
+ Uo(t, this.localStats) || g.warn("Failed to save localStats to localStorage");
1352
1385
  } catch (t) {
1353
- m.warn("Failed to save localStats to localStorage", t);
1386
+ g.warn("Failed to save localStats to localStorage", t);
1354
1387
  }
1355
1388
  }
1356
1389
  /**
@@ -1362,7 +1395,7 @@ class Fo {
1362
1395
  * @param textValues
1363
1396
  */
1364
1397
  updateStats(t, o) {
1365
- if (this.hasInteracted = !0, this.stats && (this.stats = Bo(this.stats, this.localStats)), this.localStats = {
1398
+ if (this.hasInteracted = !0, this.stats && (this.stats = Vo(this.stats, this.localStats)), this.localStats = {
1366
1399
  count: t > 0 || o.length > 0 ? 1 : 0,
1367
1400
  sum: t,
1368
1401
  // e.g. number of stars, nps value
@@ -1376,15 +1409,15 @@ class Fo {
1376
1409
  }, o && o.length > 0)
1377
1410
  for (const r of o)
1378
1411
  r && (this.localStats.breakdown[r] = 1);
1379
- this.stats = Uo(this.stats, this.localStats), m.debug("Stats updated - remote: ", this.stats), m.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
1412
+ this.stats = jo(this.stats, this.localStats), g.debug("Stats updated - remote: ", this.stats), g.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
1380
1413
  }
1381
1414
  async markStatsAsSubmitted() {
1382
1415
  this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), this.prevLocalStats = { ...this.localStats }, await this.persistLocalStats(), this.host.requestUpdate();
1383
1416
  }
1384
1417
  async submitStats() {
1385
1418
  if (!this.hasLocalStats() && !this.hasInteracted)
1386
- throw m.warn("No local stats to submit"), new Error("No local stats to submit");
1387
- const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await $e(), s = this.localStats.sum, i = Object.keys(this.localStats.breakdown || {}), a = this.prevLocalStats.sum, l = Object.keys(this.prevLocalStats.breakdown || {});
1419
+ throw g.warn("No local stats to submit"), new Error("No local stats to submit");
1420
+ const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await Se(), s = this.localStats.sum, i = Object.keys(this.localStats.breakdown || {}), a = this.prevLocalStats.sum, l = Object.keys(this.prevLocalStats.breakdown || {});
1388
1421
  this.isSubmitting = !0, this.host.requestUpdate();
1389
1422
  const n = {
1390
1423
  sessionId: r,
@@ -1398,11 +1431,11 @@ class Fo {
1398
1431
  prevTextValues: l,
1399
1432
  metadata: t.metadata,
1400
1433
  timestamp: o
1401
- }, d = qo(JSON.stringify(n), o);
1434
+ }, d = Fo(JSON.stringify(n), o);
1402
1435
  try {
1403
1436
  await this.sendStats({ ...n, hash: d }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(n);
1404
1437
  } catch (p) {
1405
- m.warn("Failed to send stats event", p);
1438
+ g.warn("Failed to send stats event", p);
1406
1439
  } finally {
1407
1440
  this.isSubmitting = !1, this.host.requestUpdate();
1408
1441
  }
@@ -1411,25 +1444,25 @@ class Fo {
1411
1444
  async sendStats(t) {
1412
1445
  const o = this.host;
1413
1446
  if (o.dataFunc) {
1414
- m.debug("Skip sending stats as data function is in use.");
1447
+ g.debug("Skip sending stats as data function is in use.");
1415
1448
  return;
1416
1449
  }
1417
1450
  const r = this.validateWidgetIdentifier();
1418
1451
  if (r.error)
1419
- throw m.error(r.error), new Error(r.error);
1420
- const s = o.dataEndpoint || xe;
1421
- if (!_t(s))
1422
- throw m.error("Invalid data endpoint", { dataEndpoint: s }), new Error(`Invalid data endpoint: ${s}`);
1452
+ throw g.error(r.error), new Error(r.error);
1453
+ const s = o.dataEndpoint || Yt;
1454
+ if (!Ot(s))
1455
+ throw g.error("Invalid data endpoint", { dataEndpoint: s }), new Error(`Invalid data endpoint: ${s}`);
1423
1456
  let i;
1424
1457
  r.type === "registered" ? i = `${s}/widgets/${encodeURIComponent(o.widgetId)}` : i = `${s}/public-widgets/${encodeURIComponent(o.name)}`;
1425
1458
  const a = JSON.stringify(t);
1426
1459
  try {
1427
- if (m.debug("Sending stats", { endpoint: i, event: t }), typeof navigator < "u" && navigator.sendBeacon)
1460
+ if (g.debug("Sending stats", { endpoint: i, event: t }), typeof navigator < "u" && navigator.sendBeacon)
1428
1461
  if (navigator.sendBeacon(i, a)) {
1429
- m.debug("Successfully sent stats via sendBeacon");
1462
+ g.debug("Successfully sent stats via sendBeacon");
1430
1463
  return;
1431
1464
  } else
1432
- m.debug("sendBeacon failed, falling back to fetch");
1465
+ g.debug("sendBeacon failed, falling back to fetch");
1433
1466
  const l = await fetch(i, {
1434
1467
  body: a,
1435
1468
  method: "POST",
@@ -1440,9 +1473,9 @@ class Fo {
1440
1473
  });
1441
1474
  if (!l.ok)
1442
1475
  throw new Error(`API request failed with status: ${l.status}`);
1443
- m.debug("Successfully sent stats via fetch");
1476
+ g.debug("Successfully sent stats via fetch");
1444
1477
  } catch (l) {
1445
- throw m.error("Failed to send analytics:", l), l;
1478
+ throw g.error("Failed to send analytics:", l), l;
1446
1479
  }
1447
1480
  }
1448
1481
  /**
@@ -1457,9 +1490,9 @@ class Fo {
1457
1490
  sum: (o == null ? void 0 : o.sum) || 0,
1458
1491
  avg: s,
1459
1492
  pct: (o == null ? void 0 : o.pct) || 0,
1460
- nps: r.type === S.nps ? Et((o == null ? void 0 : o.breakdown) || {}) : 0
1493
+ nps: r.type === S.nps ? ft((o == null ? void 0 : o.breakdown) || {}) : 0
1461
1494
  };
1462
- return m.debug("Stats data: ", this.stats), jo(t, i);
1495
+ return g.debug("Stats data: ", this.stats), Ho(t, i);
1463
1496
  }
1464
1497
  /**
1465
1498
  * Checks if a value is selected in the local stats
@@ -1519,7 +1552,7 @@ class Fo {
1519
1552
  bubbles: !0,
1520
1553
  composed: !0
1521
1554
  });
1522
- t.dispatchEvent(i), m.debug("Dispatched change event", s);
1555
+ t.dispatchEvent(i), g.debug("Dispatched change event", s);
1523
1556
  }
1524
1557
  /**
1525
1558
  * Dispatches a 'submit' CustomEvent on the host element
@@ -1531,7 +1564,7 @@ class Fo {
1531
1564
  bubbles: !0,
1532
1565
  composed: !0
1533
1566
  });
1534
- o.dispatchEvent(r), m.debug("Dispatched submit event", t);
1567
+ o.dispatchEvent(r), g.debug("Dispatched submit event", t);
1535
1568
  }
1536
1569
  hasLocalStats() {
1537
1570
  var t;
@@ -1546,7 +1579,7 @@ class Fo {
1546
1579
  return ((t = this.localStats) == null ? void 0 : t.submitted) !== void 0 && this.hasLocalStats();
1547
1580
  }
1548
1581
  }
1549
- class Yo {
1582
+ class Zo {
1550
1583
  constructor(t, o) {
1551
1584
  this.isEditing = !0, this.isChartVisible = !1, this.isStatsVisible = !1, this.isThankYouVisible = !1, this.isReactionPopoverVisible = !1, this.initialized = !1, this.handleClickOutside = (r) => {
1552
1585
  r.target !== this.host && (this.toggleThankYouVisibility(!1), this.toggleReactionPopoverVisibility(!1));
@@ -1634,8 +1667,8 @@ class Yo {
1634
1667
  return !(this.host.readonly || !this.isEditing);
1635
1668
  }
1636
1669
  }
1637
- var Qt = /* @__PURE__ */ ((e) => (e.DECORATIVE = "decorative", e.FUNCTIONAL = "functional", e.STATUS = "status", e))(Qt || {});
1638
- function Ue(e, t = {}) {
1670
+ var ee = /* @__PURE__ */ ((e) => (e.DECORATIVE = "decorative", e.FUNCTIONAL = "functional", e.STATUS = "status", e))(ee || {});
1671
+ function je(e, t = {}) {
1639
1672
  const { type: o = "functional", alt: r, ariaLabel: s, isSelected: i } = t;
1640
1673
  if (!e)
1641
1674
  return { alt: "", ariaHidden: !0 };
@@ -1644,20 +1677,20 @@ function Ue(e, t = {}) {
1644
1677
  o === "functional" && !r && !s && console.warn(
1645
1678
  "No alt text or aria-label provided for functional icon. This may cause accessibility issues."
1646
1679
  );
1647
- const a = i ? " (selected)" : "", l = _t(e) && !r ? "" : r || e, n = s || (l ? `${l}${a}` : a);
1680
+ const a = i ? " (selected)" : "", l = Ot(e) && !r ? "" : r || e, n = s || (l ? `${l}${a}` : a);
1648
1681
  return {
1649
1682
  alt: l,
1650
1683
  ariaLabel: n,
1651
1684
  ariaHidden: !1
1652
1685
  };
1653
1686
  }
1654
- function Ko(e, t = "polite") {
1687
+ function Jo(e, t = "polite") {
1655
1688
  let o = document.getElementById("screen-reader-announcer");
1656
1689
  o ? o.setAttribute("aria-live", t) : (o = document.createElement("div"), o.id = "screen-reader-announcer", o.setAttribute("aria-live", t), o.setAttribute("role", "status"), o.setAttribute("aria-atomic", "true"), o.style.position = "absolute", o.style.width = "1px", o.style.height = "1px", o.style.margin = "-1px", o.style.padding = "0", o.style.overflow = "hidden", o.style.clip = "rect(0, 0, 0, 0)", o.style.whiteSpace = "nowrap", o.style.border = "0", document.body.appendChild(o)), o.textContent = "", setTimeout(() => {
1657
1690
  o.textContent = e;
1658
1691
  }, 50);
1659
1692
  }
1660
- function Wo(e, t) {
1693
+ function Xo(e, t) {
1661
1694
  return `${e}: ${t}`;
1662
1695
  }
1663
1696
  /**
@@ -1665,8 +1698,8 @@ function Wo(e, t) {
1665
1698
  * Copyright 2017 Google LLC
1666
1699
  * SPDX-License-Identifier: BSD-3-Clause
1667
1700
  */
1668
- const Ve = { ATTRIBUTE: 1 }, je = (e) => (...t) => ({ _$litDirective$: e, values: t });
1669
- let qe = class {
1701
+ const qe = { ATTRIBUTE: 1 }, He = (e) => (...t) => ({ _$litDirective$: e, values: t });
1702
+ let Fe = class {
1670
1703
  constructor(t) {
1671
1704
  }
1672
1705
  get _$AU() {
@@ -1687,10 +1720,10 @@ let qe = class {
1687
1720
  * Copyright 2018 Google LLC
1688
1721
  * SPDX-License-Identifier: BSD-3-Clause
1689
1722
  */
1690
- const y = je(class extends qe {
1723
+ const w = He(class extends Fe {
1691
1724
  constructor(e) {
1692
1725
  var t;
1693
- if (super(e), e.type !== Ve.ATTRIBUTE || e.name !== "class" || ((t = e.strings) == null ? void 0 : t.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
1726
+ if (super(e), e.type !== qe.ATTRIBUTE || e.name !== "class" || ((t = e.strings) == null ? void 0 : t.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
1694
1727
  }
1695
1728
  render(e) {
1696
1729
  return " " + Object.keys(e).filter((t) => e[t]).join(" ") + " ";
@@ -1711,18 +1744,18 @@ const y = je(class extends qe {
1711
1744
  return H;
1712
1745
  }
1713
1746
  });
1714
- var Go = Object.defineProperty, v = (e, t, o, r) => {
1747
+ var Qo = Object.defineProperty, b = (e, t, o, r) => {
1715
1748
  for (var s = void 0, i = e.length - 1, a; i >= 0; i--)
1716
1749
  (a = e[i]) && (s = a(t, o, s) || s);
1717
- return s && Go(t, o, s), s;
1750
+ return s && Qo(t, o, s), s;
1718
1751
  };
1719
- const xt = {
1752
+ const $t = {
1720
1753
  mobile: "480px",
1721
1754
  tablet: "768px",
1722
1755
  desktop: "1024px"
1723
- }, te = class te extends R {
1756
+ }, oe = class oe extends R {
1724
1757
  constructor() {
1725
- super(...arguments), this.dataController = new Fo(this), this.displayController = new Yo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.ariaLabel = null, this.minContrast = Ne.AA_NORMAL, this.options = [], this.questionPosition = "top", this.statsText = "{count} votes", this.buttonText = "Submit", this.buttonRadius = "sm", this.multiple = !1, this.inline = !1, this.readonly = !1, this.handleEditToggleKeyDown = (t) => {
1758
+ super(...arguments), this.dataController = new Go(this), this.displayController = new Zo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.ariaLabel = null, this.minContrast = Re.AA_NORMAL, this.options = [], this.questionPosition = "top", this.statsText = "{count} votes", this.buttonText = "Submit", this.buttonRadius = "sm", this.multiple = !1, this.inline = !1, this.readonly = !1, this.handleEditToggleKeyDown = (t) => {
1726
1759
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
1727
1760
  };
1728
1761
  }
@@ -1754,10 +1787,10 @@ const xt = {
1754
1787
  let o = `:host {
1755
1788
  `;
1756
1789
  if (this.primaryColor) {
1757
- const i = et(this.primaryColor);
1790
+ const i = ot(this.primaryColor);
1758
1791
  o += `--pc-primary-color: ${i} !important;
1759
1792
  `;
1760
- const a = Co(i, {
1793
+ const a = Ao(i, {
1761
1794
  minContrast: this.minContrast,
1762
1795
  colorOptions: ["black", "white", "light", "dark"]
1763
1796
  });
@@ -1765,27 +1798,27 @@ const xt = {
1765
1798
  `;
1766
1799
  }
1767
1800
  if (this.muteColor) {
1768
- const i = et(this.muteColor);
1801
+ const i = ot(this.muteColor);
1769
1802
  o += `--pc-mute-color: ${i} !important;
1770
1803
  `;
1771
1804
  }
1772
1805
  if (this.textColor) {
1773
- const i = et(this.textColor);
1806
+ const i = ot(this.textColor);
1774
1807
  o += `--pc-text-color: ${i} !important;
1775
1808
  `;
1776
1809
  }
1777
1810
  if (this.backgroundColor) {
1778
- const i = et(this.backgroundColor);
1811
+ const i = ot(this.backgroundColor);
1779
1812
  o += `--pc-background-color: ${i} !important;
1780
1813
  `;
1781
1814
  }
1782
1815
  const r = this.starColor || this.accentColor || this.primaryColor;
1783
1816
  if (r) {
1784
- const i = et(r);
1817
+ const i = ot(r);
1785
1818
  o += `--pc-star-color: ${i} !important;
1786
1819
  `;
1787
1820
  }
1788
- const s = this.starHoverColor || (r ? `color-mix(in srgb, ${et(r)} 80%, white)` : null);
1821
+ const s = this.starHoverColor || (r ? `color-mix(in srgb, ${ot(r)} 80%, white)` : null);
1789
1822
  if (s && (o += `--pc-star-hover-color: ${s} !important;
1790
1823
  `), this.starSize) {
1791
1824
  const i = qt(this.starSize, "1.5em", 1.5);
@@ -1803,12 +1836,12 @@ const xt = {
1803
1836
  `;
1804
1837
  }
1805
1838
  if (this.buttonRadius) {
1806
- const i = Eo(this.buttonRadius);
1839
+ const i = To(this.buttonRadius);
1807
1840
  o += `--pc-button-radius: ${i} !important;
1808
1841
  `;
1809
1842
  }
1810
1843
  o += `}
1811
- `, this.css && (o += Oo(_o(this.css))), t.textContent = o;
1844
+ `, this.css && (o += Mo(zo(this.css))), t.textContent = o;
1812
1845
  }
1813
1846
  /**
1814
1847
  * Update ARIA attributes for accessibility
@@ -1827,11 +1860,11 @@ const xt = {
1827
1860
  */
1828
1861
  getBreakpointClasses() {
1829
1862
  return {
1830
- "pc-mobile": window.matchMedia(`(max-width: ${xt.mobile})`).matches,
1863
+ "pc-mobile": window.matchMedia(`(max-width: ${$t.mobile})`).matches,
1831
1864
  "pc-tablet": window.matchMedia(
1832
- `(min-width: ${xt.mobile}) and (max-width: ${xt.tablet})`
1865
+ `(min-width: ${$t.mobile}) and (max-width: ${$t.tablet})`
1833
1866
  ).matches,
1834
- "pc-desktop": window.matchMedia(`(min-width: ${xt.desktop})`).matches
1867
+ "pc-desktop": window.matchMedia(`(min-width: ${$t.desktop})`).matches
1835
1868
  };
1836
1869
  }
1837
1870
  /**
@@ -1839,7 +1872,7 @@ const xt = {
1839
1872
  */
1840
1873
  announceSelectionChange(t, o, r) {
1841
1874
  const s = `Poll for "${t}"`, i = r ? `${o.label} selected` : `${o.label} unselected`;
1842
- Ko(Wo(s, i));
1875
+ Jo(Xo(s, i));
1843
1876
  }
1844
1877
  /** Common render methods */
1845
1878
  renderLabel() {
@@ -1870,7 +1903,7 @@ const xt = {
1870
1903
  tabindex="0"
1871
1904
  aria-label="Edit vote"
1872
1905
  @keydown="${this.handleEditToggleKeyDown}"
1873
- >${kt}</span
1906
+ >${At}</span
1874
1907
  >
1875
1908
  ` : u;
1876
1909
  }
@@ -1889,7 +1922,7 @@ const xt = {
1889
1922
  tabindex="0"
1890
1923
  aria-label="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
1891
1924
  @keydown="${() => this.displayController.toggleChartVisibility()}"
1892
- >${this.displayController.isChartVisible ? Jt : Zt}</span
1925
+ >${this.displayController.isChartVisible ? Qt : Xt}</span
1893
1926
  >
1894
1927
  ` : u;
1895
1928
  }
@@ -1898,9 +1931,9 @@ const xt = {
1898
1931
  return u;
1899
1932
  const o = {
1900
1933
  "pc-status": !0,
1901
- [`pc-flex-content-${O(this.statsPosition, this.statsAlign)}`]: !0
1934
+ [`pc-flex-content-${z(this.statsPosition, this.statsAlign)}`]: !0
1902
1935
  };
1903
- return c`<div class="${y(o)}" data-testid="pc-status">
1936
+ return c`<div class="${w(o)}" data-testid="pc-status">
1904
1937
  ${this.renderStatsText()} ${this.renderChartToggle()} ${this.renderEditToggleIcon()}
1905
1938
  </div>`;
1906
1939
  }
@@ -1916,7 +1949,7 @@ const xt = {
1916
1949
  renderThankYouMessage() {
1917
1950
  if (!this.displayController.shouldDisplayThankYouMsg())
1918
1951
  return u;
1919
- const t = Ho(this.thankYouMsg || "");
1952
+ const t = Yo(this.thankYouMsg || "");
1920
1953
  return c`
1921
1954
  <div class="pc-thank-you-overlay" data-testid="poll-thank-you-overlay">
1922
1955
  <div class="pc-thank-you" data-testid="thank-you">
@@ -1928,7 +1961,7 @@ const xt = {
1928
1961
  @click="${() => this.displayController.toggleThankYouVisibility(!1)}"
1929
1962
  role="button"
1930
1963
  aria-label="Close"
1931
- >${Tt}</span
1964
+ >${_t}</span
1932
1965
  >
1933
1966
  </div>
1934
1967
  </div>
@@ -1936,7 +1969,7 @@ const xt = {
1936
1969
  `;
1937
1970
  }
1938
1971
  };
1939
- te.styles = [
1972
+ oe.styles = [
1940
1973
  U`
1941
1974
  :host {
1942
1975
  /* Default values for CSS variables - can be overridden by external :root or parent definitions */
@@ -2017,113 +2050,113 @@ te.styles = [
2017
2050
  }
2018
2051
  `
2019
2052
  ];
2020
- let g = te;
2021
- v([
2053
+ let m = oe;
2054
+ b([
2022
2055
  f({ type: String, attribute: "show-stats" })
2023
- ], g.prototype, "showStats");
2024
- v([
2056
+ ], m.prototype, "showStats");
2057
+ b([
2025
2058
  f({ type: Boolean, attribute: "show-chart" })
2026
- ], g.prototype, "showChart");
2027
- v([
2059
+ ], m.prototype, "showChart");
2060
+ b([
2028
2061
  f({ type: Boolean, attribute: "initialized" })
2029
- ], g.prototype, "initialized");
2030
- v([
2062
+ ], m.prototype, "initialized");
2063
+ b([
2031
2064
  f({ type: String, attribute: "primary-color" })
2032
- ], g.prototype, "primaryColor");
2033
- v([
2065
+ ], m.prototype, "primaryColor");
2066
+ b([
2034
2067
  f({ type: String, attribute: "mute-color" })
2035
- ], g.prototype, "muteColor");
2036
- v([
2068
+ ], m.prototype, "muteColor");
2069
+ b([
2037
2070
  f({ type: String, attribute: "text-color" })
2038
- ], g.prototype, "textColor");
2039
- v([
2071
+ ], m.prototype, "textColor");
2072
+ b([
2040
2073
  f({ type: String, attribute: "background-color" })
2041
- ], g.prototype, "backgroundColor");
2042
- v([
2074
+ ], m.prototype, "backgroundColor");
2075
+ b([
2043
2076
  f({ type: String, attribute: "accent-color" })
2044
- ], g.prototype, "accentColor");
2045
- v([
2077
+ ], m.prototype, "accentColor");
2078
+ b([
2046
2079
  f({ type: String, attribute: "star-color" })
2047
- ], g.prototype, "starColor");
2048
- v([
2080
+ ], m.prototype, "starColor");
2081
+ b([
2049
2082
  f({ type: String, attribute: "star-hover-color" })
2050
- ], g.prototype, "starHoverColor");
2051
- v([
2083
+ ], m.prototype, "starHoverColor");
2084
+ b([
2052
2085
  f({ type: String, attribute: "star-size" })
2053
- ], g.prototype, "starSize");
2054
- v([
2086
+ ], m.prototype, "starSize");
2087
+ b([
2055
2088
  f({ type: String, attribute: "reaction-size" })
2056
- ], g.prototype, "reactionSize");
2057
- v([
2089
+ ], m.prototype, "reactionSize");
2090
+ b([
2058
2091
  f({ type: String })
2059
- ], g.prototype, "size");
2060
- v([
2092
+ ], m.prototype, "size");
2093
+ b([
2061
2094
  f({ type: String, attribute: "aria-label" })
2062
- ], g.prototype, "ariaLabel");
2063
- v([
2095
+ ], m.prototype, "ariaLabel");
2096
+ b([
2064
2097
  f({ type: String, attribute: "aria-describedby" })
2065
- ], g.prototype, "ariaDescribedby");
2066
- v([
2098
+ ], m.prototype, "ariaDescribedby");
2099
+ b([
2067
2100
  f({ type: Number, attribute: "min-contrast" })
2068
- ], g.prototype, "minContrast");
2069
- v([
2101
+ ], m.prototype, "minContrast");
2102
+ b([
2070
2103
  f({ type: String })
2071
- ], g.prototype, "css");
2072
- v([
2104
+ ], m.prototype, "css");
2105
+ b([
2073
2106
  f({ type: Array })
2074
- ], g.prototype, "options");
2075
- v([
2107
+ ], m.prototype, "options");
2108
+ b([
2076
2109
  f({ type: String, attribute: "widget-id" })
2077
- ], g.prototype, "widgetId");
2078
- v([
2110
+ ], m.prototype, "widgetId");
2111
+ b([
2079
2112
  f({ type: String, attribute: "name" })
2080
- ], g.prototype, "name");
2081
- v([
2113
+ ], m.prototype, "name");
2114
+ b([
2082
2115
  f({ type: String })
2083
- ], g.prototype, "metadata");
2084
- v([
2116
+ ], m.prototype, "metadata");
2117
+ b([
2085
2118
  f({ type: String, attribute: "data-func" })
2086
- ], g.prototype, "dataFunc");
2087
- v([
2119
+ ], m.prototype, "dataFunc");
2120
+ b([
2088
2121
  f({ type: String, attribute: "data-endpoint" })
2089
- ], g.prototype, "dataEndpoint");
2090
- v([
2122
+ ], m.prototype, "dataEndpoint");
2123
+ b([
2091
2124
  f({ type: String })
2092
- ], g.prototype, "question");
2093
- v([
2125
+ ], m.prototype, "question");
2126
+ b([
2094
2127
  f({ type: String, attribute: "question-position" })
2095
- ], g.prototype, "questionPosition");
2096
- v([
2128
+ ], m.prototype, "questionPosition");
2129
+ b([
2097
2130
  f({ type: String, attribute: "question-align" })
2098
- ], g.prototype, "questionAlign");
2099
- v([
2131
+ ], m.prototype, "questionAlign");
2132
+ b([
2100
2133
  f({ type: String, attribute: "stats-text" })
2101
- ], g.prototype, "statsText");
2102
- v([
2134
+ ], m.prototype, "statsText");
2135
+ b([
2103
2136
  f({ type: String, attribute: "stats-position" })
2104
- ], g.prototype, "statsPosition");
2105
- v([
2137
+ ], m.prototype, "statsPosition");
2138
+ b([
2106
2139
  f({ type: String, attribute: "stats-align" })
2107
- ], g.prototype, "statsAlign");
2108
- v([
2140
+ ], m.prototype, "statsAlign");
2141
+ b([
2109
2142
  f({ type: String, attribute: "button-text" })
2110
- ], g.prototype, "buttonText");
2111
- v([
2143
+ ], m.prototype, "buttonText");
2144
+ b([
2112
2145
  f({ type: String, attribute: "button-radius" })
2113
- ], g.prototype, "buttonRadius");
2114
- v([
2146
+ ], m.prototype, "buttonRadius");
2147
+ b([
2115
2148
  f({ type: String, attribute: "thank-you-msg" })
2116
- ], g.prototype, "thankYouMsg");
2117
- v([
2149
+ ], m.prototype, "thankYouMsg");
2150
+ b([
2118
2151
  f({ type: Boolean, attribute: "multiple" })
2119
- ], g.prototype, "multiple");
2120
- v([
2152
+ ], m.prototype, "multiple");
2153
+ b([
2121
2154
  f({ type: Boolean, reflect: !0 })
2122
- ], g.prototype, "inline");
2123
- v([
2155
+ ], m.prototype, "inline");
2156
+ b([
2124
2157
  f({ type: Boolean, reflect: !0 })
2125
- ], g.prototype, "readonly");
2126
- const Zo = U`
2158
+ ], m.prototype, "readonly");
2159
+ const tr = U`
2127
2160
  /* CSS variables inherit from parent - defaults are specified at usage sites */
2128
2161
 
2129
2162
  .pc-body {
@@ -2574,7 +2607,7 @@ const Zo = U`
2574
2607
  animation: none;
2575
2608
  }
2576
2609
  }
2577
- `, Ot = U`
2610
+ `, It = U`
2578
2611
  /* Default values for CSS variables - can be overridden by external :root or parent definitions */
2579
2612
  :host {
2580
2613
  --default-primary-color: #2196f3;
@@ -3293,7 +3326,7 @@ const Zo = U`
3293
3326
  opacity: 1;
3294
3327
  }
3295
3328
  }
3296
- `, Jo = U`
3329
+ `, er = U`
3297
3330
  :host {
3298
3331
  --popover-bg: light-dark(#ffffff, #1a1a1a);
3299
3332
  --popover-border: light-dark(#e0e0e0, #333333);
@@ -3415,12 +3448,12 @@ const Zo = U`
3415
3448
  max-width: 100%;
3416
3449
  }
3417
3450
  `;
3418
- var Xo = Object.defineProperty, Qo = Object.getOwnPropertyDescriptor, V = (e, t, o, r) => {
3419
- for (var s = r > 1 ? void 0 : r ? Qo(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3451
+ var or = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, V = (e, t, o, r) => {
3452
+ for (var s = r > 1 ? void 0 : r ? rr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3420
3453
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3421
- return r && s && Xo(t, o, s), s;
3454
+ return r && s && or(t, o, s), s;
3422
3455
  };
3423
- let _ = class extends R {
3456
+ let I = class extends R {
3424
3457
  constructor() {
3425
3458
  super(...arguments), this.open = !1, this.position = "auto", this.isClosing = !1, this.computedPosition = "bottom", this.popoverStyles = {}, this.arrowStyles = {}, this.updatePosition = () => {
3426
3459
  var h;
@@ -3428,8 +3461,8 @@ let _ = class extends R {
3428
3461
  const e = this.anchor.getBoundingClientRect(), t = window.innerWidth, o = window.innerHeight, r = 12, s = (h = this.popoverElement) == null ? void 0 : h.getBoundingClientRect(), i = (s == null ? void 0 : s.width) || 280, a = (s == null ? void 0 : s.height) || 200;
3429
3462
  let l = this.position;
3430
3463
  if (l === "auto") {
3431
- const b = o - e.bottom, x = e.top;
3432
- l = b >= a + r || b >= x ? "bottom" : "top";
3464
+ const v = o - e.bottom, x = e.top;
3465
+ l = v >= a + r || v >= x ? "bottom" : "top";
3433
3466
  }
3434
3467
  this.computedPosition = l;
3435
3468
  let n, d;
@@ -3493,7 +3526,7 @@ let _ = class extends R {
3493
3526
  return c`
3494
3527
  <div class="pc-popover-scrim" @click=${this.handleScrimClick}></div>
3495
3528
  <div
3496
- class=${y(e)}
3529
+ class=${w(e)}
3497
3530
  data-position=${this.computedPosition}
3498
3531
  style=${Object.entries(this.popoverStyles).map(([t, o]) => `${t}: ${o}`).join("; ")}
3499
3532
  role="dialog"
@@ -3509,35 +3542,35 @@ let _ = class extends R {
3509
3542
  `;
3510
3543
  }
3511
3544
  };
3512
- _.styles = [Jo];
3545
+ I.styles = [er];
3513
3546
  V([
3514
3547
  f({ type: Boolean, reflect: !0 })
3515
- ], _.prototype, "open", 2);
3548
+ ], I.prototype, "open", 2);
3516
3549
  V([
3517
3550
  f({ type: String })
3518
- ], _.prototype, "position", 2);
3551
+ ], I.prototype, "position", 2);
3519
3552
  V([
3520
3553
  f({ attribute: !1 })
3521
- ], _.prototype, "anchor", 2);
3554
+ ], I.prototype, "anchor", 2);
3522
3555
  V([
3523
- k()
3524
- ], _.prototype, "isClosing", 2);
3556
+ A()
3557
+ ], I.prototype, "isClosing", 2);
3525
3558
  V([
3526
- k()
3527
- ], _.prototype, "computedPosition", 2);
3559
+ A()
3560
+ ], I.prototype, "computedPosition", 2);
3528
3561
  V([
3529
- k()
3530
- ], _.prototype, "popoverStyles", 2);
3562
+ A()
3563
+ ], I.prototype, "popoverStyles", 2);
3531
3564
  V([
3532
- k()
3533
- ], _.prototype, "arrowStyles", 2);
3565
+ A()
3566
+ ], I.prototype, "arrowStyles", 2);
3534
3567
  V([
3535
- mt(".pc-popover")
3536
- ], _.prototype, "popoverElement", 2);
3537
- _ = V([
3538
- Y("pc-popover")
3539
- ], _);
3540
- const tr = U`
3568
+ bt(".pc-popover")
3569
+ ], I.prototype, "popoverElement", 2);
3570
+ I = V([
3571
+ W("pc-popover")
3572
+ ], I);
3573
+ const sr = U`
3541
3574
  :host {
3542
3575
  --sheet-bg: light-dark(#ffffff, #1a1a1a);
3543
3576
  --sheet-border: light-dark(#e0e0e0, #333333);
@@ -3650,10 +3683,10 @@ const tr = U`
3650
3683
  max-width: 100%;
3651
3684
  }
3652
3685
  `;
3653
- var er = Object.defineProperty, or = Object.getOwnPropertyDescriptor, tt = (e, t, o, r) => {
3654
- for (var s = r > 1 ? void 0 : r ? or(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3686
+ var ir = Object.defineProperty, ar = Object.getOwnPropertyDescriptor, et = (e, t, o, r) => {
3687
+ for (var s = r > 1 ? void 0 : r ? ar(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3655
3688
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3656
- return r && s && er(t, o, s), s;
3689
+ return r && s && ir(t, o, s), s;
3657
3690
  };
3658
3691
  let B = class extends R {
3659
3692
  constructor() {
@@ -3733,8 +3766,8 @@ let B = class extends R {
3733
3766
  dragging: this.isDragging
3734
3767
  };
3735
3768
  return c`
3736
- <div class=${y(e)} @click=${this.handleScrimClick}></div>
3737
- <div class=${y(t)} role="dialog" aria-modal="true" tabindex="-1">
3769
+ <div class=${w(e)} @click=${this.handleScrimClick}></div>
3770
+ <div class=${w(t)} role="dialog" aria-modal="true" tabindex="-1">
3738
3771
  <div
3739
3772
  class="pc-sheet-handle"
3740
3773
  @touchstart=${this.handleDragStart}
@@ -3749,35 +3782,35 @@ let B = class extends R {
3749
3782
  `;
3750
3783
  }
3751
3784
  };
3752
- B.styles = [tr];
3753
- tt([
3785
+ B.styles = [sr];
3786
+ et([
3754
3787
  f({ type: Boolean, reflect: !0 })
3755
3788
  ], B.prototype, "open", 2);
3756
- tt([
3789
+ et([
3757
3790
  f({ type: Boolean, attribute: "drag-to-close" })
3758
3791
  ], B.prototype, "dragToClose", 2);
3759
- tt([
3760
- k()
3792
+ et([
3793
+ A()
3761
3794
  ], B.prototype, "isClosing", 2);
3762
- tt([
3763
- k()
3795
+ et([
3796
+ A()
3764
3797
  ], B.prototype, "isDragging", 2);
3765
- tt([
3766
- k()
3798
+ et([
3799
+ A()
3767
3800
  ], B.prototype, "dragOffset", 2);
3768
- tt([
3769
- mt(".pc-bottom-sheet")
3801
+ et([
3802
+ bt(".pc-bottom-sheet")
3770
3803
  ], B.prototype, "sheetElement", 2);
3771
- B = tt([
3772
- Y("pc-bottom-sheet")
3804
+ B = et([
3805
+ W("pc-bottom-sheet")
3773
3806
  ], B);
3774
- var rr = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, vt = (e, t, o, r) => {
3775
- for (var s = r > 1 ? void 0 : r ? sr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3807
+ var nr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, yt = (e, t, o, r) => {
3808
+ for (var s = r > 1 ? void 0 : r ? lr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3776
3809
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3777
- return r && s && rr(t, o, s), s;
3810
+ return r && s && nr(t, o, s), s;
3778
3811
  };
3779
- const ir = 768;
3780
- let X = class extends R {
3812
+ const cr = 768;
3813
+ let Q = class extends R {
3781
3814
  constructor() {
3782
3815
  super(...arguments), this.open = !1, this.position = "auto", this.isMobile = !1, this.handleMediaChange = (e) => {
3783
3816
  this.isMobile = e.matches;
@@ -3793,7 +3826,7 @@ let X = class extends R {
3793
3826
  super.disconnectedCallback(), (e = this.mediaQuery) == null || e.removeEventListener("change", this.handleMediaChange);
3794
3827
  }
3795
3828
  setupMediaQuery() {
3796
- this.mediaQuery = window.matchMedia(`(max-width: ${ir - 1}px)`), this.isMobile = this.mediaQuery.matches, this.mediaQuery.addEventListener("change", this.handleMediaChange);
3829
+ this.mediaQuery = window.matchMedia(`(max-width: ${cr - 1}px)`), this.isMobile = this.mediaQuery.matches, this.mediaQuery.addEventListener("change", this.handleMediaChange);
3797
3830
  }
3798
3831
  render() {
3799
3832
  return this.isMobile ? c`
@@ -3812,32 +3845,32 @@ let X = class extends R {
3812
3845
  `;
3813
3846
  }
3814
3847
  };
3815
- X.styles = U`
3848
+ Q.styles = U`
3816
3849
  :host {
3817
3850
  display: contents;
3818
3851
  }
3819
3852
  `;
3820
- vt([
3853
+ yt([
3821
3854
  f({ type: Boolean, reflect: !0 })
3822
- ], X.prototype, "open", 2);
3823
- vt([
3855
+ ], Q.prototype, "open", 2);
3856
+ yt([
3824
3857
  f({ type: String })
3825
- ], X.prototype, "position", 2);
3826
- vt([
3858
+ ], Q.prototype, "position", 2);
3859
+ yt([
3827
3860
  f({ attribute: !1 })
3828
- ], X.prototype, "anchor", 2);
3829
- vt([
3830
- k()
3831
- ], X.prototype, "isMobile", 2);
3832
- X = vt([
3833
- Y("pc-responsive-modal")
3834
- ], X);
3835
- var ar = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, K = (e, t, o, r) => {
3836
- for (var s = r > 1 ? void 0 : r ? nr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3861
+ ], Q.prototype, "anchor", 2);
3862
+ yt([
3863
+ A()
3864
+ ], Q.prototype, "isMobile", 2);
3865
+ Q = yt([
3866
+ W("pc-responsive-modal")
3867
+ ], Q);
3868
+ var dr = Object.defineProperty, pr = Object.getOwnPropertyDescriptor, K = (e, t, o, r) => {
3869
+ for (var s = r > 1 ? void 0 : r ? pr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3837
3870
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3838
- return r && s && ar(t, o, s), s;
3871
+ return r && s && dr(t, o, s), s;
3839
3872
  };
3840
- let I = class extends g {
3873
+ let M = class extends m {
3841
3874
  constructor() {
3842
3875
  super(), this.min = 0, this.max = 10, this.type = S.nps, this.minLabel = "Not at all", this.maxLabel = "Extremely", this.minMaxPosition = "top", this.hoverValue = -1, this.popoverOpen = !1, this.handleNumberLeave = () => {
3843
3876
  this.hoverValue = -1;
@@ -3849,20 +3882,20 @@ let I = class extends g {
3849
3882
  * Render NPS buttons for edit mode
3850
3883
  */
3851
3884
  renderNpsButtons() {
3852
- const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o = rt({
3853
- role: N.GROUP,
3885
+ const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o = st({
3886
+ role: D.GROUP,
3854
3887
  ariaLabel: this.question || "NPS Rating",
3855
3888
  ariaDescribedby: `${t}-description`
3856
3889
  }), r = e.map((s) => {
3857
3890
  const i = this.dataController.isValueSelected(String(s)), a = {
3858
3891
  "nps-button": !0,
3859
3892
  selected: i
3860
- }, l = Ao(`Rate ${s}`, i, !1);
3893
+ }, l = _o(`Rate ${s}`, i, !1);
3861
3894
  return c`
3862
3895
  <button
3863
3896
  data-testid="nps-button-${s}"
3864
3897
  ?disabled=${!this.displayController.allowEdit()}
3865
- class=${y(a)}
3898
+ class=${w(a)}
3866
3899
  @click="${() => this.handleNumberClick(s)}"
3867
3900
  @mouseenter="${() => this.handleNumberHover(s)}"
3868
3901
  @focus="${() => this.handleNumberHover(s)}"
@@ -3901,10 +3934,10 @@ let I = class extends g {
3901
3934
  * NPS score displayed prominently in the middle
3902
3935
  */
3903
3936
  renderChart() {
3904
- const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = (C) => ({
3905
- x: o + s * Math.cos(C),
3906
- y: r - s * Math.sin(C)
3907
- }), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = (C, w, A = 0) => `M ${C.x} ${C.y} A ${s} ${s} 0 ${A} 1 ${w.x} ${w.y}`, h = p(a, l), b = p(l, n), x = p(n, d), z = ((C) => Math.PI - (C + 100) / 200 * Math.PI)(t), M = i(z);
3937
+ const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = ($) => ({
3938
+ x: o + s * Math.cos($),
3939
+ y: r - s * Math.sin($)
3940
+ }), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = ($, y, E = 0) => `M ${$.x} ${$.y} A ${s} ${s} 0 ${E} 1 ${y.x} ${y.y}`, h = p(a, l), v = p(l, n), x = p(n, d), P = (($) => Math.PI - ($ + 100) / 200 * Math.PI)(t), _ = i(P);
3908
3941
  return c`
3909
3942
  <div class="nps-semicircle-gauge" data-testid="nps-semicircle-gauge">
3910
3943
  <svg viewBox="0 0 200 115">
@@ -3916,11 +3949,11 @@ let I = class extends g {
3916
3949
 
3917
3950
  <!-- Colored segments -->
3918
3951
  <path class="gauge-arc gauge-arc-detractor" d="${h}" />
3919
- <path class="gauge-arc gauge-arc-passive" d="${b}" />
3952
+ <path class="gauge-arc gauge-arc-passive" d="${v}" />
3920
3953
  <path class="gauge-arc gauge-arc-promoter" d="${x}" />
3921
3954
 
3922
3955
  <!-- Needle indicator -->
3923
- <circle class="gauge-needle" cx="${M.x}" cy="${M.y}" r="5" />
3956
+ <circle class="gauge-needle" cx="${_.x}" cy="${_.y}" r="5" />
3924
3957
 
3925
3958
  <!-- Score display in center -->
3926
3959
  <text class="gauge-score" x="${o}" y="${r - 15}">${t}</text>
@@ -3980,7 +4013,7 @@ let I = class extends g {
3980
4013
  * Uses SVG with 3 colored segments for detractors/passives/promoters
3981
4014
  */
3982
4015
  renderInlineGauge() {
3983
- const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s = Mo(t), i = s.detractors + s.passives + s.promoters;
4016
+ const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s = No(t), i = s.detractors + s.passives + s.promoters;
3984
4017
  if (i === 0)
3985
4018
  return c`
3986
4019
  <div class="inline-nps-gauge">
@@ -3989,9 +4022,9 @@ let I = class extends g {
3989
4022
  </svg>
3990
4023
  </div>
3991
4024
  `;
3992
- const a = s.detractors / i * 100, l = s.passives / i * 100, n = s.promoters / i * 100, d = a / 100 * r, p = l / 100 * r, h = n / 100 * r, b = 0, x = -d, E = -(d + p), z = this.getUserScore();
3993
- let M = "gauge-bg";
3994
- return z !== null && (z <= 6 ? M = "gauge-detractor" : z <= 8 ? M = "gauge-passive" : M = "gauge-promoter"), c`
4025
+ const a = s.detractors / i * 100, l = s.passives / i * 100, n = s.promoters / i * 100, d = a / 100 * r, p = l / 100 * r, h = n / 100 * r, v = 0, x = -d, k = -(d + p), P = this.getUserScore();
4026
+ let _ = "gauge-bg";
4027
+ return P !== null && (P <= 6 ? _ = "gauge-detractor" : P <= 8 ? _ = "gauge-passive" : _ = "gauge-promoter"), c`
3995
4028
  <div class="inline-nps-gauge">
3996
4029
  <svg viewBox="0 0 20 20">
3997
4030
  <!-- Background circle -->
@@ -4003,7 +4036,7 @@ let I = class extends g {
4003
4036
  cy="10"
4004
4037
  r="${o}"
4005
4038
  stroke-dasharray="${d} ${r}"
4006
- stroke-dashoffset="${b}"
4039
+ stroke-dashoffset="${v}"
4007
4040
  />
4008
4041
  <!-- Passive segment (yellow) -->
4009
4042
  <circle
@@ -4021,10 +4054,10 @@ let I = class extends g {
4021
4054
  cy="10"
4022
4055
  r="${o}"
4023
4056
  stroke-dasharray="${h} ${r}"
4024
- stroke-dashoffset="${E}"
4057
+ stroke-dashoffset="${k}"
4025
4058
  />
4026
4059
  <!-- Center dot showing user's score category -->
4027
- <circle class="gauge-dot ${M}" cx="10" cy="10" r="2" />
4060
+ <circle class="gauge-dot ${_}" cx="10" cy="10" r="2" />
4028
4061
  </svg>
4029
4062
  </div>
4030
4063
  `;
@@ -4035,7 +4068,7 @@ let I = class extends g {
4035
4068
  * Shows add icon when no selection, edit icon when user has submitted
4036
4069
  */
4037
4070
  renderInlineTrigger() {
4038
- const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? kt : Ie;
4071
+ const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? At : Me;
4039
4072
  return c`
4040
4073
  <button
4041
4074
  class="pc-inline-trigger"
@@ -4067,7 +4100,7 @@ let I = class extends g {
4067
4100
  };
4068
4101
  return c`
4069
4102
  <button
4070
- class=${y(i)}
4103
+ class=${w(i)}
4071
4104
  @click=${() => this.handlePopoverNumberClick(r)}
4072
4105
  @mouseenter=${() => this.handleNumberHover(r)}
4073
4106
  @mouseleave=${this.handleNumberLeave}
@@ -4101,7 +4134,7 @@ let I = class extends g {
4101
4134
  @keydown="${(e) => {
4102
4135
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
4103
4136
  }}"
4104
- >${this.displayController.isChartVisible ? Jt : Zt}</span
4137
+ >${this.displayController.isChartVisible ? Qt : Xt}</span
4105
4138
  >
4106
4139
  `;
4107
4140
  }
@@ -4120,7 +4153,7 @@ let I = class extends g {
4120
4153
  aria-label="Close"
4121
4154
  data-testid="popover-close-button"
4122
4155
  >
4123
- ${Tt}
4156
+ ${_t}
4124
4157
  </button>
4125
4158
  ${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
4126
4159
  ${this.renderPopoverNpsButtons()}
@@ -4170,16 +4203,16 @@ let I = class extends g {
4170
4203
  renderStandardMode() {
4171
4204
  const e = {
4172
4205
  [`pc-flex-pos-${this.questionPosition}`]: !0,
4173
- [`pc-flex-align-${O(this.questionPosition, this.questionAlign)}`]: !0
4206
+ [`pc-flex-align-${z(this.questionPosition, this.questionAlign)}`]: !0
4174
4207
  }, t = {
4175
4208
  nps: !0,
4176
4209
  [`pc-flex-pos-${this.statsPosition}`]: !0,
4177
- [`pc-flex-align-${O(this.statsPosition, this.statsAlign)}`]: !0
4210
+ [`pc-flex-align-${z(this.statsPosition, this.statsAlign)}`]: !0
4178
4211
  };
4179
4212
  return c`
4180
- <div class="pc-container ${y(e)}" data-testid="nps-container">
4213
+ <div class="pc-container ${w(e)}" data-testid="nps-container">
4181
4214
  ${this.renderLabelAtStart()}
4182
- <div class="pc-body ${y(t)}" data-testid="nps-body">
4215
+ <div class="pc-body ${w(t)}" data-testid="nps-body">
4183
4216
  ${this.renderStatusAtStart()} ${this.renderContent()} ${this.renderStatusAtEnd()}
4184
4217
  </div>
4185
4218
  ${this.renderLabelAtEnd()}
@@ -4193,32 +4226,32 @@ let I = class extends g {
4193
4226
  return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
4194
4227
  }
4195
4228
  };
4196
- I.styles = [...g.styles, Ot, Zo];
4229
+ M.styles = [...m.styles, It, tr];
4197
4230
  K([
4198
4231
  f({ type: String, attribute: "min-label" })
4199
- ], I.prototype, "minLabel", 2);
4232
+ ], M.prototype, "minLabel", 2);
4200
4233
  K([
4201
4234
  f({ type: String, attribute: "max-label" })
4202
- ], I.prototype, "maxLabel", 2);
4235
+ ], M.prototype, "maxLabel", 2);
4203
4236
  K([
4204
4237
  f({ type: String, attribute: "thank-you-msg" })
4205
- ], I.prototype, "thankYouMsg", 2);
4238
+ ], M.prototype, "thankYouMsg", 2);
4206
4239
  K([
4207
4240
  f({ type: String, attribute: "min-max-position" })
4208
- ], I.prototype, "minMaxPosition", 2);
4241
+ ], M.prototype, "minMaxPosition", 2);
4209
4242
  K([
4210
- k()
4211
- ], I.prototype, "hoverValue", 2);
4243
+ A()
4244
+ ], M.prototype, "hoverValue", 2);
4212
4245
  K([
4213
- k()
4214
- ], I.prototype, "popoverOpen", 2);
4246
+ A()
4247
+ ], M.prototype, "popoverOpen", 2);
4215
4248
  K([
4216
- mt(".pc-inline-trigger")
4217
- ], I.prototype, "triggerElement", 2);
4218
- I = K([
4219
- Y("pc-nps")
4220
- ], I);
4221
- const lr = U`
4249
+ bt(".pc-inline-trigger")
4250
+ ], M.prototype, "triggerElement", 2);
4251
+ M = K([
4252
+ W("pc-nps")
4253
+ ], M);
4254
+ const ur = U`
4222
4255
  /* CSS variables inherit from parent - defaults are specified at usage sites */
4223
4256
 
4224
4257
  .pc-container {
@@ -4603,21 +4636,21 @@ const lr = U`
4603
4636
  opacity: 0.8;
4604
4637
  }
4605
4638
  `;
4606
- var cr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, bt = (e, t, o, r) => {
4607
- for (var s = r > 1 ? void 0 : r ? dr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
4639
+ var hr = Object.defineProperty, fr = Object.getOwnPropertyDescriptor, wt = (e, t, o, r) => {
4640
+ for (var s = r > 1 ? void 0 : r ? fr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
4608
4641
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
4609
- return r && s && cr(t, o, s), s;
4642
+ return r && s && hr(t, o, s), s;
4610
4643
  };
4611
- let Q = class extends g {
4644
+ let tt = class extends m {
4612
4645
  constructor() {
4613
4646
  super(), this.type = S.poll, this.multiple = !1, this.compact = !1, this.popoverOpen = !1, this.hasEditButton = !0, this.statsText = "{count} votes", this.questionPosition = "top", this.statsPosition = "bottom", this.showStats = "after-vote";
4614
4647
  }
4615
4648
  renderStatus() {
4616
4649
  const t = {
4617
4650
  "pc-status": !0,
4618
- [`pc-flex-content-${O("bottom", this.statsAlign)}`]: !0
4651
+ [`pc-flex-content-${z("bottom", this.statsAlign)}`]: !0
4619
4652
  };
4620
- return c`<div class="${y(t)}" data-testid="pc-status">
4653
+ return c`<div class="${w(t)}" data-testid="pc-status">
4621
4654
  <span>${this.renderStatsText()} ${this.renderEditToggleIcon("stats-edit-button")}</span>
4622
4655
  </div>`;
4623
4656
  }
@@ -4632,7 +4665,7 @@ let Q = class extends g {
4632
4665
  }, t = this.displayController.shouldDisableSubmitButton();
4633
4666
  return c`
4634
4667
  <button
4635
- class="${y(e)}"
4668
+ class="${w(e)}"
4636
4669
  data-testid="pc-submit-button"
4637
4670
  @click="${this.handleSubmit}"
4638
4671
  ?disabled="${t}"
@@ -4666,16 +4699,16 @@ let Q = class extends g {
4666
4699
  */
4667
4700
  renderOptionIcon(e) {
4668
4701
  if (!(e != null && e.icon)) return "";
4669
- const t = Qt.DECORATIVE, o = (e == null ? void 0 : e.label) || "", r = e ? this.dataController.isValueSelected(e.value) : !1, s = Ue(e == null ? void 0 : e.icon, {
4702
+ const t = ee.DECORATIVE, o = (e == null ? void 0 : e.label) || "", r = e ? this.dataController.isValueSelected(e.value) : !1, s = je(e == null ? void 0 : e.icon, {
4670
4703
  type: t,
4671
4704
  alt: o,
4672
4705
  isSelected: r
4673
4706
  });
4674
- return Be(e == null ? void 0 : e.icon) ? c`<span
4707
+ return Ve(e == null ? void 0 : e.icon) ? c`<span
4675
4708
  class="poll-option-icon"
4676
4709
  aria-hidden="${s.ariaHidden ? "true" : "false"}"
4677
4710
  >${e == null ? void 0 : e.icon}</span
4678
- >` : _t(e == null ? void 0 : e.icon) ? c`<img
4711
+ >` : Ot(e == null ? void 0 : e.icon) ? c`<img
4679
4712
  src="${e == null ? void 0 : e.icon}"
4680
4713
  alt="${s.alt}"
4681
4714
  class="poll-option-icon-img"
@@ -4691,7 +4724,7 @@ let Q = class extends g {
4691
4724
  * Renders the selection indicator (checkbox or radio button) with proper ARIA roles
4692
4725
  */
4693
4726
  renderSelectionIndicator() {
4694
- const e = this.multiple ? N.CHECKBOX : N.RADIO;
4727
+ const e = this.multiple ? D.CHECKBOX : D.RADIO;
4695
4728
  return this.multiple ? c`<span class="poll-checkbox" role="${e}"></span>` : c`<span class="poll-radio" role="${e}"></span>`;
4696
4729
  }
4697
4730
  /**
@@ -4703,7 +4736,7 @@ let Q = class extends g {
4703
4736
  selected: o,
4704
4737
  "poll-option--compact": this.compact,
4705
4738
  "poll-option--disabled": r
4706
- }, i = t + 1, a = `poll-${this.type}-${i}`, l = Po(
4739
+ }, i = t + 1, a = `poll-${this.type}-${i}`, l = Oo(
4707
4740
  e.label,
4708
4741
  o,
4709
4742
  r,
@@ -4713,7 +4746,7 @@ let Q = class extends g {
4713
4746
  return c`
4714
4747
  <button
4715
4748
  data-testid="poll-option-i${t}"
4716
- class="${y(s)}"
4749
+ class="${w(s)}"
4717
4750
  @click="${(n) => {
4718
4751
  n.stopPropagation(), this.handleClick(e);
4719
4752
  }}"
@@ -4737,13 +4770,13 @@ let Q = class extends g {
4737
4770
  */
4738
4771
  renderPollOptions() {
4739
4772
  var s;
4740
- const e = this.multiple ? N.GROUP : N.RADIOGROUP, t = this.question || this.name || "Options", o = rt({
4773
+ const e = this.multiple ? D.GROUP : D.RADIOGROUP, t = this.question || this.name || "Options", o = st({
4741
4774
  role: e,
4742
4775
  ariaLabel: t
4743
4776
  });
4744
4777
  return c`
4745
4778
  <div
4746
- class="${y({
4779
+ class="${w({
4747
4780
  "poll-container": !0
4748
4781
  })}"
4749
4782
  data-testid="poll-option-container"
@@ -4760,21 +4793,21 @@ let Q = class extends g {
4760
4793
  renderBarChart() {
4761
4794
  var n, d;
4762
4795
  const e = ((n = this.dataController.stats) == null ? void 0 : n.breakdown) || {}, t = ((d = this.dataController.localStats) == null ? void 0 : d.breakdown) || {}, o = Object.values(e).reduce((p, h) => p + h, 0), r = this.options.map((p, h) => {
4763
- const b = e[p.value] || 0, x = o > 0 ? Math.round(b / o * 100) : 0, E = (t[p.value] || 0) > 0;
4796
+ const v = e[p.value] || 0, x = o > 0 ? Math.round(v / o * 100) : 0, k = (t[p.value] || 0) > 0;
4764
4797
  return {
4765
4798
  option: p,
4766
4799
  index: h,
4767
- voteCount: b,
4800
+ voteCount: v,
4768
4801
  percentage: x,
4769
- isSelected: E
4802
+ isSelected: k
4770
4803
  };
4771
- }), s = this.multiple ? N.GROUP : N.RADIOGROUP, i = this.question || this.name || "Options", a = rt({
4804
+ }), s = this.multiple ? D.GROUP : D.RADIOGROUP, i = this.question || this.name || "Options", a = st({
4772
4805
  role: s,
4773
4806
  ariaLabel: i
4774
4807
  });
4775
4808
  return c`
4776
4809
  <div
4777
- class="${y({
4810
+ class="${w({
4778
4811
  "poll-container": !0
4779
4812
  })}"
4780
4813
  data-testid="poll-chart-container"
@@ -4790,7 +4823,7 @@ let Q = class extends g {
4790
4823
  };
4791
4824
  return c`
4792
4825
  <div
4793
- class="${y(h)}"
4826
+ class="${w(h)}"
4794
4827
  data-testid="poll-chart-item-${p.index}"
4795
4828
  role="listitem"
4796
4829
  aria-label="${p.option.label}: ${p.percentage}% (${p.voteCount} votes)"
@@ -4861,7 +4894,7 @@ let Q = class extends g {
4861
4894
  * Shows add icon when no selection, edit icon when user has submitted
4862
4895
  */
4863
4896
  renderInlineTrigger() {
4864
- const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? kt : Ie;
4897
+ const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? At : Me;
4865
4898
  return c`
4866
4899
  <button
4867
4900
  class="pc-inline-trigger"
@@ -4920,7 +4953,7 @@ let Q = class extends g {
4920
4953
  aria-label="Close"
4921
4954
  data-testid="popover-close-button"
4922
4955
  >
4923
- ${Tt}
4956
+ ${_t}
4924
4957
  </button>
4925
4958
  ${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
4926
4959
  ${e ? this.renderBarChart() : this.renderPollOptions()}
@@ -4937,7 +4970,7 @@ let Q = class extends g {
4937
4970
  @keydown=${(s) => {
4938
4971
  (s.key === "Enter" || s.key === " ") && (s.preventDefault(), this.handlePopoverEditClick());
4939
4972
  }}
4940
- >${kt}</span
4973
+ >${At}</span
4941
4974
  >` : u}
4942
4975
  </div>` : u}
4943
4976
  </div>
@@ -4994,25 +5027,25 @@ let Q = class extends g {
4994
5027
  * Render standard mode - original behavior
4995
5028
  */
4996
5029
  renderStandardMode() {
4997
- const e = O(this.questionPosition, this.questionAlign), t = {
5030
+ const e = z(this.questionPosition, this.questionAlign), t = {
4998
5031
  [`pc-flex-pos-${this.questionPosition}`]: !0,
4999
5032
  [`pc-flex-align-${e}`]: !0
5000
- }, o = O(this.statsPosition, this.statsAlign), r = {
5033
+ }, o = z(this.statsPosition, this.statsAlign), r = {
5001
5034
  "pc-body": !0,
5002
5035
  [`pc-flex-pos-${this.statsPosition}`]: !0,
5003
5036
  [`pc-flex-align-${o}`]: !0
5004
- }, s = rt({
5005
- role: N.REGION,
5037
+ }, s = st({
5038
+ role: D.REGION,
5006
5039
  ariaLabel: this.question || this.name || "Poll"
5007
5040
  });
5008
5041
  return c`
5009
5042
  <div
5010
- class="pc-container ${y(t)}"
5043
+ class="pc-container ${w(t)}"
5011
5044
  data-testid="poll-container"
5012
5045
  ...=${s}
5013
5046
  >
5014
5047
  ${this.renderLabelAtStart()}
5015
- <div class="${y(r)}" data-testid="poll-body">
5048
+ <div class="${w(r)}" data-testid="poll-body">
5016
5049
  ${this.renderContent()} ${this.renderFooter()}
5017
5050
  </div>
5018
5051
  ${this.renderLabelAtEnd()}
@@ -5023,23 +5056,23 @@ let Q = class extends g {
5023
5056
  return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
5024
5057
  }
5025
5058
  };
5026
- Q.styles = [...g.styles, Ot, lr];
5027
- bt([
5059
+ tt.styles = [...m.styles, It, ur];
5060
+ wt([
5028
5061
  f({ type: Boolean })
5029
- ], Q.prototype, "multiple", 2);
5030
- bt([
5062
+ ], tt.prototype, "multiple", 2);
5063
+ wt([
5031
5064
  f({ type: Boolean })
5032
- ], Q.prototype, "compact", 2);
5033
- bt([
5034
- k()
5035
- ], Q.prototype, "popoverOpen", 2);
5036
- bt([
5037
- mt(".pc-inline-trigger")
5038
- ], Q.prototype, "triggerElement", 2);
5039
- Q = bt([
5040
- Y("pc-poll")
5041
- ], Q);
5042
- const pr = U`
5065
+ ], tt.prototype, "compact", 2);
5066
+ wt([
5067
+ A()
5068
+ ], tt.prototype, "popoverOpen", 2);
5069
+ wt([
5070
+ bt(".pc-inline-trigger")
5071
+ ], tt.prototype, "triggerElement", 2);
5072
+ tt = wt([
5073
+ W("pc-poll")
5074
+ ], tt);
5075
+ const gr = U`
5043
5076
  /* CSS variables inherit from parent - defaults are specified at usage sites */
5044
5077
 
5045
5078
  .pc-section {
@@ -5226,10 +5259,10 @@ const pr = U`
5226
5259
  * Copyright 2018 Google LLC
5227
5260
  * SPDX-License-Identifier: BSD-3-Clause
5228
5261
  */
5229
- const He = "important", ur = " !" + He, hr = je(class extends qe {
5262
+ const Ye = "important", mr = " !" + Ye, vr = He(class extends Fe {
5230
5263
  constructor(e) {
5231
5264
  var t;
5232
- if (super(e), e.type !== Ve.ATTRIBUTE || e.name !== "style" || ((t = e.strings) == null ? void 0 : t.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
5265
+ if (super(e), e.type !== qe.ATTRIBUTE || e.name !== "style" || ((t = e.strings) == null ? void 0 : t.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
5233
5266
  }
5234
5267
  render(e) {
5235
5268
  return Object.keys(e).reduce((t, o) => {
@@ -5245,14 +5278,14 @@ const He = "important", ur = " !" + He, hr = je(class extends qe {
5245
5278
  const s = t[r];
5246
5279
  if (s != null) {
5247
5280
  this.ft.add(r);
5248
- const i = typeof s == "string" && s.endsWith(ur);
5249
- r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? He : "") : o[r] = s;
5281
+ const i = typeof s == "string" && s.endsWith(mr);
5282
+ r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? Ye : "") : o[r] = s;
5250
5283
  }
5251
5284
  }
5252
5285
  return H;
5253
5286
  }
5254
5287
  });
5255
- function $t(e, t = {}) {
5288
+ function Ct(e, t = {}) {
5256
5289
  if (!e || e.length === 0)
5257
5290
  return c`<div class="pc-bar-chart pc-bar-chart--empty">No data available</div>`;
5258
5291
  const o = Math.max(...e.map((i) => i.value)), s = { ...{
@@ -5281,7 +5314,7 @@ function $t(e, t = {}) {
5281
5314
  </div>
5282
5315
  `;
5283
5316
  }
5284
- const Ce = {
5317
+ const Ee = {
5285
5318
  // Faces
5286
5319
  smile: "😊",
5287
5320
  laugh: "😄",
@@ -5424,19 +5457,19 @@ const Ce = {
5424
5457
  hiking: "🥾",
5425
5458
  yoga: "🧘"
5426
5459
  };
5427
- function At(e) {
5460
+ function Pt(e) {
5428
5461
  let t = "❓", o = !1;
5429
- return e ? e in Ce ? t = Ce[e] : Be(e) ? t = e : _t(e) ? (o = !0, t = e) : /^\w+@\w+$/.test(e) ? t = e : e.endsWith(".svg") && !e.includes("/") ? (t = `https://cdn.jsdelivr.net/npm/@mdi/svg@7.4.47/svg/${e}`, o = !0) : t = e : t = "❓", {
5462
+ return e ? e in Ee ? t = Ee[e] : Ve(e) ? t = e : Ot(e) ? (o = !0, t = e) : /^\w+@\w+$/.test(e) ? t = e : e.endsWith(".svg") && !e.includes("/") ? (t = `https://cdn.jsdelivr.net/npm/@mdi/svg@7.4.47/svg/${e}`, o = !0) : t = e : t = "❓", {
5430
5463
  icon: t,
5431
5464
  isRemoteImage: o
5432
5465
  };
5433
5466
  }
5434
- var fr = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, nt = (e, t, o, r) => {
5435
- for (var s = r > 1 ? void 0 : r ? gr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
5467
+ var br = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, nt = (e, t, o, r) => {
5468
+ for (var s = r > 1 ? void 0 : r ? yr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
5436
5469
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
5437
- return r && s && fr(t, o, s), s;
5470
+ return r && s && br(t, o, s), s;
5438
5471
  };
5439
- let F = class extends g {
5472
+ let F = class extends m {
5440
5473
  constructor() {
5441
5474
  super(), this.type = S.stars, this.icon = "★", this.numStars = 5, this.hoverValue = -1, this.popoverOpen = !1, this.handleStarKeyDown = (e) => {
5442
5475
  if (e.key === "Enter" || e.key === " ") {
@@ -5459,14 +5492,14 @@ let F = class extends g {
5459
5492
  * Renders the star icon using resolveIcon for emoji, URL, or MDI support
5460
5493
  */
5461
5494
  renderStarIcon() {
5462
- const { icon: e, isRemoteImage: t } = At(this.icon);
5495
+ const { icon: e, isRemoteImage: t } = Pt(this.icon);
5463
5496
  return t ? c`<img class="star-icon-img" src="${e}" alt="star" />` : e;
5464
5497
  }
5465
5498
  /**
5466
5499
  * Gets the resolved icon string (for use in chart labels)
5467
5500
  */
5468
5501
  getResolvedIconString() {
5469
- const { icon: e, isRemoteImage: t } = At(this.icon);
5502
+ const { icon: e, isRemoteImage: t } = Pt(this.icon);
5470
5503
  return t ? "★" : e;
5471
5504
  }
5472
5505
  /**
@@ -5477,22 +5510,22 @@ let F = class extends g {
5477
5510
  renderStars(e = !1) {
5478
5511
  var n;
5479
5512
  const t = this.getUserVotePosition(), o = this.dataController.stats, r = (o == null ? void 0 : o.avg) ?? 0, s = ((n = this.dataController.localStats) == null ? void 0 : n.avg) ?? 0, i = this.readonly ? r : s, a = this.displayController.allowEdit(), l = Array.from({ length: this.numStars }, (d, p) => p + 1).map((d) => {
5480
- const p = e ? t || 0 : Math.floor(i), h = d <= p || d <= (this.hoverValue || 0), b = !e && !h && d === Math.ceil(i) && i % 1 !== 0, x = {
5513
+ const p = e ? t || 0 : Math.floor(i), h = d <= p || d <= (this.hoverValue || 0), v = !e && !h && d === Math.ceil(i) && i % 1 !== 0, x = {
5481
5514
  star: !0,
5482
5515
  selected: h,
5483
- partial: b,
5516
+ partial: v,
5484
5517
  "view-mode": !a
5485
- }, E = b ? { "--partial-fill": `${i % 1 * 100}%` } : {}, z = e ? () => this.handlePopoverStarClick(d) : () => this.handleStarClick(d);
5518
+ }, k = v ? { "--partial-fill": `${i % 1 * 100}%` } : {}, P = e ? () => this.handlePopoverStarClick(d) : () => this.handleStarClick(d);
5486
5519
  return c`
5487
5520
  <div class="pc-section" data-testid="pc-section">
5488
5521
  <span
5489
5522
  data-testid="${e ? "popover" : "stars-view"}-star-${d}"
5490
- class=${y(x)}
5491
- style=${hr(E)}
5523
+ class=${w(x)}
5524
+ style=${vr(k)}
5492
5525
  role="${a ? "button" : "presentation"}"
5493
5526
  tabindex="${a ? "0" : ""}"
5494
5527
  aria-label="${a ? `Rate ${d} star${d > 1 ? "s" : ""}` : ""}"
5495
- @click="${z}"
5528
+ @click="${P}"
5496
5529
  @mouseenter="${() => this.handleStarHover(d)}"
5497
5530
  @focus="${() => this.handleStarHover(d)}"
5498
5531
  @mouseleave="${this.handleStarLeave}"
@@ -5516,7 +5549,7 @@ let F = class extends g {
5516
5549
  label: n,
5517
5550
  value: d,
5518
5551
  icon: r
5519
- })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = $t(s, {
5552
+ })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = Ct(s, {
5520
5553
  barColor: a,
5521
5554
  labelFormatter: (n) => `${n.label} ${n.icon}`,
5522
5555
  valueFormatter: (n) => `${o > 0 ? Math.round(n.value / o * 100) : 0}%`
@@ -5583,7 +5616,7 @@ let F = class extends g {
5583
5616
  };
5584
5617
  return c`
5585
5618
  <button
5586
- class=${y(i)}
5619
+ class=${w(i)}
5587
5620
  @click=${() => {
5588
5621
  this.popoverOpen = !0;
5589
5622
  }}
@@ -5616,7 +5649,7 @@ let F = class extends g {
5616
5649
  aria-label="Close"
5617
5650
  data-testid="popover-close-button"
5618
5651
  >
5619
- ${Tt}
5652
+ ${_t}
5620
5653
  </button>
5621
5654
  ${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
5622
5655
  ${this.renderStars(!0)}
@@ -5639,7 +5672,7 @@ let F = class extends g {
5639
5672
  label: n,
5640
5673
  value: d,
5641
5674
  icon: r
5642
- })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = $t(s, {
5675
+ })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = Ct(s, {
5643
5676
  barColor: a,
5644
5677
  labelFormatter: (n) => `${n.label} ${n.icon}`,
5645
5678
  valueFormatter: (n) => `${o > 0 ? Math.round(n.value / o * 100) : 0}%`
@@ -5665,7 +5698,7 @@ let F = class extends g {
5665
5698
  @keydown="${(e) => {
5666
5699
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
5667
5700
  }}"
5668
- >${this.displayController.isChartVisible ? Jt : Zt}</span
5701
+ >${this.displayController.isChartVisible ? Qt : Xt}</span
5669
5702
  >
5670
5703
  `;
5671
5704
  }
@@ -5708,7 +5741,7 @@ let F = class extends g {
5708
5741
  label: n,
5709
5742
  value: d,
5710
5743
  icon: r
5711
- })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = $t(s, {
5744
+ })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = Ct(s, {
5712
5745
  barColor: a,
5713
5746
  labelFormatter: (n) => `${n.label} ${n.icon}`,
5714
5747
  valueFormatter: (n) => `${o > 0 ? Math.round(n.value / o * 100) : 0}%`
@@ -5723,18 +5756,18 @@ let F = class extends g {
5723
5756
  * Render standard mode - original behavior
5724
5757
  */
5725
5758
  renderStandardMode() {
5726
- const e = O(this.questionPosition, this.questionAlign), t = {
5759
+ const e = z(this.questionPosition, this.questionAlign), t = {
5727
5760
  [`pc-flex-pos-${this.questionPosition}`]: !0,
5728
5761
  [`pc-flex-align-${e}`]: !0
5729
- }, o = O(this.statsPosition, this.statsAlign), r = {
5762
+ }, o = z(this.statsPosition, this.statsAlign), r = {
5730
5763
  "pc-body": !0,
5731
5764
  [`pc-flex-pos-${this.statsPosition}`]: !0,
5732
5765
  [`pc-flex-align-${o}`]: !0
5733
5766
  }, s = !this.displayController.shouldShowChart();
5734
5767
  return c`
5735
- <div class="pc-container ${y(t)}" data-testid="pc-container">
5768
+ <div class="pc-container ${w(t)}" data-testid="pc-container">
5736
5769
  ${this.renderLabelAtStart()}
5737
- <div class="${y(r)}" data-testid="stars-body">
5770
+ <div class="${w(r)}" data-testid="stars-body">
5738
5771
  ${this.renderStatusAtStart()} ${this.renderChart()}
5739
5772
  ${s ? this.renderStars() : u} ${this.renderStatusAtEnd()}
5740
5773
  </div>
@@ -5746,7 +5779,7 @@ let F = class extends g {
5746
5779
  return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
5747
5780
  }
5748
5781
  };
5749
- F.styles = [...g.styles, Ot, pr];
5782
+ F.styles = [...m.styles, It, gr];
5750
5783
  nt([
5751
5784
  f({ type: String })
5752
5785
  ], F.prototype, "icon", 2);
@@ -5754,18 +5787,18 @@ nt([
5754
5787
  f({ type: Number, attribute: "num-stars" })
5755
5788
  ], F.prototype, "numStars", 2);
5756
5789
  nt([
5757
- k()
5790
+ A()
5758
5791
  ], F.prototype, "hoverValue", 2);
5759
5792
  nt([
5760
- k()
5793
+ A()
5761
5794
  ], F.prototype, "popoverOpen", 2);
5762
5795
  nt([
5763
- mt(".pc-inline-trigger")
5796
+ bt(".pc-inline-trigger")
5764
5797
  ], F.prototype, "triggerElement", 2);
5765
5798
  F = nt([
5766
- Y("pc-stars")
5799
+ W("pc-stars")
5767
5800
  ], F);
5768
- const mr = U`
5801
+ const wr = U`
5769
5802
  /* Adjust stats text for reactions */
5770
5803
  .pc-stats-text {
5771
5804
  font-size: var(--pc-font-size-small, var(--default-font-size-small));
@@ -6028,13 +6061,13 @@ const mr = U`
6028
6061
  animation: none;
6029
6062
  }
6030
6063
  }
6031
- `, vr = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%20-960%20960%20960'%20width='24px'%20fill='%23434343'%3e%3cpath%20d='M480-480Zm0%20400q-83%200-156-31.5T197-197q-54-54-85.5-127T80-480q0-83%2031.5-156T197-763q54-54%20127-85.5T480-880q43%200%2083%208.5t77%2024.5v90q-35-20-75.5-31.5T480-800q-133%200-226.5%2093.5T160-480q0%20133%2093.5%20226.5T480-160q133%200%20226.5-93.5T800-480q0-32-6.5-62T776-600h86q9%2029%2013.5%2058.5T880-480q0%2083-31.5%20156T763-197q-54%2054-127%2085.5T480-80Zm320-600v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80ZM620-520q25%200%2042.5-17.5T680-580q0-25-17.5-42.5T620-640q-25%200-42.5%2017.5T560-580q0%2025%2017.5%2042.5T620-520Zm-280%200q25%200%2042.5-17.5T400-580q0-25-17.5-42.5T340-640q-25%200-42.5%2017.5T280-580q0%2025%2017.5%2042.5T340-520Zm140%20260q68%200%20123.5-38.5T684-400H276q25%2063%2080.5%20101.5T480-260Z'/%3e%3c/svg%3e";
6032
- var br = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, It = (e, t, o, r) => {
6033
- for (var s = r > 1 ? void 0 : r ? yr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
6064
+ `, xr = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%20-960%20960%20960'%20width='24px'%20fill='%23434343'%3e%3cpath%20d='M480-480Zm0%20400q-83%200-156-31.5T197-197q-54-54-85.5-127T80-480q0-83%2031.5-156T197-763q54-54%20127-85.5T480-880q43%200%2083%208.5t77%2024.5v90q-35-20-75.5-31.5T480-800q-133%200-226.5%2093.5T160-480q0%20133%2093.5%20226.5T480-160q133%200%20226.5-93.5T800-480q0-32-6.5-62T776-600h86q9%2029%2013.5%2058.5T880-480q0%2083-31.5%20156T763-197q-54%2054-127%2085.5T480-80Zm320-600v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80ZM620-520q25%200%2042.5-17.5T680-580q0-25-17.5-42.5T620-640q-25%200-42.5%2017.5T560-580q0%2025%2017.5%2042.5T620-520Zm-280%200q25%200%2042.5-17.5T400-580q0-25-17.5-42.5T340-640q-25%200-42.5%2017.5T280-580q0%2025%2017.5%2042.5T340-520Zm140%20260q68%200%20123.5-38.5T684-400H276q25%2063%2080.5%20101.5T480-260Z'/%3e%3c/svg%3e";
6065
+ var $r = Object.defineProperty, Sr = Object.getOwnPropertyDescriptor, zt = (e, t, o, r) => {
6066
+ for (var s = r > 1 ? void 0 : r ? Sr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
6034
6067
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
6035
- return r && s && br(t, o, s), s;
6068
+ return r && s && $r(t, o, s), s;
6036
6069
  };
6037
- let it = class extends g {
6070
+ let at = class extends m {
6038
6071
  constructor() {
6039
6072
  super(), this.type = S.reaction, this.showCounts = !1, this.compact = !1, this.popupPosition = "auto", this.hasEditButton = !1, this.statsText = "{count} votes", this.buttonRadius = "990px", this.muteColor = "#cccccc", this.questionPosition = "top", this.statsPosition = "right", this.popupPosition = "auto";
6040
6073
  }
@@ -6058,7 +6091,7 @@ let it = class extends g {
6058
6091
  * Renders the icon for a reaction
6059
6092
  */
6060
6093
  renderReactionIcon(e, t) {
6061
- const { icon: o, isRemoteImage: r } = At(e), s = Qt.FUNCTIONAL, i = t.tooltip || `${t.value} reaction`, a = Ue(o, {
6094
+ const { icon: o, isRemoteImage: r } = Pt(e), s = ee.FUNCTIONAL, i = t.tooltip || `${t.value} reaction`, a = je(o, {
6062
6095
  type: s,
6063
6096
  alt: i,
6064
6097
  ariaLabel: i,
@@ -6085,7 +6118,7 @@ let it = class extends g {
6085
6118
  }, l = `${e.tooltip || e.value} reaction${o ? ", selected" : ""}${t ? `, ${r} votes` : ""}`;
6086
6119
  return c`
6087
6120
  <button
6088
- class="${y(a)}"
6121
+ class="${w(a)}"
6089
6122
  @click="${() => this.handleReactionClick(e)}"
6090
6123
  ?disabled="${s}"
6091
6124
  aria-pressed="${o}"
@@ -6112,7 +6145,7 @@ let it = class extends g {
6112
6145
  aria-expanded="${this.displayController.shouldShowReactionPopover()}"
6113
6146
  aria-haspopup="true"
6114
6147
  >
6115
- <img src="${vr}" alt="" class="trigger-icon" />
6148
+ <img src="${xr}" alt="" class="trigger-icon" />
6116
6149
  </button>
6117
6150
  `;
6118
6151
  }
@@ -6127,7 +6160,7 @@ let it = class extends g {
6127
6160
  bottom: this.popupPosition === "bottom" || this.popupPosition === "auto" && !this.shouldShowPopoverOnTop()
6128
6161
  };
6129
6162
  return c`
6130
- <div class="${y(e)}" role="menu">
6163
+ <div class="${w(e)}" role="menu">
6131
6164
  <div class="popover-content">
6132
6165
  ${this.options.map((t) => {
6133
6166
  const o = this.displayController.shouldDisableOption(t);
@@ -6174,7 +6207,7 @@ let it = class extends g {
6174
6207
  (o) => this.dataController.isValueSelected(o.value)
6175
6208
  );
6176
6209
  return c`
6177
- <div class="${y(e)}">
6210
+ <div class="${w(e)}">
6178
6211
  ${t.length > 0 ? c`
6179
6212
  <div class="reaction-list">
6180
6213
  ${t.map(
@@ -6187,7 +6220,7 @@ let it = class extends g {
6187
6220
  `;
6188
6221
  } else
6189
6222
  return c`
6190
- <div class="${y(e)}">
6223
+ <div class="${w(e)}">
6191
6224
  <div class="reaction-list">
6192
6225
  ${this.options.map((t) => this.renderReactionButton(t, this.showCounts))}
6193
6226
  </div>
@@ -6210,7 +6243,7 @@ let it = class extends g {
6210
6243
  icon: (p == null ? void 0 : p.icon) || n
6211
6244
  // Use the icon or fall back to reaction value
6212
6245
  };
6213
- }), r = getComputedStyle(this), s = r.getPropertyValue("--pc-primary-color").trim(), a = r.getPropertyValue("--pc-accent-color").trim() || s || "#ffc107", l = $t(o, {
6246
+ }), r = getComputedStyle(this), s = r.getPropertyValue("--pc-primary-color").trim(), a = r.getPropertyValue("--pc-accent-color").trim() || s || "#ffc107", l = Ct(o, {
6214
6247
  barColor: a,
6215
6248
  labelFormatter: (n) => `${n.label}`,
6216
6249
  valueFormatter: (n) => `${e.totalCount > 0 ? Math.round(n.value / e.totalCount * 100) : 0}%`
@@ -6251,18 +6284,18 @@ let it = class extends g {
6251
6284
  * (Reactions are inherently inline, so inline mode = standard mode)
6252
6285
  */
6253
6286
  renderStandardMode() {
6254
- const e = O(this.questionPosition, this.questionAlign), t = {
6287
+ const e = z(this.questionPosition, this.questionAlign), t = {
6255
6288
  [`pc-flex-pos-${this.questionPosition}`]: !0,
6256
6289
  [`pc-flex-align-${e}`]: !0
6257
- }, o = O(this.statsPosition, this.statsAlign), r = {
6290
+ }, o = z(this.statsPosition, this.statsAlign), r = {
6258
6291
  "pc-body": !0,
6259
6292
  [`pc-flex-pos-${this.statsPosition}`]: !0,
6260
6293
  [`pc-flex-align-${o}`]: !0
6261
6294
  };
6262
6295
  return c`
6263
- <div class="${y(t)}" data-testid="reaction-container">
6296
+ <div class="${w(t)}" data-testid="reaction-container">
6264
6297
  ${this.renderLabelAtStart()}
6265
- <div class="${y(r)}" data-testid="reaction-body">
6298
+ <div class="${w(r)}" data-testid="reaction-body">
6266
6299
  ${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderReactions()}
6267
6300
  ${this.renderStatusAtEnd()}
6268
6301
  </div>
@@ -6274,35 +6307,35 @@ let it = class extends g {
6274
6307
  return this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
6275
6308
  }
6276
6309
  };
6277
- it.styles = [...g.styles, Ot, mr];
6278
- It([
6310
+ at.styles = [...m.styles, It, wr];
6311
+ zt([
6279
6312
  f({ type: Boolean, attribute: "show-counts" })
6280
- ], it.prototype, "showCounts", 2);
6281
- It([
6313
+ ], at.prototype, "showCounts", 2);
6314
+ zt([
6282
6315
  f({ type: Boolean, reflect: !0 })
6283
- ], it.prototype, "compact", 2);
6284
- It([
6316
+ ], at.prototype, "compact", 2);
6317
+ zt([
6285
6318
  f({ type: String, attribute: "popup-position" })
6286
- ], it.prototype, "popupPosition", 2);
6287
- it = It([
6288
- Y("pc-reaction")
6289
- ], it);
6290
- function ct(e, t, o = void 0) {
6319
+ ], at.prototype, "popupPosition", 2);
6320
+ at = zt([
6321
+ W("pc-reaction")
6322
+ ], at);
6323
+ function dt(e, t, o = void 0) {
6291
6324
  const r = e.getAttribute(t);
6292
6325
  return r === null ? o : r == null ? void 0 : r.trim();
6293
6326
  }
6294
- function xr(e, t = void 0) {
6327
+ function Cr(e, t = void 0) {
6295
6328
  const o = e.textContent;
6296
6329
  return o === "" || o === null ? t : o == null ? void 0 : o.trim();
6297
6330
  }
6298
- var wr = Object.defineProperty, $r = Object.getOwnPropertyDescriptor, zt = (e, t, o, r) => {
6299
- for (var s = r > 1 ? void 0 : r ? $r(t, o) : t, i = e.length - 1, a; i >= 0; i--)
6331
+ var kr = Object.defineProperty, Er = Object.getOwnPropertyDescriptor, lt = (e, t, o, r) => {
6332
+ for (var s = r > 1 ? void 0 : r ? Er(t, o) : t, i = e.length - 1, a; i >= 0; i--)
6300
6333
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
6301
- return r && s && wr(t, o, s), s;
6334
+ return r && s && kr(t, o, s), s;
6302
6335
  };
6303
- let at = class extends R {
6336
+ let Y = class extends R {
6304
6337
  constructor() {
6305
- super(), this.options = "", this.parsedOptions = [], at.injectGlobalStyle();
6338
+ super(), this.options = "", this.parsedOptions = [], this.isLoadingType = !1, Y.injectGlobalStyle();
6306
6339
  }
6307
6340
  /**
6308
6341
  * Inject global style to hide poll-catch-option elements
@@ -6326,6 +6359,43 @@ let at = class extends R {
6326
6359
  createRenderRoot() {
6327
6360
  return this;
6328
6361
  }
6362
+ connectedCallback() {
6363
+ super.connectedCallback(), this.maybeFetchType();
6364
+ }
6365
+ async maybeFetchType() {
6366
+ var t, o, r, s, i, a, l, n, d, p, h, v, x, k;
6367
+ if (this.type || !this.widgetId) return;
6368
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(this.widgetId)) {
6369
+ g.error(`poll-catch: Invalid widget-id format: ${this.widgetId}`);
6370
+ return;
6371
+ }
6372
+ this.isLoadingType = !0;
6373
+ try {
6374
+ const _ = `${this.getAttribute("data-endpoint") || Yt}/widgets/${encodeURIComponent(this.widgetId)}`, $ = await fetch(_);
6375
+ if (!$.ok)
6376
+ throw new Error(`API request failed with status: ${$.status}`);
6377
+ const y = await $.json();
6378
+ if (!y.success)
6379
+ throw new Error("Backend returned unsuccessful response");
6380
+ const E = (o = (t = y.data) == null ? void 0 : t.config) == null ? void 0 : o.type;
6381
+ if (!E)
6382
+ throw new Error("Backend response missing widget type");
6383
+ Wo(this.widgetId, {
6384
+ type: E,
6385
+ attributes: ((s = (r = y.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null,
6386
+ stats: {
6387
+ count: ((a = (i = y.data) == null ? void 0 : i.stats) == null ? void 0 : a.count) ?? 0,
6388
+ sum: ((n = (l = y.data) == null ? void 0 : l.stats) == null ? void 0 : n.sum) ?? 0,
6389
+ breakdown: ((p = (d = y.data) == null ? void 0 : d.stats) == null ? void 0 : p.breakdown) ?? {},
6390
+ updatedAt: ((v = (h = y.data) == null ? void 0 : h.stats) == null ? void 0 : v.updatedAt) || ((k = (x = y.data) == null ? void 0 : x.stats) == null ? void 0 : k.updated_at)
6391
+ }
6392
+ }), this.type = E, await this.updateComplete, this.forceUpdate();
6393
+ } catch (P) {
6394
+ g.error("poll-catch: Failed to fetch widget config", P);
6395
+ } finally {
6396
+ this.isLoadingType = !1;
6397
+ }
6398
+ }
6329
6399
  forceUpdate() {
6330
6400
  this.forwardAttributesToWidget(), this.forwardOptionsToWidget();
6331
6401
  }
@@ -6361,16 +6431,16 @@ let at = class extends R {
6361
6431
  const e = this.querySelector("pc-poll, pc-reaction");
6362
6432
  if (!e) return;
6363
6433
  const t = this.querySelectorAll("poll-catch-option");
6364
- let r = Vo(this.options).map((s) => ({
6434
+ let r = qo(this.options).map((s) => ({
6365
6435
  value: s,
6366
6436
  label: s,
6367
6437
  icon: e.tagName === "PC-REACTION" ? s : void 0
6368
6438
  // REACTION widget uses options for the icon
6369
6439
  }));
6370
6440
  t && t.length > 0 && (r = Array.from(t).map((s) => {
6371
- const i = ct(s, "value", "") || "", a = ct(s, "label", xr(s, i)) || "", l = ct(s, "icon", void 0), n = ct(s, "tooltip", void 0), d = ct(s, "disabled", void 0), p = { value: i, label: a };
6441
+ const i = dt(s, "value", "") || "", a = dt(s, "label", Cr(s, i)) || "", l = dt(s, "icon", void 0), n = dt(s, "tooltip", void 0), d = dt(s, "disabled", void 0), p = { value: i, label: a };
6372
6442
  if (l !== void 0) {
6373
- const h = At(l);
6443
+ const h = Pt(l);
6374
6444
  p.icon = h.icon;
6375
6445
  }
6376
6446
  return n !== void 0 && (p.tooltip = n), d !== void 0 && (p.disabled = !0), p;
@@ -6380,6 +6450,8 @@ let at = class extends R {
6380
6450
  * Render the appropriate widget based on the type
6381
6451
  */
6382
6452
  render() {
6453
+ if (this.isLoadingType)
6454
+ return u;
6383
6455
  switch (this.type) {
6384
6456
  case S.nps:
6385
6457
  return c`<pc-nps></pc-nps>`;
@@ -6390,24 +6462,30 @@ let at = class extends R {
6390
6462
  case S.reaction:
6391
6463
  return c`<pc-reaction .options=${this.parsedOptions}></pc-reaction>`;
6392
6464
  default:
6393
- return console.warn(
6465
+ return this.widgetId || console.warn(
6394
6466
  `poll-catch: Unknown widget type "${this.type}". Supported types: nps, poll, stars, reaction.`
6395
6467
  ), u;
6396
6468
  }
6397
6469
  }
6398
6470
  };
6399
- zt([
6471
+ lt([
6400
6472
  f({ type: String })
6401
- ], at.prototype, "type", 2);
6402
- zt([
6473
+ ], Y.prototype, "type", 2);
6474
+ lt([
6475
+ f({ type: String, attribute: "widget-id" })
6476
+ ], Y.prototype, "widgetId", 2);
6477
+ lt([
6403
6478
  f({ type: String })
6404
- ], at.prototype, "options", 2);
6405
- zt([
6406
- k()
6407
- ], at.prototype, "parsedOptions", 2);
6408
- at = zt([
6409
- Y("poll-catch")
6410
- ], at);
6479
+ ], Y.prototype, "options", 2);
6480
+ lt([
6481
+ A()
6482
+ ], Y.prototype, "parsedOptions", 2);
6483
+ lt([
6484
+ A()
6485
+ ], Y.prototype, "isLoadingType", 2);
6486
+ Y = lt([
6487
+ W("poll-catch")
6488
+ ], Y);
6411
6489
  export {
6412
- at as PollCatch
6490
+ Y as PollCatch
6413
6491
  };