pollcatch 2.5.4 → 2.5.6
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.
- package/package.json +2 -2
- package/pc.js +634 -676
package/pc.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
7
|
-
let
|
|
6
|
+
const xt = globalThis, Ft = xt.ShadowRoot && (xt.ShadyCSS === void 0 || xt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Yt = Symbol(), te = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
let ke = class {
|
|
8
8
|
constructor(t, o, r) {
|
|
9
|
-
if (this._$cssResult$ = !0, r !==
|
|
9
|
+
if (this._$cssResult$ = !0, r !== Yt) 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 (
|
|
15
|
+
if (Ft && t === void 0) {
|
|
16
16
|
const r = o !== void 0 && o.length === 1;
|
|
17
17
|
r && (t = te.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && te.set(o, t));
|
|
18
18
|
}
|
|
@@ -22,33 +22,33 @@ let Ce = class {
|
|
|
22
22
|
return this.cssText;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const Ke = (e) => new ke(typeof e == "string" ? e : e + "", void 0, Yt), B = (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
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
31
|
+
return new ke(o, e, Yt);
|
|
32
|
+
}, We = (e, t) => {
|
|
33
|
+
if (Ft) 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 =
|
|
35
|
+
const r = document.createElement("style"), s = xt.litNonce;
|
|
36
36
|
s !== void 0 && r.setAttribute("nonce", s), r.textContent = o.cssText, e.appendChild(r);
|
|
37
37
|
}
|
|
38
|
-
}, ee =
|
|
38
|
+
}, ee = Ft ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
|
|
39
39
|
let o = "";
|
|
40
40
|
for (const r of t.cssRules) o += r.cssText;
|
|
41
|
-
return
|
|
41
|
+
return Ke(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:
|
|
48
|
+
const { is: Ge, defineProperty: Ze, getOwnPropertyDescriptor: Xe, getOwnPropertyNames: Je, getOwnPropertySymbols: Qe, getPrototypeOf: to } = Object, j = globalThis, oe = j.trustedTypes, eo = oe ? oe.emptyScript : "", zt = j.reactiveElementPolyfillSupport, lt = (e, t) => e, $t = { toAttribute(e, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
|
-
e = e ?
|
|
51
|
+
e = e ? eo : null;
|
|
52
52
|
break;
|
|
53
53
|
case Object:
|
|
54
54
|
case Array:
|
|
@@ -73,9 +73,9 @@ const { is: Xe, defineProperty: Je, getOwnPropertyDescriptor: Qe, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return o;
|
|
76
|
-
} },
|
|
77
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
78
|
-
let
|
|
76
|
+
} }, Kt = (e, t) => !Ge(e, t), re = { attribute: !0, type: String, converter: $t, reflect: !1, hasChanged: Kt };
|
|
77
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), j.litPropertyMetadata ?? (j.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
|
+
let et = class extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
81
81
|
}
|
|
@@ -85,11 +85,11 @@ let tt = class extends HTMLElement {
|
|
|
85
85
|
static createProperty(t, o = re) {
|
|
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 &&
|
|
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 } =
|
|
92
|
+
const { get: s, set: i } = Xe(this.prototype, t) ?? { get() {
|
|
93
93
|
return this[o];
|
|
94
94
|
}, set(a) {
|
|
95
95
|
this[o] = a;
|
|
@@ -106,13 +106,13 @@ let tt = class extends HTMLElement {
|
|
|
106
106
|
}
|
|
107
107
|
static _$Ei() {
|
|
108
108
|
if (this.hasOwnProperty(lt("elementProperties"))) return;
|
|
109
|
-
const t =
|
|
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
113
|
if (this.hasOwnProperty(lt("finalized"))) return;
|
|
114
114
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(lt("properties"))) {
|
|
115
|
-
const o = this.properties, r = [...
|
|
115
|
+
const o = this.properties, r = [...Je(o), ...Qe(o)];
|
|
116
116
|
for (const s of r) this.createProperty(s, o[s]);
|
|
117
117
|
}
|
|
118
118
|
const t = this[Symbol.metadata];
|
|
@@ -161,7 +161,7 @@ let tt = class extends HTMLElement {
|
|
|
161
161
|
}
|
|
162
162
|
createRenderRoot() {
|
|
163
163
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
164
|
-
return
|
|
164
|
+
return We(t, this.constructor.elementStyles), t;
|
|
165
165
|
}
|
|
166
166
|
connectedCallback() {
|
|
167
167
|
var t;
|
|
@@ -186,7 +186,7 @@ let tt = 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 :
|
|
189
|
+
const a = (((i = r.converter) == null ? void 0 : i.toAttribute) !== void 0 ? r.converter : $t).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 tt = 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 :
|
|
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 : $t;
|
|
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 ??
|
|
203
|
+
if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? Kt)(this[t], o)) return;
|
|
204
204
|
this.P(t, o, r);
|
|
205
205
|
}
|
|
206
206
|
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
@@ -273,59 +273,59 @@ let tt = class extends HTMLElement {
|
|
|
273
273
|
firstUpdated(t) {
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
|
-
|
|
276
|
+
et.elementStyles = [], et.shadowRootOptions = { mode: "open" }, et[lt("elementProperties")] = /* @__PURE__ */ new Map(), et[lt("finalized")] = /* @__PURE__ */ new Map(), zt == null || zt({ ReactiveElement: et }), (j.reactiveElementVersions ?? (j.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 ct = globalThis,
|
|
283
|
-
\f\r]`, at = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ie = /-->/g, ae = />/g,
|
|
284
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), ne = /'/g, le = /"/g,
|
|
285
|
-
function
|
|
282
|
+
const ct = globalThis, St = ct.trustedTypes, se = St ? St.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Ee = "$lit$", U = `lit$${Math.random().toFixed(9).slice(2)}$`, Ae = "?" + U, oo = `<${Ae}>`, G = document, pt = () => G.createComment(""), ut = (e) => e === null || typeof e != "object" && typeof e != "function", Wt = Array.isArray, ro = (e) => Wt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", Mt = `[
|
|
283
|
+
\f\r]`, at = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ie = /-->/g, ae = />/g, K = RegExp(`>|${Mt}(?:([^\\s"'>=/]+)(${Mt}*=${Mt}*(?:[^
|
|
284
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ne = /'/g, le = /"/g, Pe = /^(?:script|style|textarea|title)$/i, so = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), c = so(1), q = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), ce = /* @__PURE__ */ new WeakMap(), W = G.createTreeWalker(G, 129);
|
|
285
|
+
function Te(e, t) {
|
|
286
286
|
if (!Wt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
287
287
|
return se !== void 0 ? se.createHTML(t) : t;
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const io = (e, t) => {
|
|
290
290
|
const o = e.length - 1, r = [];
|
|
291
291
|
let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = at;
|
|
292
292
|
for (let l = 0; l < o; l++) {
|
|
293
293
|
const n = e[l];
|
|
294
|
-
let d, p,
|
|
295
|
-
for (; b < n.length && (a.lastIndex = b, p = a.exec(n), p !== null); ) b = a.lastIndex, a === at ? p[1] === "!--" ? a = ie : p[1] !== void 0 ? a = ae : p[2] !== void 0 ? (
|
|
296
|
-
const
|
|
297
|
-
i += a === at ? n +
|
|
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 === at ? p[1] === "!--" ? a = ie : p[1] !== void 0 ? a = ae : p[2] !== void 0 ? (Pe.test(p[2]) && (s = RegExp("</" + p[2], "g")), a = K) : p[3] !== void 0 && (a = K) : a === K ? p[0] === ">" ? (a = s ?? at, h = -1) : p[1] === void 0 ? h = -2 : (h = a.lastIndex - p[2].length, d = p[1], a = p[3] === void 0 ? K : p[3] === '"' ? le : ne) : a === le || a === ne ? a = K : a === ie || a === ae ? a = at : (a = K, s = void 0);
|
|
296
|
+
const w = a === K && e[l + 1].startsWith("/>") ? " " : "";
|
|
297
|
+
i += a === at ? n + oo : h >= 0 ? (r.push(d), n.slice(0, h) + Ee + n.slice(h) + U + w) : n + U + (h === -2 ? l : w);
|
|
298
298
|
}
|
|
299
|
-
return [
|
|
299
|
+
return [Te(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
|
|
300
300
|
};
|
|
301
|
-
let
|
|
301
|
+
let Ht = class _e {
|
|
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] =
|
|
307
|
-
if (this.el =
|
|
308
|
-
const
|
|
309
|
-
|
|
306
|
+
const l = t.length - 1, n = this.parts, [d, p] = io(t, o);
|
|
307
|
+
if (this.el = _e.createElement(d, r), W.currentNode = this.el.content, o === 2 || o === 3) {
|
|
308
|
+
const h = this.el.content.firstChild;
|
|
309
|
+
h.replaceWith(...h.childNodes);
|
|
310
310
|
}
|
|
311
|
-
for (; (s =
|
|
311
|
+
for (; (s = W.nextNode()) !== null && n.length < l; ) {
|
|
312
312
|
if (s.nodeType === 1) {
|
|
313
|
-
if (s.hasAttributes()) for (const
|
|
314
|
-
const b = p[a++],
|
|
315
|
-
n.push({ type: 1, index: i, name:
|
|
316
|
-
} else
|
|
317
|
-
if (
|
|
318
|
-
const
|
|
313
|
+
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Ee)) {
|
|
314
|
+
const b = p[a++], w = s.getAttribute(h).split(U), E = /([.?@])?(.*)/.exec(b);
|
|
315
|
+
n.push({ type: 1, index: i, name: E[2], strings: w, ctor: E[1] === "." ? no : E[1] === "?" ? lo : E[1] === "@" ? co : At }), s.removeAttribute(h);
|
|
316
|
+
} else h.startsWith(U) && (n.push({ type: 6, index: i }), s.removeAttribute(h));
|
|
317
|
+
if (Pe.test(s.tagName)) {
|
|
318
|
+
const h = s.textContent.split(U), b = h.length - 1;
|
|
319
319
|
if (b > 0) {
|
|
320
|
-
s.textContent =
|
|
321
|
-
for (let
|
|
322
|
-
s.append(
|
|
320
|
+
s.textContent = St ? St.emptyScript : "";
|
|
321
|
+
for (let w = 0; w < b; w++) s.append(h[w], pt()), W.nextNode(), n.push({ type: 2, index: ++i });
|
|
322
|
+
s.append(h[b], pt());
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
} else if (s.nodeType === 8) if (s.data ===
|
|
325
|
+
} else if (s.nodeType === 8) if (s.data === Ae) n.push({ type: 2, index: i });
|
|
326
326
|
else {
|
|
327
|
-
let
|
|
328
|
-
for (; (
|
|
327
|
+
let h = -1;
|
|
328
|
+
for (; (h = s.data.indexOf(U, h + 1)) !== -1; ) n.push({ type: 7, index: i }), h += U.length - 1;
|
|
329
329
|
}
|
|
330
330
|
i++;
|
|
331
331
|
}
|
|
@@ -335,14 +335,14 @@ let jt = class Te {
|
|
|
335
335
|
return r.innerHTML = t, r;
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
|
-
function
|
|
338
|
+
function rt(e, t, o = e, r) {
|
|
339
339
|
var a, l;
|
|
340
|
-
if (t ===
|
|
340
|
+
if (t === q) return t;
|
|
341
341
|
let s = r !== void 0 ? (a = o._$Co) == null ? void 0 : a[r] : o._$Cl;
|
|
342
342
|
const i = ut(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 =
|
|
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 = rt(e, s._$AS(e, t.values), s, r)), t;
|
|
344
344
|
}
|
|
345
|
-
let
|
|
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
|
}
|
|
@@ -354,16 +354,16 @@ let lo = class {
|
|
|
354
354
|
}
|
|
355
355
|
u(t) {
|
|
356
356
|
const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? G).importNode(o, !0);
|
|
357
|
-
|
|
358
|
-
let i =
|
|
357
|
+
W.currentNode = s;
|
|
358
|
+
let i = W.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 ht(i, i.nextSibling, this, t) : n.type === 1 ? d = new n.ctor(i, n.name, n.strings, this, t) : n.type === 6 && (d = new
|
|
362
|
+
n.type === 2 ? d = new ht(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 =
|
|
364
|
+
a !== (n == null ? void 0 : n.index) && (i = W.nextNode(), a++);
|
|
365
365
|
}
|
|
366
|
-
return
|
|
366
|
+
return W.currentNode = G, s;
|
|
367
367
|
}
|
|
368
368
|
p(t) {
|
|
369
369
|
let o = 0;
|
|
@@ -390,7 +390,7 @@ class ht {
|
|
|
390
390
|
return this._$AB;
|
|
391
391
|
}
|
|
392
392
|
_$AI(t, o = this) {
|
|
393
|
-
t =
|
|
393
|
+
t = rt(this, t, o), ut(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== q && 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);
|
|
@@ -403,16 +403,16 @@ class ht {
|
|
|
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 =
|
|
406
|
+
const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Ht.createElement(Te(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
|
|
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
414
|
let o = ce.get(t.strings);
|
|
415
|
-
return o === void 0 && ce.set(t.strings, o = new
|
|
415
|
+
return o === void 0 && ce.set(t.strings, o = new Ht(t)), o;
|
|
416
416
|
}
|
|
417
417
|
k(t) {
|
|
418
418
|
Wt(this._$AH) || (this._$AH = [], this._$AR());
|
|
@@ -433,7 +433,7 @@ class ht {
|
|
|
433
433
|
this._$AM === void 0 && (this._$Cv = t, (o = this._$AP) == null || o.call(this, t));
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
class
|
|
436
|
+
class At {
|
|
437
437
|
get tagName() {
|
|
438
438
|
return this.element.tagName;
|
|
439
439
|
}
|
|
@@ -446,11 +446,11 @@ class Et {
|
|
|
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 =
|
|
449
|
+
if (i === void 0) t = rt(this, t, o, 0), a = !ut(t) || t !== this._$AH && t !== q, 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 =
|
|
453
|
+
for (t = i[0], n = 0; n < i.length - 1; n++) d = rt(this, l[r + n], o, n), d === q && (d = this._$AH[n]), a || (a = !ut(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 Et {
|
|
|
458
458
|
t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
let
|
|
461
|
+
let no = class extends At {
|
|
462
462
|
constructor() {
|
|
463
463
|
super(...arguments), this.type = 3;
|
|
464
464
|
}
|
|
@@ -466,7 +466,7 @@ let co = class extends Et {
|
|
|
466
466
|
this.element[this.name] = t === u ? void 0 : t;
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
|
-
class
|
|
469
|
+
class lo extends At {
|
|
470
470
|
constructor() {
|
|
471
471
|
super(...arguments), this.type = 4;
|
|
472
472
|
}
|
|
@@ -474,12 +474,12 @@ class po extends Et {
|
|
|
474
474
|
this.element.toggleAttribute(this.name, !!t && t !== u);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
class
|
|
477
|
+
class co extends At {
|
|
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 =
|
|
482
|
+
if ((t = rt(this, t, o, 0) ?? u) === q) 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 uo extends Et {
|
|
|
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
|
|
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,12 +496,12 @@ class ho {
|
|
|
496
496
|
return this._$AM._$AU;
|
|
497
497
|
}
|
|
498
498
|
_$AI(t) {
|
|
499
|
-
|
|
499
|
+
rt(this, t);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
const
|
|
502
|
+
const Lt = ct.litHtmlPolyfillSupport;
|
|
503
|
+
Lt == null || Lt(Ht, ht), (ct.litHtmlVersions ?? (ct.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) {
|
|
@@ -515,7 +515,7 @@ const fo = (e, t, o) => {
|
|
|
515
515
|
* Copyright 2017 Google LLC
|
|
516
516
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
517
517
|
*/
|
|
518
|
-
let
|
|
518
|
+
let D = class extends et {
|
|
519
519
|
constructor() {
|
|
520
520
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
521
521
|
}
|
|
@@ -526,7 +526,7 @@ let N = class extends tt {
|
|
|
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 =
|
|
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;
|
|
@@ -537,13 +537,13 @@ let N = class extends tt {
|
|
|
537
537
|
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
|
538
538
|
}
|
|
539
539
|
render() {
|
|
540
|
-
return
|
|
540
|
+
return q;
|
|
541
541
|
}
|
|
542
542
|
};
|
|
543
|
-
var
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
|
|
543
|
+
var Ce;
|
|
544
|
+
D._$litElement$ = !0, D.finalized = !0, (Ce = globalThis.litElementHydrateSupport) == null || Ce.call(globalThis, { LitElement: D });
|
|
545
|
+
const Nt = globalThis.litElementPolyfillSupport;
|
|
546
|
+
Nt == null || Nt({ LitElement: D });
|
|
547
547
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
|
548
548
|
/**
|
|
549
549
|
* @license
|
|
@@ -560,7 +560,7 @@ const F = (e) => (t, o) => {
|
|
|
560
560
|
* Copyright 2017 Google LLC
|
|
561
561
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
562
562
|
*/
|
|
563
|
-
const
|
|
563
|
+
const ho = { attribute: !0, type: String, converter: $t, reflect: !1, hasChanged: Kt }, 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") {
|
|
@@ -581,8 +581,8 @@ const go = { attribute: !0, type: String, converter: xt, reflect: !1, hasChanged
|
|
|
581
581
|
}
|
|
582
582
|
throw Error("Unsupported decorator location: " + r);
|
|
583
583
|
};
|
|
584
|
-
function
|
|
585
|
-
return (t, o) => typeof o == "object" ?
|
|
584
|
+
function f(e) {
|
|
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,15 +592,15 @@ function h(e) {
|
|
|
592
592
|
* Copyright 2017 Google LLC
|
|
593
593
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
594
594
|
*/
|
|
595
|
-
function
|
|
596
|
-
return
|
|
595
|
+
function k(e) {
|
|
596
|
+
return f({ ...e, state: !0, attribute: !1 });
|
|
597
597
|
}
|
|
598
598
|
/**
|
|
599
599
|
* @license
|
|
600
600
|
* Copyright 2017 Google LLC
|
|
601
601
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
602
602
|
*/
|
|
603
|
-
const
|
|
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
|
|
@@ -612,13 +612,13 @@ function ft(e, t) {
|
|
|
612
612
|
var l;
|
|
613
613
|
return ((l = a.renderRoot) == null ? void 0 : l.querySelector(e)) ?? null;
|
|
614
614
|
};
|
|
615
|
-
return
|
|
615
|
+
return go(o, r, { get() {
|
|
616
616
|
return i(this);
|
|
617
617
|
} });
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
620
|
var $ = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))($ || {});
|
|
621
|
-
const
|
|
621
|
+
const Gt = c`
|
|
622
622
|
<svg
|
|
623
623
|
xmlns="http://www.w3.org/2000/svg"
|
|
624
624
|
height="24px"
|
|
@@ -628,7 +628,7 @@ const Kt = c`
|
|
|
628
628
|
>
|
|
629
629
|
<path d="M640-160v-280h160v280H640Zm-240 0v-640h160v640H400Zm-240 0v-440h160v440H160Z" />
|
|
630
630
|
</svg>
|
|
631
|
-
`,
|
|
631
|
+
`, Zt = c`
|
|
632
632
|
<svg
|
|
633
633
|
xmlns="http://www.w3.org/2000/svg"
|
|
634
634
|
height="24px"
|
|
@@ -640,7 +640,7 @@ const Kt = 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
|
-
`,
|
|
643
|
+
`, Ct = c`
|
|
644
644
|
<svg
|
|
645
645
|
xmlns="http://www.w3.org/2000/svg"
|
|
646
646
|
height="24px"
|
|
@@ -652,7 +652,7 @@ const Kt = 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
|
-
`,
|
|
655
|
+
`, Pt = c`
|
|
656
656
|
<svg
|
|
657
657
|
xmlns="http://www.w3.org/2000/svg"
|
|
658
658
|
width="16"
|
|
@@ -664,7 +664,7 @@ const Kt = 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
|
-
`,
|
|
667
|
+
`, Oe = c`
|
|
668
668
|
<svg
|
|
669
669
|
xmlns="http://www.w3.org/2000/svg"
|
|
670
670
|
height="24px"
|
|
@@ -675,100 +675,100 @@ const Kt = c`
|
|
|
675
675
|
<path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z" />
|
|
676
676
|
</svg>
|
|
677
677
|
`;
|
|
678
|
-
var
|
|
678
|
+
var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, M = function(e) {
|
|
679
679
|
return typeof e == "string" ? e.length > 0 : typeof e == "number";
|
|
680
680
|
}, S = 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
|
-
},
|
|
682
|
+
}, A = 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
|
-
},
|
|
684
|
+
}, Ie = function(e) {
|
|
685
685
|
return (e = isFinite(e) ? e % 360 : 0) > 0 ? e : e + 360;
|
|
686
686
|
}, de = function(e) {
|
|
687
|
-
return { r:
|
|
688
|
-
},
|
|
687
|
+
return { r: A(e.r, 0, 255), g: A(e.g, 0, 255), b: A(e.b, 0, 255), a: A(e.a) };
|
|
688
|
+
}, Dt = function(e) {
|
|
689
689
|
return { r: S(e.r), g: S(e.g), b: S(e.b), a: S(e.a, 3) };
|
|
690
|
-
},
|
|
690
|
+
}, vo = /^#([0-9a-f]{3,8})$/i, bt = function(e) {
|
|
691
691
|
var t = e.toString(16);
|
|
692
692
|
return t.length < 2 ? "0" + t : t;
|
|
693
|
-
},
|
|
693
|
+
}, ze = 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
|
-
},
|
|
696
|
+
}, Me = 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
701
|
}, pe = function(e) {
|
|
702
|
-
return { h:
|
|
702
|
+
return { h: Ie(e.h), s: A(e.s, 0, 100), l: A(e.l, 0, 100), a: A(e.a) };
|
|
703
703
|
}, ue = function(e) {
|
|
704
704
|
return { h: S(e.h), s: S(e.s), l: S(e.l), a: S(e.a, 3) };
|
|
705
705
|
}, he = function(e) {
|
|
706
|
-
return
|
|
706
|
+
return Me((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
708
|
}, dt = function(e) {
|
|
709
|
-
return { h: (t =
|
|
709
|
+
return { h: (t = ze(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
|
-
},
|
|
712
|
-
var t =
|
|
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, xo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, wo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, fe = { string: [[function(e) {
|
|
712
|
+
var t = vo.exec(e);
|
|
713
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 ? S(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 ? S(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
|
|
714
714
|
}, "hex"], [function(e) {
|
|
715
|
-
var t =
|
|
715
|
+
var t = xo.exec(e) || wo.exec(e);
|
|
716
716
|
return t ? t[2] !== t[4] || t[4] !== t[6] ? null : de({ 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 =
|
|
718
|
+
var t = bo.exec(e) || yo.exec(e);
|
|
719
719
|
if (!t) return null;
|
|
720
|
-
var o, r, s = pe({ h: (o = t[1], r = t[2], r === void 0 && (r = "deg"), Number(o) * (
|
|
720
|
+
var o, r, s = pe({ 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
721
|
return he(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
|
|
724
|
+
return M(t) && M(o) && M(r) ? de({ 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
|
-
if (!
|
|
727
|
+
if (!M(t) || !M(o) || !M(r)) return null;
|
|
728
728
|
var a = pe({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
|
|
729
729
|
return he(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
|
-
if (!
|
|
732
|
+
if (!M(t) || !M(o) || !M(r)) return null;
|
|
733
733
|
var a = function(l) {
|
|
734
|
-
return { h:
|
|
734
|
+
return { h: Ie(l.h), s: A(l.s, 0, 100), v: A(l.v, 0, 100), a: A(l.a) };
|
|
735
735
|
}({ h: Number(t), s: Number(o), v: Number(r), a: Number(i) });
|
|
736
|
-
return
|
|
736
|
+
return Me(a);
|
|
737
737
|
}, "hsv"]] }, ge = 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
|
-
},
|
|
743
|
+
}, $o = function(e) {
|
|
744
744
|
return typeof e == "string" ? ge(e.trim(), fe.string) : typeof e == "object" && e !== null ? ge(e, fe.object) : [null, void 0];
|
|
745
|
-
},
|
|
745
|
+
}, Rt = function(e, t) {
|
|
746
746
|
var o = dt(e);
|
|
747
|
-
return { h: o.h, s:
|
|
748
|
-
},
|
|
747
|
+
return { h: o.h, s: A(o.s + 100 * t, 0, 100), l: o.l, a: o.a };
|
|
748
|
+
}, Bt = function(e) {
|
|
749
749
|
return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 / 255;
|
|
750
750
|
}, me = function(e, t) {
|
|
751
751
|
var o = dt(e);
|
|
752
|
-
return { h: o.h, s: o.s, l:
|
|
752
|
+
return { h: o.h, s: o.s, l: A(o.l + 100 * t, 0, 100), a: o.a };
|
|
753
753
|
}, ve = function() {
|
|
754
754
|
function e(t) {
|
|
755
|
-
this.parsed =
|
|
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 S(
|
|
760
|
+
return S(Bt(this.rgba), 2);
|
|
761
761
|
}, e.prototype.isDark = function() {
|
|
762
|
-
return
|
|
762
|
+
return Bt(this.rgba) < 0.5;
|
|
763
763
|
}, e.prototype.isLight = function() {
|
|
764
|
-
return
|
|
764
|
+
return Bt(this.rgba) >= 0.5;
|
|
765
765
|
}, e.prototype.toHex = function() {
|
|
766
|
-
return t =
|
|
766
|
+
return t = Dt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? bt(S(255 * i)) : "", "#" + bt(o) + bt(r) + bt(s) + a;
|
|
767
767
|
var t, o, r, s, i, a;
|
|
768
768
|
}, e.prototype.toRgb = function() {
|
|
769
|
-
return
|
|
769
|
+
return Dt(this.rgba);
|
|
770
770
|
}, e.prototype.toRgbString = function() {
|
|
771
|
-
return t =
|
|
771
|
+
return t = Dt(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
774
|
return ue(dt(this.rgba));
|
|
@@ -776,63 +776,63 @@ var bo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, z = function(e) {
|
|
|
776
776
|
return t = ue(dt(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 =
|
|
779
|
+
return t = ze(this.rgba), { h: S(t.h), s: S(t.s), v: S(t.v), a: S(t.a, 3) };
|
|
780
780
|
var t;
|
|
781
781
|
}, e.prototype.invert = function() {
|
|
782
|
-
return
|
|
782
|
+
return T({ 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),
|
|
785
|
+
return t === void 0 && (t = 0.1), T(Rt(this.rgba, t));
|
|
786
786
|
}, e.prototype.desaturate = function(t) {
|
|
787
|
-
return t === void 0 && (t = 0.1),
|
|
787
|
+
return t === void 0 && (t = 0.1), T(Rt(this.rgba, -t));
|
|
788
788
|
}, e.prototype.grayscale = function() {
|
|
789
|
-
return
|
|
789
|
+
return T(Rt(this.rgba, -1));
|
|
790
790
|
}, e.prototype.lighten = function(t) {
|
|
791
|
-
return t === void 0 && (t = 0.1),
|
|
791
|
+
return t === void 0 && (t = 0.1), T(me(this.rgba, t));
|
|
792
792
|
}, e.prototype.darken = function(t) {
|
|
793
|
-
return t === void 0 && (t = 0.1),
|
|
793
|
+
return t === void 0 && (t = 0.1), T(me(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" ?
|
|
797
|
+
return typeof t == "number" ? T({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : S(this.rgba.a, 3);
|
|
798
798
|
var o;
|
|
799
799
|
}, e.prototype.hue = function(t) {
|
|
800
800
|
var o = dt(this.rgba);
|
|
801
|
-
return typeof t == "number" ?
|
|
801
|
+
return typeof t == "number" ? T({ h: t, s: o.s, l: o.l, a: o.a }) : S(o.h);
|
|
802
802
|
}, e.prototype.isEqual = function(t) {
|
|
803
|
-
return this.toHex() ===
|
|
803
|
+
return this.toHex() === T(t).toHex();
|
|
804
804
|
}, e;
|
|
805
|
-
}(),
|
|
805
|
+
}(), T = function(e) {
|
|
806
806
|
return e instanceof ve ? e : new ve(e);
|
|
807
807
|
};
|
|
808
|
-
const
|
|
809
|
-
function
|
|
810
|
-
if (
|
|
808
|
+
const So = typeof process < "u" && (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test");
|
|
809
|
+
function Vt() {
|
|
810
|
+
if (So) return !0;
|
|
811
811
|
try {
|
|
812
812
|
return typeof localStorage < "u" && localStorage.getItem("pc-mode") === "development";
|
|
813
813
|
} catch {
|
|
814
814
|
return !1;
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function Co(e) {
|
|
818
818
|
return {
|
|
819
819
|
debug: (t, ...o) => {
|
|
820
|
-
|
|
820
|
+
Vt() && console.debug(`[${e}]`, t, ...o);
|
|
821
821
|
},
|
|
822
822
|
info: (t, ...o) => {
|
|
823
|
-
|
|
823
|
+
Vt() && console.info(`[${e}]`, t, ...o);
|
|
824
824
|
},
|
|
825
825
|
warn: (t, ...o) => {
|
|
826
|
-
|
|
826
|
+
Vt() && console.warn(`[${e}]`, t, ...o);
|
|
827
827
|
},
|
|
828
828
|
error: (t, ...o) => {
|
|
829
829
|
console.error(`[${e}]`, t, ...o);
|
|
830
830
|
}
|
|
831
831
|
};
|
|
832
832
|
}
|
|
833
|
-
const g =
|
|
834
|
-
var
|
|
835
|
-
const
|
|
833
|
+
const g = Co("Pollcatch");
|
|
834
|
+
var Le = /* @__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))(Le || {});
|
|
835
|
+
const ko = {
|
|
836
836
|
black: "#000000",
|
|
837
837
|
white: "#ffffff",
|
|
838
838
|
red: "#ff0000",
|
|
@@ -849,20 +849,20 @@ const Ao = {
|
|
|
849
849
|
teal: "#008080",
|
|
850
850
|
navy: "#000080"
|
|
851
851
|
};
|
|
852
|
-
function
|
|
852
|
+
function Eo(e) {
|
|
853
853
|
const t = e.toLowerCase().trim();
|
|
854
|
-
return
|
|
854
|
+
return ko[t] || null;
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function Ut(e, t) {
|
|
857
857
|
const o = be(e), r = be(t), s = Math.max(o, r), i = Math.min(o, r);
|
|
858
858
|
return (s + 0.05) / (i + 0.05);
|
|
859
859
|
}
|
|
860
860
|
function be(e) {
|
|
861
|
-
const t =
|
|
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);
|
|
862
862
|
return 0.2126 * i + 0.7152 * a + 0.0722 * l;
|
|
863
863
|
}
|
|
864
|
-
function
|
|
865
|
-
if (!
|
|
864
|
+
function Ao(e, t = {}) {
|
|
865
|
+
if (!T(e).isValid())
|
|
866
866
|
return g.warn(`Invalid color provided: ${e}`), "black";
|
|
867
867
|
const {
|
|
868
868
|
minContrast: r = 4.5,
|
|
@@ -875,16 +875,16 @@ function To(e, t = {}) {
|
|
|
875
875
|
} = t, l = s.map((p) => p === "black" ? "#000000" : p === "white" ? "#ffffff" : p === "light" ? i.light || "#f8f9fa" : p === "dark" ? i.dark || "#343a40" : p);
|
|
876
876
|
let n = a, d = 0;
|
|
877
877
|
for (const p of l) {
|
|
878
|
-
const
|
|
879
|
-
|
|
878
|
+
const h = Ut(e, p);
|
|
879
|
+
h >= r && h > d && (d = h, n = p);
|
|
880
880
|
}
|
|
881
881
|
if (d === 0) {
|
|
882
|
-
const p =
|
|
882
|
+
const p = Ut(e, a);
|
|
883
883
|
n = a, d = p;
|
|
884
|
-
for (const
|
|
885
|
-
if (
|
|
886
|
-
const b =
|
|
887
|
-
b > d && (d = b, n =
|
|
884
|
+
for (const h of l) {
|
|
885
|
+
if (h === a) continue;
|
|
886
|
+
const b = Ut(e, h);
|
|
887
|
+
b > d && (d = b, n = h);
|
|
888
888
|
}
|
|
889
889
|
g.warn(
|
|
890
890
|
`No color option met the minimum contrast ratio of ${r}:1 against ${e}. Using ${n} with contrast ratio ${d.toFixed(2)}:1 instead.`
|
|
@@ -892,14 +892,14 @@ function To(e, t = {}) {
|
|
|
892
892
|
}
|
|
893
893
|
return n;
|
|
894
894
|
}
|
|
895
|
-
function
|
|
896
|
-
const o =
|
|
895
|
+
function Po(e) {
|
|
896
|
+
const o = Eo(e) || e, r = T(o);
|
|
897
897
|
if (!r.isValid())
|
|
898
898
|
return g.warn(`Invalid color provided: ${e}`), { r: 0, g: 0, b: 0 };
|
|
899
899
|
const { r: s, g: i, b: a } = r.toRgb();
|
|
900
900
|
return { r: s, g: i, b: a };
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function O(e, t) {
|
|
903
903
|
const r = t ? {
|
|
904
904
|
left: "start",
|
|
905
905
|
right: "end",
|
|
@@ -911,7 +911,7 @@ function _(e, t) {
|
|
|
911
911
|
}[t] : void 0;
|
|
912
912
|
return e === "left" || e === "right" ? r || "center" : e === "top" || e === "bottom" ? r || "start" : r || "center";
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function jt(e, t = "1rem", o = 1) {
|
|
915
915
|
if (!e) return t;
|
|
916
916
|
const r = {
|
|
917
917
|
xs: 0.7,
|
|
@@ -930,7 +930,7 @@ function Vt(e, t = "1rem", o = 1) {
|
|
|
930
930
|
const l = parseFloat(i);
|
|
931
931
|
return isNaN(l) ? t : `${l}rem`;
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function To(e, t = "4px") {
|
|
934
934
|
if (!e) return t;
|
|
935
935
|
const o = {
|
|
936
936
|
xs: "2px",
|
|
@@ -950,8 +950,8 @@ function Oo(e, t = "4px") {
|
|
|
950
950
|
const a = parseFloat(s);
|
|
951
951
|
return isNaN(a) ? t : `${a}px`;
|
|
952
952
|
}
|
|
953
|
-
var
|
|
954
|
-
function
|
|
953
|
+
var L = /* @__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))(L || {});
|
|
954
|
+
function ot(e) {
|
|
955
955
|
const t = {};
|
|
956
956
|
e.role !== void 0 && (t.role = e.role);
|
|
957
957
|
for (const [o, r] of Object.entries(e)) {
|
|
@@ -961,54 +961,54 @@ function et(e) {
|
|
|
961
961
|
}
|
|
962
962
|
return t;
|
|
963
963
|
}
|
|
964
|
-
function
|
|
965
|
-
return
|
|
964
|
+
function _o(e, t, o) {
|
|
965
|
+
return ot({
|
|
966
966
|
role: "button",
|
|
967
967
|
ariaLabel: e,
|
|
968
968
|
ariaPressed: t,
|
|
969
969
|
ariaDisabled: o
|
|
970
970
|
});
|
|
971
971
|
}
|
|
972
|
-
function
|
|
973
|
-
return
|
|
972
|
+
function Oo(e, t, o, r = !1) {
|
|
973
|
+
return ot({
|
|
974
974
|
role: r ? "radio" : "checkbox",
|
|
975
975
|
ariaLabel: e,
|
|
976
976
|
ariaChecked: t,
|
|
977
977
|
ariaDisabled: o
|
|
978
978
|
});
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function qt(e, t, o) {
|
|
981
981
|
typeof o == "boolean" ? e.setAttribute(t, o ? "true" : "false") : e.setAttribute(t, o);
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function Io(e) {
|
|
984
984
|
if (typeof e != "string")
|
|
985
985
|
return !1;
|
|
986
986
|
const t = e.replace(/[<>"']/g, "").trim();
|
|
987
987
|
return /^(#[0-9a-fA-F]{3,8}|rgb\([^)]+\)|rgba\([^)]+\)|hsl\([^)]+\)|hsla\([^)]+\)|[a-zA-Z]+)$/.test(t);
|
|
988
988
|
}
|
|
989
|
-
function
|
|
990
|
-
return
|
|
989
|
+
function tt(e) {
|
|
990
|
+
return Io(e) ? e.replace(/[<>"']/g, "").trim() : (g.warn("Invalid color value:", e), "#000000");
|
|
991
991
|
}
|
|
992
|
-
function
|
|
992
|
+
function zo(e) {
|
|
993
993
|
if (typeof e != "string")
|
|
994
994
|
return g.warn("Non-string value passed to sanitizeCSS:", typeof e), "";
|
|
995
995
|
let t = e;
|
|
996
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;
|
|
997
997
|
}
|
|
998
|
-
function
|
|
998
|
+
function Mo(e) {
|
|
999
999
|
return typeof e != "string" || !e.trim() ? "" : e.replace(
|
|
1000
1000
|
/([^{}:;]+):\s*([^;{}!]+)(\s*!important)?\s*(;|})/gi,
|
|
1001
1001
|
(t, o, r, s, i) => s ? t : `${o}: ${r.trim()} !important${i}`
|
|
1002
1002
|
);
|
|
1003
1003
|
}
|
|
1004
|
-
const
|
|
1004
|
+
const Lo = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", No = "pc_session_id", Do = 24 * 60 * 60 * 1e3;
|
|
1005
1005
|
function ye() {
|
|
1006
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) {
|
|
1007
1007
|
const t = Math.random() * 16 | 0;
|
|
1008
1008
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
1009
1009
|
}));
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function Xt() {
|
|
1012
1012
|
const e = "test-local-storage";
|
|
1013
1013
|
try {
|
|
1014
1014
|
return localStorage.setItem(e, e), localStorage.removeItem(e), !0;
|
|
@@ -1016,7 +1016,7 @@ function Zt() {
|
|
|
1016
1016
|
return g.warn("localStorage not available, session ID will not persist"), !1;
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1019
|
+
function Ne(e) {
|
|
1020
1020
|
try {
|
|
1021
1021
|
const t = localStorage.getItem(e);
|
|
1022
1022
|
return t ? JSON.parse(t) : void 0;
|
|
@@ -1025,17 +1025,17 @@ function Le(e) {
|
|
|
1025
1025
|
return;
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1028
|
+
function De(e, t) {
|
|
1029
1029
|
try {
|
|
1030
1030
|
return localStorage.setItem(e, JSON.stringify(t)), !0;
|
|
1031
1031
|
} catch (o) {
|
|
1032
1032
|
return g.warn(`Failed to set item in localStorage: ${e}`, o), !1;
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
|
-
async function
|
|
1036
|
-
const e =
|
|
1037
|
-
if (
|
|
1038
|
-
const o =
|
|
1035
|
+
async function xe() {
|
|
1036
|
+
const e = No, t = Do;
|
|
1037
|
+
if (Xt()) {
|
|
1038
|
+
const o = Ne(e);
|
|
1039
1039
|
if (o && o.id && o.timestamp && Date.now() - o.timestamp < t)
|
|
1040
1040
|
return g.debug("Using existing session ID from localStorage"), o.id;
|
|
1041
1041
|
g.debug(
|
|
@@ -1043,7 +1043,7 @@ async function we() {
|
|
|
1043
1043
|
"generating new one"
|
|
1044
1044
|
);
|
|
1045
1045
|
const r = ye();
|
|
1046
|
-
return
|
|
1046
|
+
return De(e, {
|
|
1047
1047
|
id: r,
|
|
1048
1048
|
timestamp: Date.now()
|
|
1049
1049
|
}) ? g.debug("Generated and stored new session ID") : g.warn("Generated session ID but failed to store it"), r;
|
|
@@ -1052,7 +1052,7 @@ async function we() {
|
|
|
1052
1052
|
return g.debug("Generated non-persistent session ID"), o;
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function kt(e) {
|
|
1056
1056
|
if (!e || typeof e != "object")
|
|
1057
1057
|
return 0;
|
|
1058
1058
|
let t = 0, o = 0, r = 0;
|
|
@@ -1065,7 +1065,7 @@ function Ct(e) {
|
|
|
1065
1065
|
const s = t / r * 100, i = o / r * 100;
|
|
1066
1066
|
return Math.round(s - i);
|
|
1067
1067
|
}
|
|
1068
|
-
function
|
|
1068
|
+
function Ro(e) {
|
|
1069
1069
|
if (!e || typeof e != "object")
|
|
1070
1070
|
return { promoters: 0, passives: 0, detractors: 0 };
|
|
1071
1071
|
let t = 0, o = 0, r = 0;
|
|
@@ -1075,14 +1075,14 @@ function Vo(e) {
|
|
|
1075
1075
|
}
|
|
1076
1076
|
return { promoters: t, passives: o, detractors: r };
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1078
|
+
function Bo(e, t) {
|
|
1079
1079
|
const o = {};
|
|
1080
1080
|
for (const r of t)
|
|
1081
1081
|
o[r] = e[r] || 0;
|
|
1082
1082
|
return o;
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1085
|
-
const o = t ?
|
|
1084
|
+
function Vo(e, t) {
|
|
1085
|
+
const o = t ? Bo(e, t) : e;
|
|
1086
1086
|
let r = 0, s = 0;
|
|
1087
1087
|
for (const [a, l] of Object.entries(o)) {
|
|
1088
1088
|
s += l;
|
|
@@ -1091,7 +1091,7 @@ function jo(e, t) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
return { avg: s > 0 ? Math.round(r / s * 10) / 10 : 0, count: s, sum: r, breakdown: o };
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function N() {
|
|
1095
1095
|
return {
|
|
1096
1096
|
count: 0,
|
|
1097
1097
|
sum: 0,
|
|
@@ -1101,26 +1101,26 @@ function L() {
|
|
|
1101
1101
|
updated: (/* @__PURE__ */ new Date()).toISOString()
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1105
|
-
if (!
|
|
1106
|
-
return
|
|
1104
|
+
function Uo(e) {
|
|
1105
|
+
if (!Xt())
|
|
1106
|
+
return N();
|
|
1107
1107
|
try {
|
|
1108
|
-
const t =
|
|
1109
|
-
return t ? { ...
|
|
1108
|
+
const t = Ne(e);
|
|
1109
|
+
return t ? { ...N(), ...t } : N();
|
|
1110
1110
|
} catch (t) {
|
|
1111
|
-
return g.warn("Failed to load localStats from localStorage", t),
|
|
1111
|
+
return g.warn("Failed to load localStats from localStorage", t), N();
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1115
|
-
if (!
|
|
1114
|
+
function jo(e, t) {
|
|
1115
|
+
if (!Xt())
|
|
1116
1116
|
return !1;
|
|
1117
1117
|
try {
|
|
1118
|
-
return
|
|
1118
|
+
return De(e, t) ? (g.debug("Saved localStats to localStorage", t), !0) : !1;
|
|
1119
1119
|
} catch (o) {
|
|
1120
1120
|
return g.warn("Failed to save localStats to localStorage", o), !1;
|
|
1121
1121
|
}
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function qo(e, t) {
|
|
1124
1124
|
const o = {
|
|
1125
1125
|
count: Math.max(0, e.count - t.count),
|
|
1126
1126
|
sum: (e.sum || 0) - (t.sum || 0),
|
|
@@ -1133,11 +1133,11 @@ function Fo(e, t) {
|
|
|
1133
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)
|
|
1134
1134
|
for (const [r, s] of Object.entries(t.breakdown))
|
|
1135
1135
|
o.breakdown[r] && (o.breakdown[r] = Math.max(0, o.breakdown[r] - s), o.breakdown[r] === 0 && delete o.breakdown[r]);
|
|
1136
|
-
return o.nps =
|
|
1136
|
+
return o.nps = kt((o == null ? void 0 : o.breakdown) || {}), o;
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1138
|
+
function Ho(e, t) {
|
|
1139
1139
|
if (!e.count && !t.count)
|
|
1140
|
-
return
|
|
1140
|
+
return N();
|
|
1141
1141
|
if (!e.count)
|
|
1142
1142
|
return { ...t };
|
|
1143
1143
|
const o = {
|
|
@@ -1154,12 +1154,12 @@ function Yo(e, t) {
|
|
|
1154
1154
|
for (const [r, s] of Object.entries(t.breakdown))
|
|
1155
1155
|
o.breakdown[r] = (o.breakdown[r] || 0) + s;
|
|
1156
1156
|
}
|
|
1157
|
-
return o.nps =
|
|
1157
|
+
return o.nps = kt((o == null ? void 0 : o.breakdown) || {}), o;
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1159
|
+
function Re(e) {
|
|
1160
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);
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1162
|
+
function Tt(e) {
|
|
1163
1163
|
if (!e || typeof e != "string")
|
|
1164
1164
|
return !1;
|
|
1165
1165
|
const t = e.trim();
|
|
@@ -1173,7 +1173,7 @@ function Pt(e) {
|
|
|
1173
1173
|
return !1;
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1176
|
+
function Be(e) {
|
|
1177
1177
|
if (!e || typeof e != "string")
|
|
1178
1178
|
return [];
|
|
1179
1179
|
const t = e.trim();
|
|
@@ -1188,40 +1188,32 @@ function Re(e) {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
return t.split(",").map((o) => o.trim()).filter((o) => o !== "");
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function Fo(e, t) {
|
|
1192
1192
|
const o = /{([^{}]+)}/g;
|
|
1193
1193
|
return e.replace(o, (r, s) => {
|
|
1194
1194
|
const i = s.trim(), a = t[i];
|
|
1195
1195
|
return a !== void 0 ? String(a) : r;
|
|
1196
1196
|
});
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function Yo(e, t) {
|
|
1199
1199
|
let o = 2166136261;
|
|
1200
1200
|
const r = e + ":" + t;
|
|
1201
1201
|
for (let s = 0; s < r.length; s++)
|
|
1202
1202
|
o ^= r.charCodeAt(s), o += (o << 1) + (o << 4) + (o << 7) + (o << 8) + (o << 24);
|
|
1203
1203
|
return (o >>> 0).toString(16).padStart(8, "0");
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function Ko(e, t = 50) {
|
|
1206
1206
|
return e.length <= t ? e : e.substring(0, t).trim() + "...";
|
|
1207
1207
|
}
|
|
1208
|
-
const
|
|
1209
|
-
function Zo(e, t) {
|
|
1210
|
-
qt.set(e, t);
|
|
1211
|
-
}
|
|
1212
|
-
function Xo(e) {
|
|
1213
|
-
const t = qt.get(e);
|
|
1214
|
-
return t && qt.delete(e), t;
|
|
1215
|
-
}
|
|
1216
|
-
const Be = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, xe = 5;
|
|
1208
|
+
const Wo = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, we = 5;
|
|
1217
1209
|
function Ve(e) {
|
|
1218
|
-
return e ||
|
|
1210
|
+
return e || Lo;
|
|
1219
1211
|
}
|
|
1220
1212
|
function Ue(e, t) {
|
|
1221
1213
|
const o = Ve(t);
|
|
1222
1214
|
return e.type === "registered" ? `${o}/widgets/${encodeURIComponent(e.widgetId)}` : `${o}/public-widgets/${encodeURIComponent(e.name)}`;
|
|
1223
1215
|
}
|
|
1224
|
-
async function
|
|
1216
|
+
async function $e(e, t) {
|
|
1225
1217
|
const o = Ue(e, t);
|
|
1226
1218
|
g.debug("API GET", { url: o });
|
|
1227
1219
|
const r = await fetch(o);
|
|
@@ -1232,7 +1224,7 @@ async function je(e, t) {
|
|
|
1232
1224
|
throw new Error("Backend returned unsuccessful response");
|
|
1233
1225
|
return s;
|
|
1234
1226
|
}
|
|
1235
|
-
async function
|
|
1227
|
+
async function Go(e, t, o) {
|
|
1236
1228
|
const r = Ue(e, o);
|
|
1237
1229
|
if (g.debug("API POST", { url: r }), typeof navigator < "u" && navigator.sendBeacon) {
|
|
1238
1230
|
if (navigator.sendBeacon(r, t)) {
|
|
@@ -1253,10 +1245,10 @@ async function Jo(e, t, o) {
|
|
|
1253
1245
|
throw new Error(`API request failed with status: ${s.status}`);
|
|
1254
1246
|
g.debug("Successfully sent stats via fetch");
|
|
1255
1247
|
}
|
|
1256
|
-
class
|
|
1257
|
-
//
|
|
1248
|
+
class Zo {
|
|
1249
|
+
// Set when a fatal error occurs (e.g. type mismatch for registered widget)
|
|
1258
1250
|
constructor(t) {
|
|
1259
|
-
this.stats =
|
|
1251
|
+
this.stats = N(), this.localStats = N(), this.prevLocalStats = N(), this.isLoading = !0, this.isLoadingConfig = !1, this.isSubmitting = !1, this.hasInteracted = !1, this.hasError = !1, (this.host = t).addController(this);
|
|
1260
1252
|
}
|
|
1261
1253
|
hostConnected() {
|
|
1262
1254
|
this.loadStats();
|
|
@@ -1267,12 +1259,12 @@ class Qo {
|
|
|
1267
1259
|
*/
|
|
1268
1260
|
getWidgetIdentifier() {
|
|
1269
1261
|
const t = this.host;
|
|
1270
|
-
return t.widgetId ?
|
|
1271
|
-
`Widget name must be at least ${
|
|
1262
|
+
return t.widgetId ? Wo.test(t.widgetId) ? { type: "registered", widgetId: t.widgetId } : (g.error(`Invalid widget-id format: ${t.widgetId}`), null) : t.name ? t.name.length < we ? (g.error(
|
|
1263
|
+
`Widget name must be at least ${we} characters long. Got: "${t.name}"`
|
|
1272
1264
|
), null) : { type: "public", name: t.name } : (g.error("Widget requires either widget-id or name attribute"), null);
|
|
1273
1265
|
}
|
|
1274
1266
|
async getLocalStatsKey() {
|
|
1275
|
-
const t = this.host, o = await
|
|
1267
|
+
const t = this.host, o = await xe(), r = t.widgetId || t.name || "unnamed";
|
|
1276
1268
|
return `pc-local-stats-${o}-${r}`;
|
|
1277
1269
|
}
|
|
1278
1270
|
/**
|
|
@@ -1288,86 +1280,89 @@ class Qo {
|
|
|
1288
1280
|
*/
|
|
1289
1281
|
applyWidgetAttributes(t) {
|
|
1290
1282
|
if (!t) return;
|
|
1291
|
-
const o = typeof t.attributes == "object" && t.attributes !== null && !Array.isArray(t.attributes) ? t.attributes : t, r = this.host, s = r;
|
|
1292
|
-
for (
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1283
|
+
const o = typeof t.attributes == "object" && t.attributes !== null && !Array.isArray(t.attributes) ? t.attributes : t, r = this.host, s = r, i = /* @__PURE__ */ new Set();
|
|
1284
|
+
for (let a = 0; a < s.attributes.length; a++) {
|
|
1285
|
+
const l = s.attributes[a];
|
|
1286
|
+
l && l.name !== "type" && l.name !== "options" && l.name !== "initialized" && i.add(l.name);
|
|
1287
|
+
}
|
|
1288
|
+
for (const [a, l] of Object.entries(o)) {
|
|
1289
|
+
if (l == null) continue;
|
|
1290
|
+
if (a === "options" && typeof l == "string") {
|
|
1291
|
+
const d = Be(l);
|
|
1292
|
+
r.options = d.map((p) => ({
|
|
1293
|
+
value: p,
|
|
1294
|
+
label: p,
|
|
1295
|
+
icon: r.type === $.reaction ? p : void 0
|
|
1296
|
+
})), g.debug("Applied widget options as property:", d);
|
|
1301
1297
|
continue;
|
|
1302
1298
|
}
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1299
|
+
const n = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1300
|
+
if (i.has(n)) {
|
|
1301
|
+
g.debug(`Skipping server attribute "${n}" — overridden by inline attribute`);
|
|
1302
|
+
continue;
|
|
1303
|
+
}
|
|
1304
|
+
typeof l == "boolean" ? l ? s.setAttribute(n, "") : s.removeAttribute(n) : typeof l == "object" ? s.setAttribute(n, JSON.stringify(l)) : s.setAttribute(n, String(l)), g.debug(`Applied widget attribute: ${n}=${l}`);
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
1307
|
/**
|
|
1308
1308
|
* Loads the stats for the widget.
|
|
1309
1309
|
*/
|
|
1310
1310
|
async loadServerStats() {
|
|
1311
|
-
var r, s, i;
|
|
1311
|
+
var r, s, i, a, l;
|
|
1312
1312
|
const t = this.host;
|
|
1313
1313
|
this.isLoading = !1, this.stats = this.localStats, this.host.requestUpdate();
|
|
1314
1314
|
const o = this.getWidgetIdentifier();
|
|
1315
1315
|
if (o)
|
|
1316
1316
|
try {
|
|
1317
|
-
let
|
|
1317
|
+
let n, d;
|
|
1318
1318
|
if (o.type === "registered") {
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
if (o.type !== "registered" && t.dataFunc && typeof window < "u") {
|
|
1327
|
-
const A = t.dataFunc.replace(/^window\./, "").split(".");
|
|
1328
|
-
let k = window;
|
|
1329
|
-
for (const I of A)
|
|
1330
|
-
if (k = k == null ? void 0 : k[I], k === void 0) break;
|
|
1331
|
-
y = k;
|
|
1319
|
+
this.isLoadingConfig = !0, this.host.requestUpdate();
|
|
1320
|
+
const C = await $e(o), x = (s = (r = C.data) == null ? void 0 : r.config) == null ? void 0 : s.type;
|
|
1321
|
+
if (x && x !== t.type) {
|
|
1322
|
+
g.error(
|
|
1323
|
+
`Widget type mismatch: type="${t.type}" but server returned "${x}" for widget-id="${o.widgetId}"`
|
|
1324
|
+
), this.hasError = !0;
|
|
1325
|
+
return;
|
|
1332
1326
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1327
|
+
const P = ((a = (i = C.data) == null ? void 0 : i.config) == null ? void 0 : a.attributes) || null;
|
|
1328
|
+
n = ((l = C.data) == null ? void 0 : l.stats) || {}, this.applyWidgetAttributes(P);
|
|
1329
|
+
} else {
|
|
1330
|
+
let C;
|
|
1331
|
+
if (t.dataFunc && typeof window < "u") {
|
|
1332
|
+
const P = t.dataFunc.replace(/^window\./, "").split(".");
|
|
1333
|
+
let z = window;
|
|
1334
|
+
for (const It of P)
|
|
1335
|
+
if (z = z == null ? void 0 : z[It], z === void 0) break;
|
|
1336
|
+
C = z;
|
|
1337
|
+
}
|
|
1338
|
+
if (C && typeof C == "function") {
|
|
1339
|
+
d = this.getValidOptionKeys(t), g.debug(`Using data function for: ${t.widgetId || t.name}`, {
|
|
1335
1340
|
dataFuncName: t.dataFunc,
|
|
1336
|
-
options:
|
|
1341
|
+
options: d
|
|
1337
1342
|
});
|
|
1338
|
-
const x = await
|
|
1343
|
+
const x = await C(t.widgetId, t.name, d);
|
|
1339
1344
|
if (x && typeof x == "object" && "success" in x && "data" in x) {
|
|
1340
1345
|
if (!x.success)
|
|
1341
1346
|
throw g.error("Custom data function returned unsuccessful response", x), new Error("Custom data function returned unsuccessful response");
|
|
1342
|
-
|
|
1343
|
-
} else
|
|
1344
|
-
a = x || {};
|
|
1345
|
-
} else {
|
|
1346
|
-
o.type === "registered" && (this.isLoadingConfig = !0, this.host.requestUpdate());
|
|
1347
|
-
const x = await je(
|
|
1348
|
-
o,
|
|
1349
|
-
o.type === "registered" ? void 0 : t.dataEndpoint
|
|
1350
|
-
);
|
|
1351
|
-
if (o.type === "registered") {
|
|
1352
|
-
const A = ((s = (r = x.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null;
|
|
1353
|
-
a = ((i = x.data) == null ? void 0 : i.stats) || {}, this.applyWidgetAttributes(A);
|
|
1347
|
+
n = x.data || {};
|
|
1354
1348
|
} else
|
|
1355
|
-
|
|
1356
|
-
}
|
|
1349
|
+
n = x || {};
|
|
1350
|
+
} else
|
|
1351
|
+
n = (await $e(o, t.dataEndpoint)).data || {};
|
|
1357
1352
|
}
|
|
1358
|
-
|
|
1359
|
-
const
|
|
1353
|
+
d ?? (d = this.getValidOptionKeys(t));
|
|
1354
|
+
const p = Vo(n.breakdown ?? {}, d), h = p.count, b = p.sum, w = h > 0 ? Math.round(b / h * 10) / 10 : 0, E = h > 0 ? Math.round(b / h * 100) : 0;
|
|
1360
1355
|
this.stats = {
|
|
1361
|
-
count:
|
|
1362
|
-
sum:
|
|
1363
|
-
avg:
|
|
1364
|
-
pct:
|
|
1365
|
-
nps: t.type === $.nps ?
|
|
1366
|
-
breakdown:
|
|
1367
|
-
updated:
|
|
1356
|
+
count: h,
|
|
1357
|
+
sum: b,
|
|
1358
|
+
avg: w,
|
|
1359
|
+
pct: E,
|
|
1360
|
+
nps: t.type === $.nps ? kt(p.breakdown) : 0,
|
|
1361
|
+
breakdown: p.breakdown,
|
|
1362
|
+
updated: n.updatedAt || n.updated_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
1368
1363
|
};
|
|
1369
|
-
} catch (
|
|
1370
|
-
throw g.error("Error loading stats:",
|
|
1364
|
+
} catch (n) {
|
|
1365
|
+
throw g.error("Error loading stats:", n, this.localStats), n;
|
|
1371
1366
|
} finally {
|
|
1372
1367
|
this.isLoading = !1, this.isLoadingConfig = !1, this.host.requestUpdate();
|
|
1373
1368
|
}
|
|
@@ -1398,10 +1393,10 @@ class Qo {
|
|
|
1398
1393
|
async loadLocalStats() {
|
|
1399
1394
|
const t = await this.getLocalStatsKey();
|
|
1400
1395
|
try {
|
|
1401
|
-
const o =
|
|
1396
|
+
const o = Uo(t);
|
|
1402
1397
|
g.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
|
|
1403
1398
|
} catch (o) {
|
|
1404
|
-
g.warn("Failed to generate localStorage key for localStats", o), this.localStats =
|
|
1399
|
+
g.warn("Failed to generate localStorage key for localStats", o), this.localStats = N();
|
|
1405
1400
|
}
|
|
1406
1401
|
this.host.requestUpdate();
|
|
1407
1402
|
}
|
|
@@ -1411,7 +1406,7 @@ class Qo {
|
|
|
1411
1406
|
async persistLocalStats() {
|
|
1412
1407
|
try {
|
|
1413
1408
|
const t = await this.getLocalStatsKey();
|
|
1414
|
-
|
|
1409
|
+
jo(t, this.localStats) || g.warn("Failed to save localStats to localStorage");
|
|
1415
1410
|
} catch (t) {
|
|
1416
1411
|
g.warn("Failed to save localStats to localStorage", t);
|
|
1417
1412
|
}
|
|
@@ -1425,7 +1420,7 @@ class Qo {
|
|
|
1425
1420
|
* @param textValues
|
|
1426
1421
|
*/
|
|
1427
1422
|
updateStats(t, o) {
|
|
1428
|
-
if (this.hasInteracted = !0, this.stats && (this.stats =
|
|
1423
|
+
if (this.hasInteracted = !0, this.stats && (this.stats = qo(this.stats, this.localStats)), this.localStats = {
|
|
1429
1424
|
count: t > 0 || o.length > 0 ? 1 : 0,
|
|
1430
1425
|
sum: t,
|
|
1431
1426
|
// e.g. number of stars, nps value
|
|
@@ -1439,7 +1434,7 @@ class Qo {
|
|
|
1439
1434
|
}, o && o.length > 0)
|
|
1440
1435
|
for (const r of o)
|
|
1441
1436
|
r && (this.localStats.breakdown[r] = 1);
|
|
1442
|
-
this.stats =
|
|
1437
|
+
this.stats = Ho(this.stats, this.localStats), g.debug("Stats updated - remote: ", this.stats), g.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
|
|
1443
1438
|
}
|
|
1444
1439
|
async markStatsAsSubmitted() {
|
|
1445
1440
|
this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), this.prevLocalStats = { ...this.localStats }, await this.persistLocalStats(), this.host.requestUpdate();
|
|
@@ -1447,7 +1442,7 @@ class Qo {
|
|
|
1447
1442
|
async submitStats() {
|
|
1448
1443
|
if (!this.hasLocalStats() && !this.hasInteracted)
|
|
1449
1444
|
throw g.warn("No local stats to submit"), new Error("No local stats to submit");
|
|
1450
|
-
const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await
|
|
1445
|
+
const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await xe(), s = this.localStats.sum, i = Object.keys(this.localStats.breakdown || {}), a = this.prevLocalStats.sum, l = Object.keys(this.prevLocalStats.breakdown || {});
|
|
1451
1446
|
this.isSubmitting = !0, this.host.requestUpdate();
|
|
1452
1447
|
const n = {
|
|
1453
1448
|
sessionId: r,
|
|
@@ -1461,7 +1456,7 @@ class Qo {
|
|
|
1461
1456
|
prevTextValues: l,
|
|
1462
1457
|
metadata: t.metadata,
|
|
1463
1458
|
timestamp: o
|
|
1464
|
-
}, d =
|
|
1459
|
+
}, d = Yo(JSON.stringify(n), o);
|
|
1465
1460
|
try {
|
|
1466
1461
|
await this.sendStats({ ...n, hash: d }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(n);
|
|
1467
1462
|
} catch (p) {
|
|
@@ -1479,11 +1474,11 @@ class Qo {
|
|
|
1479
1474
|
return;
|
|
1480
1475
|
}
|
|
1481
1476
|
const s = r.type === "registered" ? void 0 : o.dataEndpoint, i = Ve(s);
|
|
1482
|
-
if (!
|
|
1477
|
+
if (!Tt(i))
|
|
1483
1478
|
throw g.error("Invalid data endpoint", { dataEndpoint: i }), new Error(`Invalid data endpoint: ${i}`);
|
|
1484
1479
|
const a = JSON.stringify(t);
|
|
1485
1480
|
try {
|
|
1486
|
-
await
|
|
1481
|
+
await Go(r, a, s);
|
|
1487
1482
|
} catch (l) {
|
|
1488
1483
|
throw g.error("Failed to send analytics:", l), l;
|
|
1489
1484
|
}
|
|
@@ -1500,9 +1495,9 @@ class Qo {
|
|
|
1500
1495
|
sum: (o == null ? void 0 : o.sum) || 0,
|
|
1501
1496
|
avg: s,
|
|
1502
1497
|
pct: (o == null ? void 0 : o.pct) || 0,
|
|
1503
|
-
nps: r.type === $.nps ?
|
|
1498
|
+
nps: r.type === $.nps ? kt((o == null ? void 0 : o.breakdown) || {}) : 0
|
|
1504
1499
|
};
|
|
1505
|
-
return g.debug("Stats data: ", this.stats),
|
|
1500
|
+
return g.debug("Stats data: ", this.stats), Fo(t, i);
|
|
1506
1501
|
}
|
|
1507
1502
|
/**
|
|
1508
1503
|
* Checks if a value is selected in the local stats
|
|
@@ -1589,7 +1584,7 @@ class Qo {
|
|
|
1589
1584
|
return ((t = this.localStats) == null ? void 0 : t.submitted) !== void 0 && this.hasLocalStats();
|
|
1590
1585
|
}
|
|
1591
1586
|
}
|
|
1592
|
-
class
|
|
1587
|
+
class Xo {
|
|
1593
1588
|
constructor(t, o) {
|
|
1594
1589
|
this.isEditing = !0, this.isChartVisible = !1, this.isStatsVisible = !1, this.isThankYouVisible = !1, this.isReactionPopoverVisible = !1, this.initialized = !1, this.handleClickOutside = (r) => {
|
|
1595
1590
|
r.target !== this.host && (this.toggleThankYouVisibility(!1), this.toggleReactionPopoverVisibility(!1));
|
|
@@ -1677,8 +1672,8 @@ class tr {
|
|
|
1677
1672
|
return !(this.host.readonly || !this.isEditing);
|
|
1678
1673
|
}
|
|
1679
1674
|
}
|
|
1680
|
-
var
|
|
1681
|
-
function
|
|
1675
|
+
var Jt = /* @__PURE__ */ ((e) => (e.DECORATIVE = "decorative", e.FUNCTIONAL = "functional", e.STATUS = "status", e))(Jt || {});
|
|
1676
|
+
function je(e, t = {}) {
|
|
1682
1677
|
const { type: o = "functional", alt: r, ariaLabel: s, isSelected: i } = t;
|
|
1683
1678
|
if (!e)
|
|
1684
1679
|
return { alt: "", ariaHidden: !0 };
|
|
@@ -1687,20 +1682,20 @@ function qe(e, t = {}) {
|
|
|
1687
1682
|
o === "functional" && !r && !s && console.warn(
|
|
1688
1683
|
"No alt text or aria-label provided for functional icon. This may cause accessibility issues."
|
|
1689
1684
|
);
|
|
1690
|
-
const a = i ? " (selected)" : "", l =
|
|
1685
|
+
const a = i ? " (selected)" : "", l = Tt(e) && !r ? "" : r || e, n = s || (l ? `${l}${a}` : a);
|
|
1691
1686
|
return {
|
|
1692
1687
|
alt: l,
|
|
1693
1688
|
ariaLabel: n,
|
|
1694
1689
|
ariaHidden: !1
|
|
1695
1690
|
};
|
|
1696
1691
|
}
|
|
1697
|
-
function
|
|
1692
|
+
function Jo(e, t = "polite") {
|
|
1698
1693
|
let o = document.getElementById("screen-reader-announcer");
|
|
1699
1694
|
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(() => {
|
|
1700
1695
|
o.textContent = e;
|
|
1701
1696
|
}, 50);
|
|
1702
1697
|
}
|
|
1703
|
-
function
|
|
1698
|
+
function Qo(e, t) {
|
|
1704
1699
|
return `${e}: ${t}`;
|
|
1705
1700
|
}
|
|
1706
1701
|
/**
|
|
@@ -1708,8 +1703,8 @@ function or(e, t) {
|
|
|
1708
1703
|
* Copyright 2017 Google LLC
|
|
1709
1704
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1710
1705
|
*/
|
|
1711
|
-
const
|
|
1712
|
-
let
|
|
1706
|
+
const qe = { ATTRIBUTE: 1 }, He = (e) => (...t) => ({ _$litDirective$: e, values: t });
|
|
1707
|
+
let Fe = class {
|
|
1713
1708
|
constructor(t) {
|
|
1714
1709
|
}
|
|
1715
1710
|
get _$AU() {
|
|
@@ -1730,10 +1725,10 @@ let Ye = class {
|
|
|
1730
1725
|
* Copyright 2018 Google LLC
|
|
1731
1726
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1732
1727
|
*/
|
|
1733
|
-
const
|
|
1728
|
+
const y = He(class extends Fe {
|
|
1734
1729
|
constructor(e) {
|
|
1735
1730
|
var t;
|
|
1736
|
-
if (super(e), e.type !==
|
|
1731
|
+
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.");
|
|
1737
1732
|
}
|
|
1738
1733
|
render(e) {
|
|
1739
1734
|
return " " + Object.keys(e).filter((t) => e[t]).join(" ") + " ";
|
|
@@ -1751,21 +1746,21 @@ const w = Fe(class extends Ye {
|
|
|
1751
1746
|
const a = !!t[i];
|
|
1752
1747
|
a === this.st.has(i) || (s = this.nt) != null && s.has(i) || (a ? (o.add(i), this.st.add(i)) : (o.remove(i), this.st.delete(i)));
|
|
1753
1748
|
}
|
|
1754
|
-
return
|
|
1749
|
+
return q;
|
|
1755
1750
|
}
|
|
1756
1751
|
});
|
|
1757
|
-
var
|
|
1752
|
+
var tr = Object.defineProperty, v = (e, t, o, r) => {
|
|
1758
1753
|
for (var s = void 0, i = e.length - 1, a; i >= 0; i--)
|
|
1759
1754
|
(a = e[i]) && (s = a(t, o, s) || s);
|
|
1760
|
-
return s &&
|
|
1755
|
+
return s && tr(t, o, s), s;
|
|
1761
1756
|
};
|
|
1762
|
-
const
|
|
1757
|
+
const yt = {
|
|
1763
1758
|
mobile: "480px",
|
|
1764
1759
|
tablet: "768px",
|
|
1765
1760
|
desktop: "1024px"
|
|
1766
|
-
},
|
|
1761
|
+
}, Qt = class Qt extends D {
|
|
1767
1762
|
constructor() {
|
|
1768
|
-
super(...arguments), this.dataController = new
|
|
1763
|
+
super(...arguments), this.dataController = new Zo(this), this.displayController = new Xo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.ariaLabel = null, this.minContrast = Le.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) => {
|
|
1769
1764
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
|
|
1770
1765
|
};
|
|
1771
1766
|
}
|
|
@@ -1797,10 +1792,10 @@ const bt = {
|
|
|
1797
1792
|
let o = `:host {
|
|
1798
1793
|
`;
|
|
1799
1794
|
if (this.primaryColor) {
|
|
1800
|
-
const i =
|
|
1795
|
+
const i = tt(this.primaryColor);
|
|
1801
1796
|
o += `--pc-primary-color: ${i} !important;
|
|
1802
1797
|
`;
|
|
1803
|
-
const a =
|
|
1798
|
+
const a = Ao(i, {
|
|
1804
1799
|
minContrast: this.minContrast,
|
|
1805
1800
|
colorOptions: ["black", "white", "light", "dark"]
|
|
1806
1801
|
});
|
|
@@ -1808,73 +1803,73 @@ const bt = {
|
|
|
1808
1803
|
`;
|
|
1809
1804
|
}
|
|
1810
1805
|
if (this.muteColor) {
|
|
1811
|
-
const i =
|
|
1806
|
+
const i = tt(this.muteColor);
|
|
1812
1807
|
o += `--pc-mute-color: ${i} !important;
|
|
1813
1808
|
`;
|
|
1814
1809
|
}
|
|
1815
1810
|
if (this.textColor) {
|
|
1816
|
-
const i =
|
|
1811
|
+
const i = tt(this.textColor);
|
|
1817
1812
|
o += `--pc-text-color: ${i} !important;
|
|
1818
1813
|
`;
|
|
1819
1814
|
}
|
|
1820
1815
|
if (this.backgroundColor) {
|
|
1821
|
-
const i =
|
|
1816
|
+
const i = tt(this.backgroundColor);
|
|
1822
1817
|
o += `--pc-background-color: ${i} !important;
|
|
1823
1818
|
`;
|
|
1824
1819
|
}
|
|
1825
1820
|
const r = this.starColor || this.accentColor || this.primaryColor;
|
|
1826
1821
|
if (r) {
|
|
1827
|
-
const i =
|
|
1822
|
+
const i = tt(r);
|
|
1828
1823
|
o += `--pc-star-color: ${i} !important;
|
|
1829
1824
|
`;
|
|
1830
1825
|
}
|
|
1831
|
-
const s = this.starHoverColor || (r ? `color-mix(in srgb, ${
|
|
1826
|
+
const s = this.starHoverColor || (r ? `color-mix(in srgb, ${tt(r)} 80%, white)` : null);
|
|
1832
1827
|
if (s && (o += `--pc-star-hover-color: ${s} !important;
|
|
1833
1828
|
`), this.starSize) {
|
|
1834
|
-
const i =
|
|
1829
|
+
const i = jt(this.starSize, "1.5em", 1.5);
|
|
1835
1830
|
o += `--pc-stars-star-size: ${i} !important;
|
|
1836
1831
|
`;
|
|
1837
1832
|
}
|
|
1838
1833
|
if (this.reactionSize) {
|
|
1839
|
-
const i =
|
|
1834
|
+
const i = jt(this.reactionSize, "1em", 1);
|
|
1840
1835
|
o += `--pc-reaction-size: ${i} !important;
|
|
1841
1836
|
`;
|
|
1842
1837
|
}
|
|
1843
1838
|
if (this.size) {
|
|
1844
|
-
const i =
|
|
1839
|
+
const i = jt(this.size);
|
|
1845
1840
|
o += `font-size: ${i} !important;
|
|
1846
1841
|
`;
|
|
1847
1842
|
}
|
|
1848
1843
|
if (this.buttonRadius) {
|
|
1849
|
-
const i =
|
|
1844
|
+
const i = To(this.buttonRadius);
|
|
1850
1845
|
o += `--pc-button-radius: ${i} !important;
|
|
1851
1846
|
`;
|
|
1852
1847
|
}
|
|
1853
1848
|
o += `}
|
|
1854
|
-
`, this.css && (o +=
|
|
1849
|
+
`, this.css && (o += Mo(zo(this.css))), t.textContent = o;
|
|
1855
1850
|
}
|
|
1856
1851
|
/**
|
|
1857
1852
|
* Update ARIA attributes for accessibility
|
|
1858
1853
|
*/
|
|
1859
1854
|
updateAriaAttributes() {
|
|
1860
|
-
this.ariaLabel &&
|
|
1855
|
+
this.ariaLabel && qt(this, "aria-label", this.ariaLabel), this.ariaDescribedby && qt(this, "aria-describedby", this.ariaDescribedby), qt(this, "aria-busy", this.dataController.isLoading ? "true" : "false");
|
|
1861
1856
|
}
|
|
1862
1857
|
/**
|
|
1863
1858
|
* Update host CSS classes based on state
|
|
1864
1859
|
*/
|
|
1865
1860
|
updateHostClasses() {
|
|
1866
|
-
this.classList.toggle("is-loading", this.dataController.isLoading);
|
|
1861
|
+
this.classList.toggle("is-loading", this.dataController.isLoading), this.dataController.hasError && (this.style.display = "none");
|
|
1867
1862
|
}
|
|
1868
1863
|
/**
|
|
1869
1864
|
* Get responsive breakpoint utilities
|
|
1870
1865
|
*/
|
|
1871
1866
|
getBreakpointClasses() {
|
|
1872
1867
|
return {
|
|
1873
|
-
"pc-mobile": window.matchMedia(`(max-width: ${
|
|
1868
|
+
"pc-mobile": window.matchMedia(`(max-width: ${yt.mobile})`).matches,
|
|
1874
1869
|
"pc-tablet": window.matchMedia(
|
|
1875
|
-
`(min-width: ${
|
|
1870
|
+
`(min-width: ${yt.mobile}) and (max-width: ${yt.tablet})`
|
|
1876
1871
|
).matches,
|
|
1877
|
-
"pc-desktop": window.matchMedia(`(min-width: ${
|
|
1872
|
+
"pc-desktop": window.matchMedia(`(min-width: ${yt.desktop})`).matches
|
|
1878
1873
|
};
|
|
1879
1874
|
}
|
|
1880
1875
|
/**
|
|
@@ -1882,7 +1877,7 @@ const bt = {
|
|
|
1882
1877
|
*/
|
|
1883
1878
|
announceSelectionChange(t, o, r) {
|
|
1884
1879
|
const s = `Poll for "${t}"`, i = r ? `${o.label} selected` : `${o.label} unselected`;
|
|
1885
|
-
|
|
1880
|
+
Jo(Qo(s, i));
|
|
1886
1881
|
}
|
|
1887
1882
|
/** Common render methods */
|
|
1888
1883
|
renderLabel() {
|
|
@@ -1913,7 +1908,7 @@ const bt = {
|
|
|
1913
1908
|
tabindex="0"
|
|
1914
1909
|
aria-label="Edit vote"
|
|
1915
1910
|
@keydown="${this.handleEditToggleKeyDown}"
|
|
1916
|
-
>${
|
|
1911
|
+
>${Ct}</span
|
|
1917
1912
|
>
|
|
1918
1913
|
` : u;
|
|
1919
1914
|
}
|
|
@@ -1932,7 +1927,7 @@ const bt = {
|
|
|
1932
1927
|
tabindex="0"
|
|
1933
1928
|
aria-label="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
|
|
1934
1929
|
@keydown="${() => this.displayController.toggleChartVisibility()}"
|
|
1935
|
-
>${this.displayController.isChartVisible ?
|
|
1930
|
+
>${this.displayController.isChartVisible ? Zt : Gt}</span
|
|
1936
1931
|
>
|
|
1937
1932
|
` : u;
|
|
1938
1933
|
}
|
|
@@ -1941,9 +1936,9 @@ const bt = {
|
|
|
1941
1936
|
return u;
|
|
1942
1937
|
const o = {
|
|
1943
1938
|
"pc-status": !0,
|
|
1944
|
-
[`pc-flex-content-${
|
|
1939
|
+
[`pc-flex-content-${O(this.statsPosition, this.statsAlign)}`]: !0
|
|
1945
1940
|
};
|
|
1946
|
-
return c`<div class="${
|
|
1941
|
+
return c`<div class="${y(o)}" data-testid="pc-status">
|
|
1947
1942
|
${this.renderStatsText()} ${this.renderChartToggle()} ${this.renderEditToggleIcon()}
|
|
1948
1943
|
</div>`;
|
|
1949
1944
|
}
|
|
@@ -1959,7 +1954,7 @@ const bt = {
|
|
|
1959
1954
|
renderThankYouMessage() {
|
|
1960
1955
|
if (!this.displayController.shouldDisplayThankYouMsg())
|
|
1961
1956
|
return u;
|
|
1962
|
-
const t =
|
|
1957
|
+
const t = Ko(this.thankYouMsg || "");
|
|
1963
1958
|
return c`
|
|
1964
1959
|
<div class="pc-thank-you-overlay" data-testid="poll-thank-you-overlay">
|
|
1965
1960
|
<div class="pc-thank-you" data-testid="thank-you">
|
|
@@ -1971,7 +1966,7 @@ const bt = {
|
|
|
1971
1966
|
@click="${() => this.displayController.toggleThankYouVisibility(!1)}"
|
|
1972
1967
|
role="button"
|
|
1973
1968
|
aria-label="Close"
|
|
1974
|
-
>${
|
|
1969
|
+
>${Pt}</span
|
|
1975
1970
|
>
|
|
1976
1971
|
</div>
|
|
1977
1972
|
</div>
|
|
@@ -1979,8 +1974,8 @@ const bt = {
|
|
|
1979
1974
|
`;
|
|
1980
1975
|
}
|
|
1981
1976
|
};
|
|
1982
|
-
|
|
1983
|
-
|
|
1977
|
+
Qt.styles = [
|
|
1978
|
+
B`
|
|
1984
1979
|
:host {
|
|
1985
1980
|
/* Default values for CSS variables - can be overridden by external :root or parent definitions */
|
|
1986
1981
|
--default-font-size-base: 1rem;
|
|
@@ -2060,113 +2055,113 @@ Jt.styles = [
|
|
|
2060
2055
|
}
|
|
2061
2056
|
`
|
|
2062
2057
|
];
|
|
2063
|
-
let m =
|
|
2058
|
+
let m = Qt;
|
|
2064
2059
|
v([
|
|
2065
|
-
|
|
2060
|
+
f({ type: String, attribute: "show-stats" })
|
|
2066
2061
|
], m.prototype, "showStats");
|
|
2067
2062
|
v([
|
|
2068
|
-
|
|
2063
|
+
f({ type: Boolean, attribute: "show-chart" })
|
|
2069
2064
|
], m.prototype, "showChart");
|
|
2070
2065
|
v([
|
|
2071
|
-
|
|
2066
|
+
f({ type: Boolean, attribute: "initialized" })
|
|
2072
2067
|
], m.prototype, "initialized");
|
|
2073
2068
|
v([
|
|
2074
|
-
|
|
2069
|
+
f({ type: String, attribute: "primary-color" })
|
|
2075
2070
|
], m.prototype, "primaryColor");
|
|
2076
2071
|
v([
|
|
2077
|
-
|
|
2072
|
+
f({ type: String, attribute: "mute-color" })
|
|
2078
2073
|
], m.prototype, "muteColor");
|
|
2079
2074
|
v([
|
|
2080
|
-
|
|
2075
|
+
f({ type: String, attribute: "text-color" })
|
|
2081
2076
|
], m.prototype, "textColor");
|
|
2082
2077
|
v([
|
|
2083
|
-
|
|
2078
|
+
f({ type: String, attribute: "background-color" })
|
|
2084
2079
|
], m.prototype, "backgroundColor");
|
|
2085
2080
|
v([
|
|
2086
|
-
|
|
2081
|
+
f({ type: String, attribute: "accent-color" })
|
|
2087
2082
|
], m.prototype, "accentColor");
|
|
2088
2083
|
v([
|
|
2089
|
-
|
|
2084
|
+
f({ type: String, attribute: "star-color" })
|
|
2090
2085
|
], m.prototype, "starColor");
|
|
2091
2086
|
v([
|
|
2092
|
-
|
|
2087
|
+
f({ type: String, attribute: "star-hover-color" })
|
|
2093
2088
|
], m.prototype, "starHoverColor");
|
|
2094
2089
|
v([
|
|
2095
|
-
|
|
2090
|
+
f({ type: String, attribute: "star-size" })
|
|
2096
2091
|
], m.prototype, "starSize");
|
|
2097
2092
|
v([
|
|
2098
|
-
|
|
2093
|
+
f({ type: String, attribute: "reaction-size" })
|
|
2099
2094
|
], m.prototype, "reactionSize");
|
|
2100
2095
|
v([
|
|
2101
|
-
|
|
2096
|
+
f({ type: String })
|
|
2102
2097
|
], m.prototype, "size");
|
|
2103
2098
|
v([
|
|
2104
|
-
|
|
2099
|
+
f({ type: String, attribute: "aria-label" })
|
|
2105
2100
|
], m.prototype, "ariaLabel");
|
|
2106
2101
|
v([
|
|
2107
|
-
|
|
2102
|
+
f({ type: String, attribute: "aria-describedby" })
|
|
2108
2103
|
], m.prototype, "ariaDescribedby");
|
|
2109
2104
|
v([
|
|
2110
|
-
|
|
2105
|
+
f({ type: Number, attribute: "min-contrast" })
|
|
2111
2106
|
], m.prototype, "minContrast");
|
|
2112
2107
|
v([
|
|
2113
|
-
|
|
2108
|
+
f({ type: String })
|
|
2114
2109
|
], m.prototype, "css");
|
|
2115
2110
|
v([
|
|
2116
|
-
|
|
2111
|
+
f({ type: Array })
|
|
2117
2112
|
], m.prototype, "options");
|
|
2118
2113
|
v([
|
|
2119
|
-
|
|
2114
|
+
f({ type: String, attribute: "widget-id" })
|
|
2120
2115
|
], m.prototype, "widgetId");
|
|
2121
2116
|
v([
|
|
2122
|
-
|
|
2117
|
+
f({ type: String, attribute: "name" })
|
|
2123
2118
|
], m.prototype, "name");
|
|
2124
2119
|
v([
|
|
2125
|
-
|
|
2120
|
+
f({ type: String })
|
|
2126
2121
|
], m.prototype, "metadata");
|
|
2127
2122
|
v([
|
|
2128
|
-
|
|
2123
|
+
f({ type: String, attribute: "data-func" })
|
|
2129
2124
|
], m.prototype, "dataFunc");
|
|
2130
2125
|
v([
|
|
2131
|
-
|
|
2126
|
+
f({ type: String, attribute: "data-endpoint" })
|
|
2132
2127
|
], m.prototype, "dataEndpoint");
|
|
2133
2128
|
v([
|
|
2134
|
-
|
|
2129
|
+
f({ type: String })
|
|
2135
2130
|
], m.prototype, "question");
|
|
2136
2131
|
v([
|
|
2137
|
-
|
|
2132
|
+
f({ type: String, attribute: "question-position" })
|
|
2138
2133
|
], m.prototype, "questionPosition");
|
|
2139
2134
|
v([
|
|
2140
|
-
|
|
2135
|
+
f({ type: String, attribute: "question-align" })
|
|
2141
2136
|
], m.prototype, "questionAlign");
|
|
2142
2137
|
v([
|
|
2143
|
-
|
|
2138
|
+
f({ type: String, attribute: "stats-text" })
|
|
2144
2139
|
], m.prototype, "statsText");
|
|
2145
2140
|
v([
|
|
2146
|
-
|
|
2141
|
+
f({ type: String, attribute: "stats-position" })
|
|
2147
2142
|
], m.prototype, "statsPosition");
|
|
2148
2143
|
v([
|
|
2149
|
-
|
|
2144
|
+
f({ type: String, attribute: "stats-align" })
|
|
2150
2145
|
], m.prototype, "statsAlign");
|
|
2151
2146
|
v([
|
|
2152
|
-
|
|
2147
|
+
f({ type: String, attribute: "button-text" })
|
|
2153
2148
|
], m.prototype, "buttonText");
|
|
2154
2149
|
v([
|
|
2155
|
-
|
|
2150
|
+
f({ type: String, attribute: "button-radius" })
|
|
2156
2151
|
], m.prototype, "buttonRadius");
|
|
2157
2152
|
v([
|
|
2158
|
-
|
|
2153
|
+
f({ type: String, attribute: "thank-you-msg" })
|
|
2159
2154
|
], m.prototype, "thankYouMsg");
|
|
2160
2155
|
v([
|
|
2161
|
-
|
|
2156
|
+
f({ type: Boolean, attribute: "multiple" })
|
|
2162
2157
|
], m.prototype, "multiple");
|
|
2163
2158
|
v([
|
|
2164
|
-
|
|
2159
|
+
f({ type: Boolean, reflect: !0 })
|
|
2165
2160
|
], m.prototype, "inline");
|
|
2166
2161
|
v([
|
|
2167
|
-
|
|
2162
|
+
f({ type: Boolean, reflect: !0 })
|
|
2168
2163
|
], m.prototype, "readonly");
|
|
2169
|
-
const
|
|
2164
|
+
const er = B`
|
|
2170
2165
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
2171
2166
|
|
|
2172
2167
|
.pc-body {
|
|
@@ -2617,7 +2612,7 @@ const sr = R`
|
|
|
2617
2612
|
animation: none;
|
|
2618
2613
|
}
|
|
2619
2614
|
}
|
|
2620
|
-
`,
|
|
2615
|
+
`, _t = B`
|
|
2621
2616
|
/* Default values for CSS variables - can be overridden by external :root or parent definitions */
|
|
2622
2617
|
:host {
|
|
2623
2618
|
--default-primary-color: #2196f3;
|
|
@@ -3336,7 +3331,7 @@ const sr = R`
|
|
|
3336
3331
|
opacity: 1;
|
|
3337
3332
|
}
|
|
3338
3333
|
}
|
|
3339
|
-
`,
|
|
3334
|
+
`, or = B`
|
|
3340
3335
|
:host {
|
|
3341
3336
|
--popover-bg: light-dark(#ffffff, #1a1a1a);
|
|
3342
3337
|
--popover-border: light-dark(#e0e0e0, #333333);
|
|
@@ -3458,21 +3453,21 @@ const sr = R`
|
|
|
3458
3453
|
max-width: 100%;
|
|
3459
3454
|
}
|
|
3460
3455
|
`;
|
|
3461
|
-
var
|
|
3462
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3456
|
+
var rr = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, V = (e, t, o, r) => {
|
|
3457
|
+
for (var s = r > 1 ? void 0 : r ? sr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3463
3458
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3464
|
-
return r && s &&
|
|
3459
|
+
return r && s && rr(t, o, s), s;
|
|
3465
3460
|
};
|
|
3466
|
-
let
|
|
3461
|
+
let _ = class extends D {
|
|
3467
3462
|
constructor() {
|
|
3468
3463
|
super(...arguments), this.open = !1, this.position = "auto", this.isClosing = !1, this.computedPosition = "bottom", this.popoverStyles = {}, this.arrowStyles = {}, this.updatePosition = () => {
|
|
3469
|
-
var
|
|
3464
|
+
var h;
|
|
3470
3465
|
if (!this.anchor || !this.open) return;
|
|
3471
|
-
const e = this.anchor.getBoundingClientRect(), t = window.innerWidth, o = window.innerHeight, r = 12, s = (
|
|
3466
|
+
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;
|
|
3472
3467
|
let l = this.position;
|
|
3473
3468
|
if (l === "auto") {
|
|
3474
|
-
const b = o - e.bottom,
|
|
3475
|
-
l = b >= a + r || b >=
|
|
3469
|
+
const b = o - e.bottom, w = e.top;
|
|
3470
|
+
l = b >= a + r || b >= w ? "bottom" : "top";
|
|
3476
3471
|
}
|
|
3477
3472
|
this.computedPosition = l;
|
|
3478
3473
|
let n, d;
|
|
@@ -3536,7 +3531,7 @@ let T = class extends N {
|
|
|
3536
3531
|
return c`
|
|
3537
3532
|
<div class="pc-popover-scrim" @click=${this.handleScrimClick}></div>
|
|
3538
3533
|
<div
|
|
3539
|
-
class=${
|
|
3534
|
+
class=${y(e)}
|
|
3540
3535
|
data-position=${this.computedPosition}
|
|
3541
3536
|
style=${Object.entries(this.popoverStyles).map(([t, o]) => `${t}: ${o}`).join("; ")}
|
|
3542
3537
|
role="dialog"
|
|
@@ -3552,35 +3547,35 @@ let T = class extends N {
|
|
|
3552
3547
|
`;
|
|
3553
3548
|
}
|
|
3554
3549
|
};
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
],
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
],
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
],
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
],
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
],
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
],
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
],
|
|
3577
|
-
|
|
3550
|
+
_.styles = [or];
|
|
3551
|
+
V([
|
|
3552
|
+
f({ type: Boolean, reflect: !0 })
|
|
3553
|
+
], _.prototype, "open", 2);
|
|
3554
|
+
V([
|
|
3555
|
+
f({ type: String })
|
|
3556
|
+
], _.prototype, "position", 2);
|
|
3557
|
+
V([
|
|
3558
|
+
f({ attribute: !1 })
|
|
3559
|
+
], _.prototype, "anchor", 2);
|
|
3560
|
+
V([
|
|
3561
|
+
k()
|
|
3562
|
+
], _.prototype, "isClosing", 2);
|
|
3563
|
+
V([
|
|
3564
|
+
k()
|
|
3565
|
+
], _.prototype, "computedPosition", 2);
|
|
3566
|
+
V([
|
|
3567
|
+
k()
|
|
3568
|
+
], _.prototype, "popoverStyles", 2);
|
|
3569
|
+
V([
|
|
3570
|
+
k()
|
|
3571
|
+
], _.prototype, "arrowStyles", 2);
|
|
3572
|
+
V([
|
|
3578
3573
|
ft(".pc-popover")
|
|
3579
|
-
],
|
|
3580
|
-
|
|
3574
|
+
], _.prototype, "popoverElement", 2);
|
|
3575
|
+
_ = V([
|
|
3581
3576
|
F("pc-popover")
|
|
3582
|
-
],
|
|
3583
|
-
const
|
|
3577
|
+
], _);
|
|
3578
|
+
const ir = B`
|
|
3584
3579
|
:host {
|
|
3585
3580
|
--sheet-bg: light-dark(#ffffff, #1a1a1a);
|
|
3586
3581
|
--sheet-border: light-dark(#e0e0e0, #333333);
|
|
@@ -3693,12 +3688,12 @@ const lr = R`
|
|
|
3693
3688
|
max-width: 100%;
|
|
3694
3689
|
}
|
|
3695
3690
|
`;
|
|
3696
|
-
var
|
|
3697
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3691
|
+
var ar = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, Q = (e, t, o, r) => {
|
|
3692
|
+
for (var s = r > 1 ? void 0 : r ? nr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3698
3693
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3699
|
-
return r && s &&
|
|
3694
|
+
return r && s && ar(t, o, s), s;
|
|
3700
3695
|
};
|
|
3701
|
-
let
|
|
3696
|
+
let R = class extends D {
|
|
3702
3697
|
constructor() {
|
|
3703
3698
|
super(...arguments), this.open = !1, this.dragToClose = !0, this.isClosing = !1, this.isDragging = !1, this.dragOffset = 0, this.dragStartY = 0, this.sheetHeight = 0, this.handleKeyDown = (e) => {
|
|
3704
3699
|
if (e.key === "Escape" && this.open && (e.preventDefault(), e.stopPropagation(), this.close()), e.key === "Tab" && this.open && this.sheetElement) {
|
|
@@ -3776,8 +3771,8 @@ let D = class extends N {
|
|
|
3776
3771
|
dragging: this.isDragging
|
|
3777
3772
|
};
|
|
3778
3773
|
return c`
|
|
3779
|
-
<div class=${
|
|
3780
|
-
<div class=${
|
|
3774
|
+
<div class=${y(e)} @click=${this.handleScrimClick}></div>
|
|
3775
|
+
<div class=${y(t)} role="dialog" aria-modal="true" tabindex="-1">
|
|
3781
3776
|
<div
|
|
3782
3777
|
class="pc-sheet-handle"
|
|
3783
3778
|
@touchstart=${this.handleDragStart}
|
|
@@ -3792,35 +3787,35 @@ let D = class extends N {
|
|
|
3792
3787
|
`;
|
|
3793
3788
|
}
|
|
3794
3789
|
};
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
],
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
],
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
],
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
],
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
],
|
|
3811
|
-
|
|
3790
|
+
R.styles = [ir];
|
|
3791
|
+
Q([
|
|
3792
|
+
f({ type: Boolean, reflect: !0 })
|
|
3793
|
+
], R.prototype, "open", 2);
|
|
3794
|
+
Q([
|
|
3795
|
+
f({ type: Boolean, attribute: "drag-to-close" })
|
|
3796
|
+
], R.prototype, "dragToClose", 2);
|
|
3797
|
+
Q([
|
|
3798
|
+
k()
|
|
3799
|
+
], R.prototype, "isClosing", 2);
|
|
3800
|
+
Q([
|
|
3801
|
+
k()
|
|
3802
|
+
], R.prototype, "isDragging", 2);
|
|
3803
|
+
Q([
|
|
3804
|
+
k()
|
|
3805
|
+
], R.prototype, "dragOffset", 2);
|
|
3806
|
+
Q([
|
|
3812
3807
|
ft(".pc-bottom-sheet")
|
|
3813
|
-
],
|
|
3814
|
-
|
|
3808
|
+
], R.prototype, "sheetElement", 2);
|
|
3809
|
+
R = Q([
|
|
3815
3810
|
F("pc-bottom-sheet")
|
|
3816
|
-
],
|
|
3817
|
-
var
|
|
3818
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3811
|
+
], R);
|
|
3812
|
+
var lr = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, gt = (e, t, o, r) => {
|
|
3813
|
+
for (var s = r > 1 ? void 0 : r ? cr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3819
3814
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3820
|
-
return r && s &&
|
|
3815
|
+
return r && s && lr(t, o, s), s;
|
|
3821
3816
|
};
|
|
3822
|
-
const
|
|
3823
|
-
let Z = class extends
|
|
3817
|
+
const dr = 768;
|
|
3818
|
+
let Z = class extends D {
|
|
3824
3819
|
constructor() {
|
|
3825
3820
|
super(...arguments), this.open = !1, this.position = "auto", this.isMobile = !1, this.handleMediaChange = (e) => {
|
|
3826
3821
|
this.isMobile = e.matches;
|
|
@@ -3836,7 +3831,7 @@ let Z = class extends N {
|
|
|
3836
3831
|
super.disconnectedCallback(), (e = this.mediaQuery) == null || e.removeEventListener("change", this.handleMediaChange);
|
|
3837
3832
|
}
|
|
3838
3833
|
setupMediaQuery() {
|
|
3839
|
-
this.mediaQuery = window.matchMedia(`(max-width: ${
|
|
3834
|
+
this.mediaQuery = window.matchMedia(`(max-width: ${dr - 1}px)`), this.isMobile = this.mediaQuery.matches, this.mediaQuery.addEventListener("change", this.handleMediaChange);
|
|
3840
3835
|
}
|
|
3841
3836
|
render() {
|
|
3842
3837
|
return this.isMobile ? c`
|
|
@@ -3855,32 +3850,32 @@ let Z = class extends N {
|
|
|
3855
3850
|
`;
|
|
3856
3851
|
}
|
|
3857
3852
|
};
|
|
3858
|
-
Z.styles =
|
|
3853
|
+
Z.styles = B`
|
|
3859
3854
|
:host {
|
|
3860
3855
|
display: contents;
|
|
3861
3856
|
}
|
|
3862
3857
|
`;
|
|
3863
3858
|
gt([
|
|
3864
|
-
|
|
3859
|
+
f({ type: Boolean, reflect: !0 })
|
|
3865
3860
|
], Z.prototype, "open", 2);
|
|
3866
3861
|
gt([
|
|
3867
|
-
|
|
3862
|
+
f({ type: String })
|
|
3868
3863
|
], Z.prototype, "position", 2);
|
|
3869
3864
|
gt([
|
|
3870
|
-
|
|
3865
|
+
f({ attribute: !1 })
|
|
3871
3866
|
], Z.prototype, "anchor", 2);
|
|
3872
3867
|
gt([
|
|
3873
|
-
|
|
3868
|
+
k()
|
|
3874
3869
|
], Z.prototype, "isMobile", 2);
|
|
3875
3870
|
Z = gt([
|
|
3876
3871
|
F("pc-responsive-modal")
|
|
3877
3872
|
], Z);
|
|
3878
|
-
var
|
|
3879
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3873
|
+
var pr = Object.defineProperty, ur = Object.getOwnPropertyDescriptor, Y = (e, t, o, r) => {
|
|
3874
|
+
for (var s = r > 1 ? void 0 : r ? ur(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3880
3875
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3881
|
-
return r && s &&
|
|
3876
|
+
return r && s && pr(t, o, s), s;
|
|
3882
3877
|
};
|
|
3883
|
-
let
|
|
3878
|
+
let I = class extends m {
|
|
3884
3879
|
constructor() {
|
|
3885
3880
|
super(), this.min = 0, this.max = 10, this.type = $.nps, this.minLabel = "Not at all", this.maxLabel = "Extremely", this.minMaxPosition = "top", this.hoverValue = -1, this.popoverOpen = !1, this.handleNumberLeave = () => {
|
|
3886
3881
|
this.hoverValue = -1;
|
|
@@ -3892,20 +3887,20 @@ let O = class extends m {
|
|
|
3892
3887
|
* Render NPS buttons for edit mode
|
|
3893
3888
|
*/
|
|
3894
3889
|
renderNpsButtons() {
|
|
3895
|
-
const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o =
|
|
3896
|
-
role:
|
|
3890
|
+
const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o = ot({
|
|
3891
|
+
role: L.GROUP,
|
|
3897
3892
|
ariaLabel: this.question || "NPS Rating",
|
|
3898
3893
|
ariaDescribedby: `${t}-description`
|
|
3899
3894
|
}), r = e.map((s) => {
|
|
3900
3895
|
const i = this.dataController.isValueSelected(String(s)), a = {
|
|
3901
3896
|
"nps-button": !0,
|
|
3902
3897
|
selected: i
|
|
3903
|
-
}, l =
|
|
3898
|
+
}, l = _o(`Rate ${s}`, i, !1);
|
|
3904
3899
|
return c`
|
|
3905
3900
|
<button
|
|
3906
3901
|
data-testid="nps-button-${s}"
|
|
3907
3902
|
?disabled=${!this.displayController.allowEdit()}
|
|
3908
|
-
class=${
|
|
3903
|
+
class=${y(a)}
|
|
3909
3904
|
@click="${() => this.handleNumberClick(s)}"
|
|
3910
3905
|
@mouseenter="${() => this.handleNumberHover(s)}"
|
|
3911
3906
|
@focus="${() => this.handleNumberHover(s)}"
|
|
@@ -3944,10 +3939,10 @@ let O = class extends m {
|
|
|
3944
3939
|
* NPS score displayed prominently in the middle
|
|
3945
3940
|
*/
|
|
3946
3941
|
renderChart() {
|
|
3947
|
-
const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = (
|
|
3948
|
-
x: o + s * Math.cos(
|
|
3949
|
-
y: r - s * Math.sin(
|
|
3950
|
-
}), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = (
|
|
3942
|
+
const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = (P) => ({
|
|
3943
|
+
x: o + s * Math.cos(P),
|
|
3944
|
+
y: r - s * Math.sin(P)
|
|
3945
|
+
}), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = (P, z, It = 0) => `M ${P.x} ${P.y} A ${s} ${s} 0 ${It} 1 ${z.x} ${z.y}`, h = p(a, l), b = p(l, n), w = p(n, d), C = ((P) => Math.PI - (P + 100) / 200 * Math.PI)(t), x = i(C);
|
|
3951
3946
|
return c`
|
|
3952
3947
|
<div class="nps-semicircle-gauge" data-testid="nps-semicircle-gauge">
|
|
3953
3948
|
<svg viewBox="0 0 200 115">
|
|
@@ -3958,12 +3953,12 @@ let O = class extends m {
|
|
|
3958
3953
|
/>
|
|
3959
3954
|
|
|
3960
3955
|
<!-- Colored segments -->
|
|
3961
|
-
<path class="gauge-arc gauge-arc-detractor" d="${
|
|
3956
|
+
<path class="gauge-arc gauge-arc-detractor" d="${h}" />
|
|
3962
3957
|
<path class="gauge-arc gauge-arc-passive" d="${b}" />
|
|
3963
|
-
<path class="gauge-arc gauge-arc-promoter" d="${
|
|
3958
|
+
<path class="gauge-arc gauge-arc-promoter" d="${w}" />
|
|
3964
3959
|
|
|
3965
3960
|
<!-- Needle indicator -->
|
|
3966
|
-
<circle class="gauge-needle" cx="${
|
|
3961
|
+
<circle class="gauge-needle" cx="${x.x}" cy="${x.y}" r="5" />
|
|
3967
3962
|
|
|
3968
3963
|
<!-- Score display in center -->
|
|
3969
3964
|
<text class="gauge-score" x="${o}" y="${r - 15}">${t}</text>
|
|
@@ -4023,7 +4018,7 @@ let O = class extends m {
|
|
|
4023
4018
|
* Uses SVG with 3 colored segments for detractors/passives/promoters
|
|
4024
4019
|
*/
|
|
4025
4020
|
renderInlineGauge() {
|
|
4026
|
-
const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s =
|
|
4021
|
+
const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s = Ro(t), i = s.detractors + s.passives + s.promoters;
|
|
4027
4022
|
if (i === 0)
|
|
4028
4023
|
return c`
|
|
4029
4024
|
<div class="inline-nps-gauge">
|
|
@@ -4032,9 +4027,9 @@ let O = class extends m {
|
|
|
4032
4027
|
</svg>
|
|
4033
4028
|
</div>
|
|
4034
4029
|
`;
|
|
4035
|
-
const a = s.detractors / i * 100, l = s.passives / i * 100, n = s.promoters / i * 100, d = a / 100 * r, p = l / 100 * r,
|
|
4036
|
-
let
|
|
4037
|
-
return
|
|
4030
|
+
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, w = -d, E = -(d + p), C = this.getUserScore();
|
|
4031
|
+
let x = "gauge-bg";
|
|
4032
|
+
return C !== null && (C <= 6 ? x = "gauge-detractor" : C <= 8 ? x = "gauge-passive" : x = "gauge-promoter"), c`
|
|
4038
4033
|
<div class="inline-nps-gauge">
|
|
4039
4034
|
<svg viewBox="0 0 20 20">
|
|
4040
4035
|
<!-- Background circle -->
|
|
@@ -4055,7 +4050,7 @@ let O = class extends m {
|
|
|
4055
4050
|
cy="10"
|
|
4056
4051
|
r="${o}"
|
|
4057
4052
|
stroke-dasharray="${p} ${r}"
|
|
4058
|
-
stroke-dashoffset="${
|
|
4053
|
+
stroke-dashoffset="${w}"
|
|
4059
4054
|
/>
|
|
4060
4055
|
<!-- Promoter segment (green) -->
|
|
4061
4056
|
<circle
|
|
@@ -4063,11 +4058,11 @@ let O = class extends m {
|
|
|
4063
4058
|
cx="10"
|
|
4064
4059
|
cy="10"
|
|
4065
4060
|
r="${o}"
|
|
4066
|
-
stroke-dasharray="${
|
|
4067
|
-
stroke-dashoffset="${
|
|
4061
|
+
stroke-dasharray="${h} ${r}"
|
|
4062
|
+
stroke-dashoffset="${E}"
|
|
4068
4063
|
/>
|
|
4069
4064
|
<!-- Center dot showing user's score category -->
|
|
4070
|
-
<circle class="gauge-dot ${
|
|
4065
|
+
<circle class="gauge-dot ${x}" cx="10" cy="10" r="2" />
|
|
4071
4066
|
</svg>
|
|
4072
4067
|
</div>
|
|
4073
4068
|
`;
|
|
@@ -4078,7 +4073,7 @@ let O = class extends m {
|
|
|
4078
4073
|
* Shows add icon when no selection, edit icon when user has submitted
|
|
4079
4074
|
*/
|
|
4080
4075
|
renderInlineTrigger() {
|
|
4081
|
-
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ?
|
|
4076
|
+
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? Ct : Oe;
|
|
4082
4077
|
return c`
|
|
4083
4078
|
<button
|
|
4084
4079
|
class="pc-inline-trigger"
|
|
@@ -4110,7 +4105,7 @@ let O = class extends m {
|
|
|
4110
4105
|
};
|
|
4111
4106
|
return c`
|
|
4112
4107
|
<button
|
|
4113
|
-
class=${
|
|
4108
|
+
class=${y(i)}
|
|
4114
4109
|
@click=${() => this.handlePopoverNumberClick(r)}
|
|
4115
4110
|
@mouseenter=${() => this.handleNumberHover(r)}
|
|
4116
4111
|
@mouseleave=${this.handleNumberLeave}
|
|
@@ -4144,7 +4139,7 @@ let O = class extends m {
|
|
|
4144
4139
|
@keydown="${(e) => {
|
|
4145
4140
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
|
|
4146
4141
|
}}"
|
|
4147
|
-
>${this.displayController.isChartVisible ?
|
|
4142
|
+
>${this.displayController.isChartVisible ? Zt : Gt}</span
|
|
4148
4143
|
>
|
|
4149
4144
|
`;
|
|
4150
4145
|
}
|
|
@@ -4163,7 +4158,7 @@ let O = class extends m {
|
|
|
4163
4158
|
aria-label="Close"
|
|
4164
4159
|
data-testid="popover-close-button"
|
|
4165
4160
|
>
|
|
4166
|
-
${
|
|
4161
|
+
${Pt}
|
|
4167
4162
|
</button>
|
|
4168
4163
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
4169
4164
|
${this.renderPopoverNpsButtons()}
|
|
@@ -4213,16 +4208,16 @@ let O = class extends m {
|
|
|
4213
4208
|
renderStandardMode() {
|
|
4214
4209
|
const e = {
|
|
4215
4210
|
[`pc-flex-pos-${this.questionPosition}`]: !0,
|
|
4216
|
-
[`pc-flex-align-${
|
|
4211
|
+
[`pc-flex-align-${O(this.questionPosition, this.questionAlign)}`]: !0
|
|
4217
4212
|
}, t = {
|
|
4218
4213
|
nps: !0,
|
|
4219
4214
|
[`pc-flex-pos-${this.statsPosition}`]: !0,
|
|
4220
|
-
[`pc-flex-align-${
|
|
4215
|
+
[`pc-flex-align-${O(this.statsPosition, this.statsAlign)}`]: !0
|
|
4221
4216
|
};
|
|
4222
4217
|
return c`
|
|
4223
|
-
<div class="pc-container ${
|
|
4218
|
+
<div class="pc-container ${y(e)}" data-testid="nps-container">
|
|
4224
4219
|
${this.renderLabelAtStart()}
|
|
4225
|
-
<div class="pc-body ${
|
|
4220
|
+
<div class="pc-body ${y(t)}" data-testid="nps-body">
|
|
4226
4221
|
${this.renderStatusAtStart()} ${this.renderContent()} ${this.renderStatusAtEnd()}
|
|
4227
4222
|
</div>
|
|
4228
4223
|
${this.renderLabelAtEnd()}
|
|
@@ -4236,32 +4231,32 @@ let O = class extends m {
|
|
|
4236
4231
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
4237
4232
|
}
|
|
4238
4233
|
};
|
|
4239
|
-
|
|
4234
|
+
I.styles = [...m.styles, _t, er];
|
|
4240
4235
|
Y([
|
|
4241
|
-
|
|
4242
|
-
],
|
|
4236
|
+
f({ type: String, attribute: "min-label" })
|
|
4237
|
+
], I.prototype, "minLabel", 2);
|
|
4243
4238
|
Y([
|
|
4244
|
-
|
|
4245
|
-
],
|
|
4239
|
+
f({ type: String, attribute: "max-label" })
|
|
4240
|
+
], I.prototype, "maxLabel", 2);
|
|
4246
4241
|
Y([
|
|
4247
|
-
|
|
4248
|
-
],
|
|
4242
|
+
f({ type: String, attribute: "thank-you-msg" })
|
|
4243
|
+
], I.prototype, "thankYouMsg", 2);
|
|
4249
4244
|
Y([
|
|
4250
|
-
|
|
4251
|
-
],
|
|
4245
|
+
f({ type: String, attribute: "min-max-position" })
|
|
4246
|
+
], I.prototype, "minMaxPosition", 2);
|
|
4252
4247
|
Y([
|
|
4253
|
-
|
|
4254
|
-
],
|
|
4248
|
+
k()
|
|
4249
|
+
], I.prototype, "hoverValue", 2);
|
|
4255
4250
|
Y([
|
|
4256
|
-
|
|
4257
|
-
],
|
|
4251
|
+
k()
|
|
4252
|
+
], I.prototype, "popoverOpen", 2);
|
|
4258
4253
|
Y([
|
|
4259
4254
|
ft(".pc-inline-trigger")
|
|
4260
|
-
],
|
|
4261
|
-
|
|
4255
|
+
], I.prototype, "triggerElement", 2);
|
|
4256
|
+
I = Y([
|
|
4262
4257
|
F("pc-nps")
|
|
4263
|
-
],
|
|
4264
|
-
const
|
|
4258
|
+
], I);
|
|
4259
|
+
const hr = B`
|
|
4265
4260
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
4266
4261
|
|
|
4267
4262
|
.pc-container {
|
|
@@ -4646,10 +4641,10 @@ const mr = R`
|
|
|
4646
4641
|
opacity: 0.8;
|
|
4647
4642
|
}
|
|
4648
4643
|
`;
|
|
4649
|
-
var
|
|
4650
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
4644
|
+
var fr = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, mt = (e, t, o, r) => {
|
|
4645
|
+
for (var s = r > 1 ? void 0 : r ? gr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
4651
4646
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
4652
|
-
return r && s &&
|
|
4647
|
+
return r && s && fr(t, o, s), s;
|
|
4653
4648
|
};
|
|
4654
4649
|
let X = class extends m {
|
|
4655
4650
|
constructor() {
|
|
@@ -4658,9 +4653,9 @@ let X = class extends m {
|
|
|
4658
4653
|
renderStatus() {
|
|
4659
4654
|
const t = {
|
|
4660
4655
|
"pc-status": !0,
|
|
4661
|
-
[`pc-flex-content-${
|
|
4656
|
+
[`pc-flex-content-${O("bottom", this.statsAlign)}`]: !0
|
|
4662
4657
|
};
|
|
4663
|
-
return c`<div class="${
|
|
4658
|
+
return c`<div class="${y(t)}" data-testid="pc-status">
|
|
4664
4659
|
<span>${this.renderStatsText()} ${this.renderEditToggleIcon("stats-edit-button")}</span>
|
|
4665
4660
|
</div>`;
|
|
4666
4661
|
}
|
|
@@ -4675,7 +4670,7 @@ let X = class extends m {
|
|
|
4675
4670
|
}, t = this.displayController.shouldDisableSubmitButton();
|
|
4676
4671
|
return c`
|
|
4677
4672
|
<button
|
|
4678
|
-
class="${
|
|
4673
|
+
class="${y(e)}"
|
|
4679
4674
|
data-testid="pc-submit-button"
|
|
4680
4675
|
@click="${this.handleSubmit}"
|
|
4681
4676
|
?disabled="${t}"
|
|
@@ -4709,16 +4704,16 @@ let X = class extends m {
|
|
|
4709
4704
|
*/
|
|
4710
4705
|
renderOptionIcon(e) {
|
|
4711
4706
|
if (!(e != null && e.icon)) return "";
|
|
4712
|
-
const t =
|
|
4707
|
+
const t = Jt.DECORATIVE, o = (e == null ? void 0 : e.label) || "", r = e ? this.dataController.isValueSelected(e.value) : !1, s = je(e == null ? void 0 : e.icon, {
|
|
4713
4708
|
type: t,
|
|
4714
4709
|
alt: o,
|
|
4715
4710
|
isSelected: r
|
|
4716
4711
|
});
|
|
4717
|
-
return
|
|
4712
|
+
return Re(e == null ? void 0 : e.icon) ? c`<span
|
|
4718
4713
|
class="poll-option-icon"
|
|
4719
4714
|
aria-hidden="${s.ariaHidden ? "true" : "false"}"
|
|
4720
4715
|
>${e == null ? void 0 : e.icon}</span
|
|
4721
|
-
>` :
|
|
4716
|
+
>` : Tt(e == null ? void 0 : e.icon) ? c`<img
|
|
4722
4717
|
src="${e == null ? void 0 : e.icon}"
|
|
4723
4718
|
alt="${s.alt}"
|
|
4724
4719
|
class="poll-option-icon-img"
|
|
@@ -4734,7 +4729,7 @@ let X = class extends m {
|
|
|
4734
4729
|
* Renders the selection indicator (checkbox or radio button) with proper ARIA roles
|
|
4735
4730
|
*/
|
|
4736
4731
|
renderSelectionIndicator() {
|
|
4737
|
-
const e = this.multiple ?
|
|
4732
|
+
const e = this.multiple ? L.CHECKBOX : L.RADIO;
|
|
4738
4733
|
return this.multiple ? c`<span class="poll-checkbox" role="${e}"></span>` : c`<span class="poll-radio" role="${e}"></span>`;
|
|
4739
4734
|
}
|
|
4740
4735
|
/**
|
|
@@ -4746,7 +4741,7 @@ let X = class extends m {
|
|
|
4746
4741
|
selected: o,
|
|
4747
4742
|
"poll-option--compact": this.compact,
|
|
4748
4743
|
"poll-option--disabled": r
|
|
4749
|
-
}, i = t + 1, a = `poll-${this.type}-${i}`, l =
|
|
4744
|
+
}, i = t + 1, a = `poll-${this.type}-${i}`, l = Oo(
|
|
4750
4745
|
e.label,
|
|
4751
4746
|
o,
|
|
4752
4747
|
r,
|
|
@@ -4756,7 +4751,7 @@ let X = class extends m {
|
|
|
4756
4751
|
return c`
|
|
4757
4752
|
<button
|
|
4758
4753
|
data-testid="poll-option-i${t}"
|
|
4759
|
-
class="${
|
|
4754
|
+
class="${y(s)}"
|
|
4760
4755
|
@click="${(n) => {
|
|
4761
4756
|
n.stopPropagation(), this.handleClick(e);
|
|
4762
4757
|
}}"
|
|
@@ -4780,13 +4775,13 @@ let X = class extends m {
|
|
|
4780
4775
|
*/
|
|
4781
4776
|
renderPollOptions() {
|
|
4782
4777
|
var s;
|
|
4783
|
-
const e = this.multiple ?
|
|
4778
|
+
const e = this.multiple ? L.GROUP : L.RADIOGROUP, t = this.question || this.name || "Options", o = ot({
|
|
4784
4779
|
role: e,
|
|
4785
4780
|
ariaLabel: t
|
|
4786
4781
|
});
|
|
4787
4782
|
return c`
|
|
4788
4783
|
<div
|
|
4789
|
-
class="${
|
|
4784
|
+
class="${y({
|
|
4790
4785
|
"poll-container": !0
|
|
4791
4786
|
})}"
|
|
4792
4787
|
data-testid="poll-option-container"
|
|
@@ -4802,22 +4797,22 @@ let X = class extends m {
|
|
|
4802
4797
|
*/
|
|
4803
4798
|
renderBarChart() {
|
|
4804
4799
|
var n, d;
|
|
4805
|
-
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,
|
|
4806
|
-
const b = e[p.value] || 0,
|
|
4800
|
+
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) => {
|
|
4801
|
+
const b = e[p.value] || 0, w = o > 0 ? Math.round(b / o * 100) : 0, E = (t[p.value] || 0) > 0;
|
|
4807
4802
|
return {
|
|
4808
4803
|
option: p,
|
|
4809
|
-
index:
|
|
4804
|
+
index: h,
|
|
4810
4805
|
voteCount: b,
|
|
4811
|
-
percentage:
|
|
4812
|
-
isSelected:
|
|
4806
|
+
percentage: w,
|
|
4807
|
+
isSelected: E
|
|
4813
4808
|
};
|
|
4814
|
-
}), s = this.multiple ?
|
|
4809
|
+
}), s = this.multiple ? L.GROUP : L.RADIOGROUP, i = this.question || this.name || "Options", a = ot({
|
|
4815
4810
|
role: s,
|
|
4816
4811
|
ariaLabel: i
|
|
4817
4812
|
});
|
|
4818
4813
|
return c`
|
|
4819
4814
|
<div
|
|
4820
|
-
class="${
|
|
4815
|
+
class="${y({
|
|
4821
4816
|
"poll-container": !0
|
|
4822
4817
|
})}"
|
|
4823
4818
|
data-testid="poll-chart-container"
|
|
@@ -4825,7 +4820,7 @@ let X = class extends m {
|
|
|
4825
4820
|
...=${a}
|
|
4826
4821
|
>
|
|
4827
4822
|
${r.map((p) => {
|
|
4828
|
-
const
|
|
4823
|
+
const h = {
|
|
4829
4824
|
"poll-option": !0,
|
|
4830
4825
|
"poll-option--compact": this.compact,
|
|
4831
4826
|
"poll-option--chart-view": !0,
|
|
@@ -4833,7 +4828,7 @@ let X = class extends m {
|
|
|
4833
4828
|
};
|
|
4834
4829
|
return c`
|
|
4835
4830
|
<div
|
|
4836
|
-
class="${
|
|
4831
|
+
class="${y(h)}"
|
|
4837
4832
|
data-testid="poll-chart-item-${p.index}"
|
|
4838
4833
|
role="listitem"
|
|
4839
4834
|
aria-label="${p.option.label}: ${p.percentage}% (${p.voteCount} votes)"
|
|
@@ -4904,7 +4899,7 @@ let X = class extends m {
|
|
|
4904
4899
|
* Shows add icon when no selection, edit icon when user has submitted
|
|
4905
4900
|
*/
|
|
4906
4901
|
renderInlineTrigger() {
|
|
4907
|
-
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ?
|
|
4902
|
+
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? Ct : Oe;
|
|
4908
4903
|
return c`
|
|
4909
4904
|
<button
|
|
4910
4905
|
class="pc-inline-trigger"
|
|
@@ -4963,7 +4958,7 @@ let X = class extends m {
|
|
|
4963
4958
|
aria-label="Close"
|
|
4964
4959
|
data-testid="popover-close-button"
|
|
4965
4960
|
>
|
|
4966
|
-
${
|
|
4961
|
+
${Pt}
|
|
4967
4962
|
</button>
|
|
4968
4963
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
4969
4964
|
${e ? this.renderBarChart() : this.renderPollOptions()}
|
|
@@ -4980,7 +4975,7 @@ let X = class extends m {
|
|
|
4980
4975
|
@keydown=${(s) => {
|
|
4981
4976
|
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), this.handlePopoverEditClick());
|
|
4982
4977
|
}}
|
|
4983
|
-
>${
|
|
4978
|
+
>${Ct}</span
|
|
4984
4979
|
>` : u}
|
|
4985
4980
|
</div>` : u}
|
|
4986
4981
|
</div>
|
|
@@ -5037,25 +5032,25 @@ let X = class extends m {
|
|
|
5037
5032
|
* Render standard mode - original behavior
|
|
5038
5033
|
*/
|
|
5039
5034
|
renderStandardMode() {
|
|
5040
|
-
const e =
|
|
5035
|
+
const e = O(this.questionPosition, this.questionAlign), t = {
|
|
5041
5036
|
[`pc-flex-pos-${this.questionPosition}`]: !0,
|
|
5042
5037
|
[`pc-flex-align-${e}`]: !0
|
|
5043
|
-
}, o =
|
|
5038
|
+
}, o = O(this.statsPosition, this.statsAlign), r = {
|
|
5044
5039
|
"pc-body": !0,
|
|
5045
5040
|
[`pc-flex-pos-${this.statsPosition}`]: !0,
|
|
5046
5041
|
[`pc-flex-align-${o}`]: !0
|
|
5047
|
-
}, s =
|
|
5048
|
-
role:
|
|
5042
|
+
}, s = ot({
|
|
5043
|
+
role: L.REGION,
|
|
5049
5044
|
ariaLabel: this.question || this.name || "Poll"
|
|
5050
5045
|
});
|
|
5051
5046
|
return c`
|
|
5052
5047
|
<div
|
|
5053
|
-
class="pc-container ${
|
|
5048
|
+
class="pc-container ${y(t)}"
|
|
5054
5049
|
data-testid="poll-container"
|
|
5055
5050
|
...=${s}
|
|
5056
5051
|
>
|
|
5057
5052
|
${this.renderLabelAtStart()}
|
|
5058
|
-
<div class="${
|
|
5053
|
+
<div class="${y(r)}" data-testid="poll-body">
|
|
5059
5054
|
${this.renderContent()} ${this.renderFooter()}
|
|
5060
5055
|
</div>
|
|
5061
5056
|
${this.renderLabelAtEnd()}
|
|
@@ -5066,15 +5061,15 @@ let X = class extends m {
|
|
|
5066
5061
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
5067
5062
|
}
|
|
5068
5063
|
};
|
|
5069
|
-
X.styles = [...m.styles,
|
|
5064
|
+
X.styles = [...m.styles, _t, hr];
|
|
5070
5065
|
mt([
|
|
5071
|
-
|
|
5066
|
+
f({ type: Boolean })
|
|
5072
5067
|
], X.prototype, "multiple", 2);
|
|
5073
5068
|
mt([
|
|
5074
|
-
|
|
5069
|
+
f({ type: Boolean })
|
|
5075
5070
|
], X.prototype, "compact", 2);
|
|
5076
5071
|
mt([
|
|
5077
|
-
|
|
5072
|
+
k()
|
|
5078
5073
|
], X.prototype, "popoverOpen", 2);
|
|
5079
5074
|
mt([
|
|
5080
5075
|
ft(".pc-inline-trigger")
|
|
@@ -5082,7 +5077,7 @@ mt([
|
|
|
5082
5077
|
X = mt([
|
|
5083
5078
|
F("pc-poll")
|
|
5084
5079
|
], X);
|
|
5085
|
-
const
|
|
5080
|
+
const mr = B`
|
|
5086
5081
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
5087
5082
|
|
|
5088
5083
|
.pc-section {
|
|
@@ -5269,10 +5264,10 @@ const yr = R`
|
|
|
5269
5264
|
* Copyright 2018 Google LLC
|
|
5270
5265
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5271
5266
|
*/
|
|
5272
|
-
const
|
|
5267
|
+
const Ye = "important", vr = " !" + Ye, br = He(class extends Fe {
|
|
5273
5268
|
constructor(e) {
|
|
5274
5269
|
var t;
|
|
5275
|
-
if (super(e), e.type !==
|
|
5270
|
+
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.");
|
|
5276
5271
|
}
|
|
5277
5272
|
render(e) {
|
|
5278
5273
|
return Object.keys(e).reduce((t, o) => {
|
|
@@ -5288,11 +5283,11 @@ const We = "important", wr = " !" + We, xr = Fe(class extends Ye {
|
|
|
5288
5283
|
const s = t[r];
|
|
5289
5284
|
if (s != null) {
|
|
5290
5285
|
this.ft.add(r);
|
|
5291
|
-
const i = typeof s == "string" && s.endsWith(
|
|
5292
|
-
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ?
|
|
5286
|
+
const i = typeof s == "string" && s.endsWith(vr);
|
|
5287
|
+
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? Ye : "") : o[r] = s;
|
|
5293
5288
|
}
|
|
5294
5289
|
}
|
|
5295
|
-
return
|
|
5290
|
+
return q;
|
|
5296
5291
|
}
|
|
5297
5292
|
});
|
|
5298
5293
|
function wt(e, t = {}) {
|
|
@@ -5324,7 +5319,7 @@ function wt(e, t = {}) {
|
|
|
5324
5319
|
</div>
|
|
5325
5320
|
`;
|
|
5326
5321
|
}
|
|
5327
|
-
const
|
|
5322
|
+
const Se = {
|
|
5328
5323
|
// Faces
|
|
5329
5324
|
smile: "😊",
|
|
5330
5325
|
laugh: "😄",
|
|
@@ -5467,19 +5462,19 @@ const $e = {
|
|
|
5467
5462
|
hiking: "🥾",
|
|
5468
5463
|
yoga: "🧘"
|
|
5469
5464
|
};
|
|
5470
|
-
function
|
|
5465
|
+
function Et(e) {
|
|
5471
5466
|
let t = "❓", o = !1;
|
|
5472
|
-
return e ? e in
|
|
5467
|
+
return e ? e in Se ? t = Se[e] : Re(e) ? t = e : Tt(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 = "❓", {
|
|
5473
5468
|
icon: t,
|
|
5474
5469
|
isRemoteImage: o
|
|
5475
5470
|
};
|
|
5476
5471
|
}
|
|
5477
|
-
var
|
|
5478
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
5472
|
+
var yr = Object.defineProperty, xr = Object.getOwnPropertyDescriptor, it = (e, t, o, r) => {
|
|
5473
|
+
for (var s = r > 1 ? void 0 : r ? xr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
5479
5474
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
5480
|
-
return r && s &&
|
|
5475
|
+
return r && s && yr(t, o, s), s;
|
|
5481
5476
|
};
|
|
5482
|
-
let
|
|
5477
|
+
let H = class extends m {
|
|
5483
5478
|
constructor() {
|
|
5484
5479
|
super(), this.type = $.stars, this.icon = "★", this.numStars = 5, this.hoverValue = -1, this.popoverOpen = !1, this.handleStarKeyDown = (e) => {
|
|
5485
5480
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -5502,14 +5497,14 @@ let q = class extends m {
|
|
|
5502
5497
|
* Renders the star icon using resolveIcon for emoji, URL, or MDI support
|
|
5503
5498
|
*/
|
|
5504
5499
|
renderStarIcon() {
|
|
5505
|
-
const { icon: e, isRemoteImage: t } =
|
|
5500
|
+
const { icon: e, isRemoteImage: t } = Et(this.icon);
|
|
5506
5501
|
return t ? c`<img class="star-icon-img" src="${e}" alt="star" />` : e;
|
|
5507
5502
|
}
|
|
5508
5503
|
/**
|
|
5509
5504
|
* Gets the resolved icon string (for use in chart labels)
|
|
5510
5505
|
*/
|
|
5511
5506
|
getResolvedIconString() {
|
|
5512
|
-
const { icon: e, isRemoteImage: t } =
|
|
5507
|
+
const { icon: e, isRemoteImage: t } = Et(this.icon);
|
|
5513
5508
|
return t ? "★" : e;
|
|
5514
5509
|
}
|
|
5515
5510
|
/**
|
|
@@ -5520,22 +5515,22 @@ let q = class extends m {
|
|
|
5520
5515
|
renderStars(e = !1) {
|
|
5521
5516
|
var n;
|
|
5522
5517
|
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) => {
|
|
5523
|
-
const p = e ? t || 0 : Math.floor(i),
|
|
5518
|
+
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, w = {
|
|
5524
5519
|
star: !0,
|
|
5525
|
-
selected:
|
|
5520
|
+
selected: h,
|
|
5526
5521
|
partial: b,
|
|
5527
5522
|
"view-mode": !a
|
|
5528
|
-
},
|
|
5523
|
+
}, E = b ? { "--partial-fill": `${i % 1 * 100}%` } : {}, C = e ? () => this.handlePopoverStarClick(d) : () => this.handleStarClick(d);
|
|
5529
5524
|
return c`
|
|
5530
5525
|
<div class="pc-section" data-testid="pc-section">
|
|
5531
5526
|
<span
|
|
5532
5527
|
data-testid="${e ? "popover" : "stars-view"}-star-${d}"
|
|
5533
|
-
class=${w
|
|
5534
|
-
style=${
|
|
5528
|
+
class=${y(w)}
|
|
5529
|
+
style=${br(E)}
|
|
5535
5530
|
role="${a ? "button" : "presentation"}"
|
|
5536
5531
|
tabindex="${a ? "0" : ""}"
|
|
5537
5532
|
aria-label="${a ? `Rate ${d} star${d > 1 ? "s" : ""}` : ""}"
|
|
5538
|
-
@click="${
|
|
5533
|
+
@click="${C}"
|
|
5539
5534
|
@mouseenter="${() => this.handleStarHover(d)}"
|
|
5540
5535
|
@focus="${() => this.handleStarHover(d)}"
|
|
5541
5536
|
@mouseleave="${this.handleStarLeave}"
|
|
@@ -5626,7 +5621,7 @@ let q = class extends m {
|
|
|
5626
5621
|
};
|
|
5627
5622
|
return c`
|
|
5628
5623
|
<button
|
|
5629
|
-
class=${
|
|
5624
|
+
class=${y(i)}
|
|
5630
5625
|
@click=${() => {
|
|
5631
5626
|
this.popoverOpen = !0;
|
|
5632
5627
|
}}
|
|
@@ -5659,7 +5654,7 @@ let q = class extends m {
|
|
|
5659
5654
|
aria-label="Close"
|
|
5660
5655
|
data-testid="popover-close-button"
|
|
5661
5656
|
>
|
|
5662
|
-
${
|
|
5657
|
+
${Pt}
|
|
5663
5658
|
</button>
|
|
5664
5659
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
5665
5660
|
${this.renderStars(!0)}
|
|
@@ -5708,7 +5703,7 @@ let q = class extends m {
|
|
|
5708
5703
|
@keydown="${(e) => {
|
|
5709
5704
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
|
|
5710
5705
|
}}"
|
|
5711
|
-
>${this.displayController.isChartVisible ?
|
|
5706
|
+
>${this.displayController.isChartVisible ? Zt : Gt}</span
|
|
5712
5707
|
>
|
|
5713
5708
|
`;
|
|
5714
5709
|
}
|
|
@@ -5766,18 +5761,18 @@ let q = class extends m {
|
|
|
5766
5761
|
* Render standard mode - original behavior
|
|
5767
5762
|
*/
|
|
5768
5763
|
renderStandardMode() {
|
|
5769
|
-
const e =
|
|
5764
|
+
const e = O(this.questionPosition, this.questionAlign), t = {
|
|
5770
5765
|
[`pc-flex-pos-${this.questionPosition}`]: !0,
|
|
5771
5766
|
[`pc-flex-align-${e}`]: !0
|
|
5772
|
-
}, o =
|
|
5767
|
+
}, o = O(this.statsPosition, this.statsAlign), r = {
|
|
5773
5768
|
"pc-body": !0,
|
|
5774
5769
|
[`pc-flex-pos-${this.statsPosition}`]: !0,
|
|
5775
5770
|
[`pc-flex-align-${o}`]: !0
|
|
5776
5771
|
}, s = !this.displayController.shouldShowChart();
|
|
5777
5772
|
return c`
|
|
5778
|
-
<div class="pc-container ${
|
|
5773
|
+
<div class="pc-container ${y(t)}" data-testid="pc-container">
|
|
5779
5774
|
${this.renderLabelAtStart()}
|
|
5780
|
-
<div class="${
|
|
5775
|
+
<div class="${y(r)}" data-testid="stars-body">
|
|
5781
5776
|
${this.renderStatusAtStart()} ${this.renderChart()}
|
|
5782
5777
|
${s ? this.renderStars() : u} ${this.renderStatusAtEnd()}
|
|
5783
5778
|
</div>
|
|
@@ -5789,26 +5784,26 @@ let q = class extends m {
|
|
|
5789
5784
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
5790
5785
|
}
|
|
5791
5786
|
};
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
],
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
],
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
],
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
],
|
|
5805
|
-
|
|
5787
|
+
H.styles = [...m.styles, _t, mr];
|
|
5788
|
+
it([
|
|
5789
|
+
f({ type: String })
|
|
5790
|
+
], H.prototype, "icon", 2);
|
|
5791
|
+
it([
|
|
5792
|
+
f({ type: Number, attribute: "num-stars" })
|
|
5793
|
+
], H.prototype, "numStars", 2);
|
|
5794
|
+
it([
|
|
5795
|
+
k()
|
|
5796
|
+
], H.prototype, "hoverValue", 2);
|
|
5797
|
+
it([
|
|
5798
|
+
k()
|
|
5799
|
+
], H.prototype, "popoverOpen", 2);
|
|
5800
|
+
it([
|
|
5806
5801
|
ft(".pc-inline-trigger")
|
|
5807
|
-
],
|
|
5808
|
-
|
|
5802
|
+
], H.prototype, "triggerElement", 2);
|
|
5803
|
+
H = it([
|
|
5809
5804
|
F("pc-stars")
|
|
5810
|
-
],
|
|
5811
|
-
const
|
|
5805
|
+
], H);
|
|
5806
|
+
const wr = B`
|
|
5812
5807
|
/* Adjust stats text for reactions */
|
|
5813
5808
|
.pc-stats-text {
|
|
5814
5809
|
font-size: var(--pc-font-size-small, var(--default-font-size-small));
|
|
@@ -6071,13 +6066,13 @@ const Cr = R`
|
|
|
6071
6066
|
animation: none;
|
|
6072
6067
|
}
|
|
6073
6068
|
}
|
|
6074
|
-
`,
|
|
6075
|
-
var
|
|
6076
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
6069
|
+
`, $r = "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";
|
|
6070
|
+
var Sr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, Ot = (e, t, o, r) => {
|
|
6071
|
+
for (var s = r > 1 ? void 0 : r ? Cr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
6077
6072
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
6078
|
-
return r && s &&
|
|
6073
|
+
return r && s && Sr(t, o, s), s;
|
|
6079
6074
|
};
|
|
6080
|
-
let
|
|
6075
|
+
let st = class extends m {
|
|
6081
6076
|
constructor() {
|
|
6082
6077
|
super(), this.type = $.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";
|
|
6083
6078
|
}
|
|
@@ -6101,7 +6096,7 @@ let rt = class extends m {
|
|
|
6101
6096
|
* Renders the icon for a reaction
|
|
6102
6097
|
*/
|
|
6103
6098
|
renderReactionIcon(e, t) {
|
|
6104
|
-
const { icon: o, isRemoteImage: r } =
|
|
6099
|
+
const { icon: o, isRemoteImage: r } = Et(e), s = Jt.FUNCTIONAL, i = t.tooltip || `${t.value} reaction`, a = je(o, {
|
|
6105
6100
|
type: s,
|
|
6106
6101
|
alt: i,
|
|
6107
6102
|
ariaLabel: i,
|
|
@@ -6128,7 +6123,7 @@ let rt = class extends m {
|
|
|
6128
6123
|
}, l = `${e.tooltip || e.value} reaction${o ? ", selected" : ""}${t ? `, ${r} votes` : ""}`;
|
|
6129
6124
|
return c`
|
|
6130
6125
|
<button
|
|
6131
|
-
class="${
|
|
6126
|
+
class="${y(a)}"
|
|
6132
6127
|
@click="${() => this.handleReactionClick(e)}"
|
|
6133
6128
|
?disabled="${s}"
|
|
6134
6129
|
aria-pressed="${o}"
|
|
@@ -6155,7 +6150,7 @@ let rt = class extends m {
|
|
|
6155
6150
|
aria-expanded="${this.displayController.shouldShowReactionPopover()}"
|
|
6156
6151
|
aria-haspopup="true"
|
|
6157
6152
|
>
|
|
6158
|
-
<img src="${
|
|
6153
|
+
<img src="${$r}" alt="" class="trigger-icon" />
|
|
6159
6154
|
</button>
|
|
6160
6155
|
`;
|
|
6161
6156
|
}
|
|
@@ -6170,7 +6165,7 @@ let rt = class extends m {
|
|
|
6170
6165
|
bottom: this.popupPosition === "bottom" || this.popupPosition === "auto" && !this.shouldShowPopoverOnTop()
|
|
6171
6166
|
};
|
|
6172
6167
|
return c`
|
|
6173
|
-
<div class="${
|
|
6168
|
+
<div class="${y(e)}" role="menu">
|
|
6174
6169
|
<div class="popover-content">
|
|
6175
6170
|
${this.options.map((t) => {
|
|
6176
6171
|
const o = this.displayController.shouldDisableOption(t);
|
|
@@ -6217,7 +6212,7 @@ let rt = class extends m {
|
|
|
6217
6212
|
(o) => this.dataController.isValueSelected(o.value)
|
|
6218
6213
|
);
|
|
6219
6214
|
return c`
|
|
6220
|
-
<div class="${
|
|
6215
|
+
<div class="${y(e)}">
|
|
6221
6216
|
${t.length > 0 ? c`
|
|
6222
6217
|
<div class="reaction-list">
|
|
6223
6218
|
${t.map(
|
|
@@ -6230,7 +6225,7 @@ let rt = class extends m {
|
|
|
6230
6225
|
`;
|
|
6231
6226
|
} else
|
|
6232
6227
|
return c`
|
|
6233
|
-
<div class="${
|
|
6228
|
+
<div class="${y(e)}">
|
|
6234
6229
|
<div class="reaction-list">
|
|
6235
6230
|
${this.options.map((t) => this.renderReactionButton(t, this.showCounts))}
|
|
6236
6231
|
</div>
|
|
@@ -6245,7 +6240,7 @@ let rt = class extends m {
|
|
|
6245
6240
|
const e = this.dataController.getBreakdownInfo(), o = Object.entries(e.breakdownCount).filter(
|
|
6246
6241
|
([n, d]) => this.options.some((p) => p.value === n)
|
|
6247
6242
|
).map(([n, d]) => {
|
|
6248
|
-
const p = this.options.find((
|
|
6243
|
+
const p = this.options.find((h) => h.value === n);
|
|
6249
6244
|
return {
|
|
6250
6245
|
label: n,
|
|
6251
6246
|
// Use the reaction value as label
|
|
@@ -6294,18 +6289,18 @@ let rt = class extends m {
|
|
|
6294
6289
|
* (Reactions are inherently inline, so inline mode = standard mode)
|
|
6295
6290
|
*/
|
|
6296
6291
|
renderStandardMode() {
|
|
6297
|
-
const e =
|
|
6292
|
+
const e = O(this.questionPosition, this.questionAlign), t = {
|
|
6298
6293
|
[`pc-flex-pos-${this.questionPosition}`]: !0,
|
|
6299
6294
|
[`pc-flex-align-${e}`]: !0
|
|
6300
|
-
}, o =
|
|
6295
|
+
}, o = O(this.statsPosition, this.statsAlign), r = {
|
|
6301
6296
|
"pc-body": !0,
|
|
6302
6297
|
[`pc-flex-pos-${this.statsPosition}`]: !0,
|
|
6303
6298
|
[`pc-flex-align-${o}`]: !0
|
|
6304
6299
|
};
|
|
6305
6300
|
return c`
|
|
6306
|
-
<div class="${
|
|
6301
|
+
<div class="${y(t)}" data-testid="reaction-container">
|
|
6307
6302
|
${this.renderLabelAtStart()}
|
|
6308
|
-
<div class="${
|
|
6303
|
+
<div class="${y(r)}" data-testid="reaction-body">
|
|
6309
6304
|
${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderReactions()}
|
|
6310
6305
|
${this.renderStatusAtEnd()}
|
|
6311
6306
|
</div>
|
|
@@ -6317,35 +6312,35 @@ let rt = class extends m {
|
|
|
6317
6312
|
return this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
6318
6313
|
}
|
|
6319
6314
|
};
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
],
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
],
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
],
|
|
6330
|
-
|
|
6315
|
+
st.styles = [...m.styles, _t, wr];
|
|
6316
|
+
Ot([
|
|
6317
|
+
f({ type: Boolean, attribute: "show-counts" })
|
|
6318
|
+
], st.prototype, "showCounts", 2);
|
|
6319
|
+
Ot([
|
|
6320
|
+
f({ type: Boolean, reflect: !0 })
|
|
6321
|
+
], st.prototype, "compact", 2);
|
|
6322
|
+
Ot([
|
|
6323
|
+
f({ type: String, attribute: "popup-position" })
|
|
6324
|
+
], st.prototype, "popupPosition", 2);
|
|
6325
|
+
st = Ot([
|
|
6331
6326
|
F("pc-reaction")
|
|
6332
|
-
],
|
|
6327
|
+
], st);
|
|
6333
6328
|
function nt(e, t, o = void 0) {
|
|
6334
6329
|
const r = e.getAttribute(t);
|
|
6335
6330
|
return r === null ? o : r == null ? void 0 : r.trim();
|
|
6336
6331
|
}
|
|
6337
|
-
function
|
|
6332
|
+
function kr(e, t = void 0) {
|
|
6338
6333
|
const o = e.textContent;
|
|
6339
6334
|
return o === "" || o === null ? t : o == null ? void 0 : o.trim();
|
|
6340
6335
|
}
|
|
6341
|
-
var
|
|
6342
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
6336
|
+
var Er = Object.defineProperty, Ar = Object.getOwnPropertyDescriptor, vt = (e, t, o, r) => {
|
|
6337
|
+
for (var s = r > 1 ? void 0 : r ? Ar(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
6343
6338
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
6344
|
-
return r && s &&
|
|
6339
|
+
return r && s && Er(t, o, s), s;
|
|
6345
6340
|
};
|
|
6346
|
-
let
|
|
6341
|
+
let J = class extends D {
|
|
6347
6342
|
constructor() {
|
|
6348
|
-
super(), this.options = "", this.parsedOptions = [],
|
|
6343
|
+
super(), this.options = "", this.parsedOptions = [], J.injectGlobalStyle();
|
|
6349
6344
|
}
|
|
6350
6345
|
/**
|
|
6351
6346
|
* Inject global style to hide poll-catch-option elements
|
|
@@ -6369,9 +6364,6 @@ let H = class extends N {
|
|
|
6369
6364
|
createRenderRoot() {
|
|
6370
6365
|
return this;
|
|
6371
6366
|
}
|
|
6372
|
-
connectedCallback() {
|
|
6373
|
-
super.connectedCallback(), this.widgetId && (this.type = void 0, this.prefetchWidgetConfig());
|
|
6374
|
-
}
|
|
6375
6367
|
forceUpdate() {
|
|
6376
6368
|
this.forwardAttributesToWidget(), this.forwardOptionsToWidget();
|
|
6377
6369
|
}
|
|
@@ -6388,35 +6380,6 @@ let H = class extends N {
|
|
|
6388
6380
|
updated(e) {
|
|
6389
6381
|
this.forwardAttributesToWidget(), (e.has("type") || e.has("options")) && this.forwardOptionsToWidget();
|
|
6390
6382
|
}
|
|
6391
|
-
/**
|
|
6392
|
-
* Prefetch widget config from the API to determine widget type
|
|
6393
|
-
*/
|
|
6394
|
-
async prefetchWidgetConfig() {
|
|
6395
|
-
var e, t;
|
|
6396
|
-
if (!this.widgetId || !Be.test(this.widgetId)) {
|
|
6397
|
-
g.warn(`poll-catch: Invalid widget-id format for prefetch: ${this.widgetId}`);
|
|
6398
|
-
return;
|
|
6399
|
-
}
|
|
6400
|
-
this.isPrefetching = !0;
|
|
6401
|
-
try {
|
|
6402
|
-
const o = await je({ type: "registered", widgetId: this.widgetId }), r = (e = o.data) == null ? void 0 : e.config, s = (t = o.data) == null ? void 0 : t.stats;
|
|
6403
|
-
if (!(r != null && r.type) || !Object.values($).includes(r.type))
|
|
6404
|
-
throw new Error(`Invalid widget type from server: ${r == null ? void 0 : r.type}`);
|
|
6405
|
-
Zo(this.widgetId, {
|
|
6406
|
-
config: { type: r.type, attributes: r.attributes || null },
|
|
6407
|
-
stats: {
|
|
6408
|
-
count: (s == null ? void 0 : s.count) ?? 0,
|
|
6409
|
-
sum: (s == null ? void 0 : s.sum) ?? 0,
|
|
6410
|
-
breakdown: (s == null ? void 0 : s.breakdown) ?? {},
|
|
6411
|
-
updatedAt: (s == null ? void 0 : s.updatedAt) || (s == null ? void 0 : s.updated_at)
|
|
6412
|
-
}
|
|
6413
|
-
}), this.type = r.type;
|
|
6414
|
-
} catch (o) {
|
|
6415
|
-
g.warn("poll-catch: Failed to prefetch widget config", o);
|
|
6416
|
-
} finally {
|
|
6417
|
-
this.isPrefetching = !1;
|
|
6418
|
-
}
|
|
6419
|
-
}
|
|
6420
6383
|
/**
|
|
6421
6384
|
* Forward all attributes except 'type' to the child widget
|
|
6422
6385
|
*/
|
|
@@ -6434,17 +6397,17 @@ let H = class extends N {
|
|
|
6434
6397
|
const e = this.querySelector("pc-poll, pc-reaction");
|
|
6435
6398
|
if (!e) return;
|
|
6436
6399
|
const t = this.querySelectorAll("poll-catch-option");
|
|
6437
|
-
let r =
|
|
6400
|
+
let r = Be(this.options).map((s) => ({
|
|
6438
6401
|
value: s,
|
|
6439
6402
|
label: s,
|
|
6440
6403
|
icon: e.tagName === "PC-REACTION" ? s : void 0
|
|
6441
6404
|
// REACTION widget uses options for the icon
|
|
6442
6405
|
}));
|
|
6443
6406
|
t && t.length > 0 && (r = Array.from(t).map((s) => {
|
|
6444
|
-
const i = nt(s, "value", "") || "", a = nt(s, "label",
|
|
6407
|
+
const i = nt(s, "value", "") || "", a = nt(s, "label", kr(s, i)) || "", l = nt(s, "icon", void 0), n = nt(s, "tooltip", void 0), d = nt(s, "disabled", void 0), p = { value: i, label: a };
|
|
6445
6408
|
if (l !== void 0) {
|
|
6446
|
-
const
|
|
6447
|
-
p.icon =
|
|
6409
|
+
const h = Et(l);
|
|
6410
|
+
p.icon = h.icon;
|
|
6448
6411
|
}
|
|
6449
6412
|
return n !== void 0 && (p.tooltip = n), d !== void 0 && (p.disabled = !0), p;
|
|
6450
6413
|
})), this.parsedOptions = r;
|
|
@@ -6453,8 +6416,6 @@ let H = class extends N {
|
|
|
6453
6416
|
* Render the appropriate widget based on the type
|
|
6454
6417
|
*/
|
|
6455
6418
|
render() {
|
|
6456
|
-
if (this.isPrefetching)
|
|
6457
|
-
return u;
|
|
6458
6419
|
switch (this.type) {
|
|
6459
6420
|
case $.nps:
|
|
6460
6421
|
return c`<pc-nps></pc-nps>`;
|
|
@@ -6465,30 +6426,27 @@ let H = class extends N {
|
|
|
6465
6426
|
case $.reaction:
|
|
6466
6427
|
return c`<pc-reaction .options=${this.parsedOptions}></pc-reaction>`;
|
|
6467
6428
|
default:
|
|
6468
|
-
return
|
|
6429
|
+
return console.warn(
|
|
6469
6430
|
`poll-catch: Unknown widget type "${this.type}". Supported types: nps, poll, stars, reaction.`
|
|
6470
6431
|
), u;
|
|
6471
6432
|
}
|
|
6472
6433
|
}
|
|
6473
6434
|
};
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
],
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
],
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
],
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
],
|
|
6486
|
-
|
|
6487
|
-
C()
|
|
6488
|
-
], H.prototype, "isPrefetching", 2);
|
|
6489
|
-
H = it([
|
|
6435
|
+
vt([
|
|
6436
|
+
f({ type: String })
|
|
6437
|
+
], J.prototype, "type", 2);
|
|
6438
|
+
vt([
|
|
6439
|
+
f({ type: String })
|
|
6440
|
+
], J.prototype, "options", 2);
|
|
6441
|
+
vt([
|
|
6442
|
+
f({ type: String, attribute: "widget-id" })
|
|
6443
|
+
], J.prototype, "widgetId", 2);
|
|
6444
|
+
vt([
|
|
6445
|
+
k()
|
|
6446
|
+
], J.prototype, "parsedOptions", 2);
|
|
6447
|
+
J = vt([
|
|
6490
6448
|
F("poll-catch")
|
|
6491
|
-
],
|
|
6449
|
+
], J);
|
|
6492
6450
|
export {
|
|
6493
|
-
|
|
6451
|
+
J as PollCatch
|
|
6494
6452
|
};
|