pollcatch 2.2.2 → 2.2.4
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 +1 -1
- package/pc.js +188 -120
package/package.json
CHANGED
package/pc.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const it = globalThis, _t = it.ShadowRoot && (it.ShadyCSS === void 0 || it.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Et = Symbol(),
|
|
6
|
+
const it = globalThis, _t = it.ShadowRoot && (it.ShadyCSS === void 0 || it.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Et = Symbol(), Rt = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
let le = class {
|
|
8
8
|
constructor(t, o, r) {
|
|
9
9
|
if (this._$cssResult$ = !0, r !== Et) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
@@ -14,7 +14,7 @@ let le = class {
|
|
|
14
14
|
const o = this.t;
|
|
15
15
|
if (_t && t === void 0) {
|
|
16
16
|
const r = o !== void 0 && o.length === 1;
|
|
17
|
-
r && (t =
|
|
17
|
+
r && (t = Rt.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && Rt.set(o, t));
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
}
|
|
@@ -35,7 +35,7 @@ const Ae = (e) => new le(typeof e == "string" ? e : e + "", void 0, Et), F = (e,
|
|
|
35
35
|
const r = document.createElement("style"), s = it.litNonce;
|
|
36
36
|
s !== void 0 && r.setAttribute("nonce", s), r.textContent = o.cssText, e.appendChild(r);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, jt = _t ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
|
|
39
39
|
let o = "";
|
|
40
40
|
for (const r of t.cssRules) o += r.cssText;
|
|
41
41
|
return Ae(o);
|
|
@@ -45,7 +45,7 @@ const Ae = (e) => new le(typeof e == "string" ? e : e + "", void 0, Et), F = (e,
|
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is: Ee, defineProperty: Pe, getOwnPropertyDescriptor: Oe, getOwnPropertyNames: Te, getOwnPropertySymbols: ze, getPrototypeOf: Ie } = Object, T = globalThis,
|
|
48
|
+
const { is: Ee, defineProperty: Pe, getOwnPropertyDescriptor: Oe, getOwnPropertyNames: Te, getOwnPropertySymbols: ze, getPrototypeOf: Ie } = Object, T = globalThis, Ut = T.trustedTypes, Ne = Ut ? Ut.emptyScript : "", bt = T.reactiveElementPolyfillSupport, K = (e, t) => e, at = { toAttribute(e, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
e = e ? Ne : null;
|
|
@@ -75,7 +75,7 @@ const { is: Ee, defineProperty: Pe, getOwnPropertyDescriptor: Oe, getOwnProperty
|
|
|
75
75
|
return o;
|
|
76
76
|
} }, Pt = (e, t) => !Ee(e, t), Bt = { attribute: !0, type: String, converter: at, reflect: !1, hasChanged: Pt };
|
|
77
77
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), T.litPropertyMetadata ?? (T.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
|
-
let
|
|
78
|
+
let j = class extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
81
81
|
}
|
|
@@ -131,8 +131,8 @@ let U = class extends HTMLElement {
|
|
|
131
131
|
const o = [];
|
|
132
132
|
if (Array.isArray(t)) {
|
|
133
133
|
const r = new Set(t.flat(1 / 0).reverse());
|
|
134
|
-
for (const s of r) o.unshift(
|
|
135
|
-
} else t !== void 0 && o.push(
|
|
134
|
+
for (const s of r) o.unshift(jt(s));
|
|
135
|
+
} else t !== void 0 && o.push(jt(t));
|
|
136
136
|
return o;
|
|
137
137
|
}
|
|
138
138
|
static _$Eu(t, o) {
|
|
@@ -273,28 +273,28 @@ let U = class extends HTMLElement {
|
|
|
273
273
|
firstUpdated(t) {
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
|
-
|
|
276
|
+
j.elementStyles = [], j.shadowRootOptions = { mode: "open" }, j[K("elementProperties")] = /* @__PURE__ */ new Map(), j[K("finalized")] = /* @__PURE__ */ new Map(), bt == null || bt({ ReactiveElement: j }), (T.reactiveElementVersions ?? (T.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 W = globalThis, nt = W.trustedTypes, Dt = nt ? nt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ce = "$lit$",
|
|
282
|
+
const W = globalThis, nt = W.trustedTypes, Dt = nt ? nt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ce = "$lit$", O = `lit$${Math.random().toFixed(9).slice(2)}$`, de = "?" + O, Me = `<${de}>`, L = document, X = () => L.createComment(""), Q = (e) => e === null || typeof e != "object" && typeof e != "function", Ot = Array.isArray, Le = (e) => Ot(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", gt = `[
|
|
283
283
|
\f\r]`, Z = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Vt = /-->/g, qt = />/g, N = RegExp(`>|${gt}(?:([^\\s"'>=/]+)(${gt}*=${gt}*(?:[^
|
|
284
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ht = /'/g, Ft = /"/g, pe = /^(?:script|style|textarea|title)$/i,
|
|
284
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ht = /'/g, Ft = /"/g, pe = /^(?:script|style|textarea|title)$/i, Re = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), d = Re(1), z = Symbol.for("lit-noChange"), h = Symbol.for("lit-nothing"), Yt = /* @__PURE__ */ new WeakMap(), M = L.createTreeWalker(L, 129);
|
|
285
285
|
function ue(e, t) {
|
|
286
286
|
if (!Ot(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
287
287
|
return Dt !== void 0 ? Dt.createHTML(t) : t;
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const je = (e, t) => {
|
|
290
290
|
const o = e.length - 1, r = [];
|
|
291
291
|
let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = Z;
|
|
292
292
|
for (let n = 0; n < o; n++) {
|
|
293
293
|
const l = e[n];
|
|
294
|
-
let p, c, u = -1,
|
|
295
|
-
for (;
|
|
296
|
-
const
|
|
297
|
-
i += a === Z ? l + Me : u >= 0 ? (r.push(p), l.slice(0, u) + ce + l.slice(u) +
|
|
294
|
+
let p, c, u = -1, v = 0;
|
|
295
|
+
for (; v < l.length && (a.lastIndex = v, c = a.exec(l), c !== null); ) v = a.lastIndex, a === Z ? c[1] === "!--" ? a = Vt : c[1] !== void 0 ? a = qt : c[2] !== void 0 ? (pe.test(c[2]) && (s = RegExp("</" + c[2], "g")), a = N) : c[3] !== void 0 && (a = N) : a === N ? c[0] === ">" ? (a = s ?? Z, u = -1) : c[1] === void 0 ? u = -2 : (u = a.lastIndex - c[2].length, p = c[1], a = c[3] === void 0 ? N : c[3] === '"' ? Ft : Ht) : a === Ft || a === Ht ? a = N : a === Vt || a === qt ? a = Z : (a = N, s = void 0);
|
|
296
|
+
const y = a === N && e[n + 1].startsWith("/>") ? " " : "";
|
|
297
|
+
i += a === Z ? l + Me : u >= 0 ? (r.push(p), l.slice(0, u) + ce + l.slice(u) + O + y) : l + O + (u === -2 ? n : y);
|
|
298
298
|
}
|
|
299
299
|
return [ue(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
|
|
300
300
|
};
|
|
@@ -303,7 +303,7 @@ let At = class he {
|
|
|
303
303
|
let s;
|
|
304
304
|
this.parts = [];
|
|
305
305
|
let i = 0, a = 0;
|
|
306
|
-
const n = t.length - 1, l = this.parts, [p, c] =
|
|
306
|
+
const n = t.length - 1, l = this.parts, [p, c] = je(t, o);
|
|
307
307
|
if (this.el = he.createElement(p, r), M.currentNode = this.el.content, o === 2 || o === 3) {
|
|
308
308
|
const u = this.el.content.firstChild;
|
|
309
309
|
u.replaceWith(...u.childNodes);
|
|
@@ -311,27 +311,27 @@ let At = class he {
|
|
|
311
311
|
for (; (s = M.nextNode()) !== null && l.length < n; ) {
|
|
312
312
|
if (s.nodeType === 1) {
|
|
313
313
|
if (s.hasAttributes()) for (const u of s.getAttributeNames()) if (u.endsWith(ce)) {
|
|
314
|
-
const
|
|
315
|
-
l.push({ type: 1, index: i, name:
|
|
316
|
-
} else u.startsWith(
|
|
314
|
+
const v = c[a++], y = s.getAttribute(u).split(O), P = /([.?@])?(.*)/.exec(v);
|
|
315
|
+
l.push({ type: 1, index: i, name: P[2], strings: y, ctor: P[1] === "." ? Be : P[1] === "?" ? De : P[1] === "@" ? Ve : dt }), s.removeAttribute(u);
|
|
316
|
+
} else u.startsWith(O) && (l.push({ type: 6, index: i }), s.removeAttribute(u));
|
|
317
317
|
if (pe.test(s.tagName)) {
|
|
318
|
-
const u = s.textContent.split(
|
|
319
|
-
if (
|
|
318
|
+
const u = s.textContent.split(O), v = u.length - 1;
|
|
319
|
+
if (v > 0) {
|
|
320
320
|
s.textContent = nt ? nt.emptyScript : "";
|
|
321
|
-
for (let
|
|
322
|
-
s.append(u[
|
|
321
|
+
for (let y = 0; y < v; y++) s.append(u[y], X()), M.nextNode(), l.push({ type: 2, index: ++i });
|
|
322
|
+
s.append(u[v], X());
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
} else if (s.nodeType === 8) if (s.data === de) l.push({ type: 2, index: i });
|
|
326
326
|
else {
|
|
327
327
|
let u = -1;
|
|
328
|
-
for (; (u = s.data.indexOf(
|
|
328
|
+
for (; (u = s.data.indexOf(O, u + 1)) !== -1; ) l.push({ type: 7, index: i }), u += O.length - 1;
|
|
329
329
|
}
|
|
330
330
|
i++;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
static createElement(t, o) {
|
|
334
|
-
const r =
|
|
334
|
+
const r = L.createElement("template");
|
|
335
335
|
return r.innerHTML = t, r;
|
|
336
336
|
}
|
|
337
337
|
};
|
|
@@ -342,7 +342,7 @@ function D(e, t, o = e, r) {
|
|
|
342
342
|
const i = Q(t) ? void 0 : t._$litDirective$;
|
|
343
343
|
return (s == null ? void 0 : s.constructor) !== i && ((n = s == null ? void 0 : s._$AO) == null || n.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 = D(e, s._$AS(e, t.values), s, r)), t;
|
|
344
344
|
}
|
|
345
|
-
let
|
|
345
|
+
let Ue = class {
|
|
346
346
|
constructor(t, o) {
|
|
347
347
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = o;
|
|
348
348
|
}
|
|
@@ -353,7 +353,7 @@ let je = class {
|
|
|
353
353
|
return this._$AM._$AU;
|
|
354
354
|
}
|
|
355
355
|
u(t) {
|
|
356
|
-
const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ??
|
|
356
|
+
const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? L).importNode(o, !0);
|
|
357
357
|
M.currentNode = s;
|
|
358
358
|
let i = M.nextNode(), a = 0, n = 0, l = r[0];
|
|
359
359
|
for (; l !== void 0; ) {
|
|
@@ -363,7 +363,7 @@ let je = class {
|
|
|
363
363
|
}
|
|
364
364
|
a !== (l == null ? void 0 : l.index) && (i = M.nextNode(), a++);
|
|
365
365
|
}
|
|
366
|
-
return M.currentNode =
|
|
366
|
+
return M.currentNode = L, s;
|
|
367
367
|
}
|
|
368
368
|
p(t) {
|
|
369
369
|
let o = 0;
|
|
@@ -390,7 +390,7 @@ class et {
|
|
|
390
390
|
return this._$AB;
|
|
391
391
|
}
|
|
392
392
|
_$AI(t, o = this) {
|
|
393
|
-
t = D(this, t, o), Q(t) ? t === h || t == null || t === "" ? (this._$AH !== h && this._$AR(), this._$AH = h) : t !== this._$AH && t !== z && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) :
|
|
393
|
+
t = D(this, t, o), Q(t) ? t === h || t == null || t === "" ? (this._$AH !== h && this._$AR(), this._$AH = h) : t !== this._$AH && t !== z && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Le(t) ? this.k(t) : this._(t);
|
|
394
394
|
}
|
|
395
395
|
O(t) {
|
|
396
396
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -399,14 +399,14 @@ class et {
|
|
|
399
399
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
400
400
|
}
|
|
401
401
|
_(t) {
|
|
402
|
-
this._$AH !== h && Q(this._$AH) ? this._$AA.nextSibling.data = t : this.T(
|
|
402
|
+
this._$AH !== h && Q(this._$AH) ? this._$AA.nextSibling.data = t : this.T(L.createTextNode(t)), this._$AH = t;
|
|
403
403
|
}
|
|
404
404
|
$(t) {
|
|
405
405
|
var i;
|
|
406
406
|
const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = At.createElement(ue(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 Ue(s, this), n = a.u(this.options);
|
|
410
410
|
a.p(o), this.T(n), this._$AH = a;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
@@ -515,7 +515,7 @@ const He = (e, t, o) => {
|
|
|
515
515
|
* Copyright 2017 Google LLC
|
|
516
516
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
517
517
|
*/
|
|
518
|
-
let
|
|
518
|
+
let U = class extends j {
|
|
519
519
|
constructor() {
|
|
520
520
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
521
521
|
}
|
|
@@ -541,9 +541,9 @@ let j = class extends U {
|
|
|
541
541
|
}
|
|
542
542
|
};
|
|
543
543
|
var ne;
|
|
544
|
-
|
|
544
|
+
U._$litElement$ = !0, U.finalized = !0, (ne = globalThis.litElementHydrateSupport) == null || ne.call(globalThis, { LitElement: U });
|
|
545
545
|
const yt = globalThis.litElementPolyfillSupport;
|
|
546
|
-
yt == null || yt({ LitElement:
|
|
546
|
+
yt == null || yt({ LitElement: U });
|
|
547
547
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
|
548
548
|
/**
|
|
549
549
|
* @license
|
|
@@ -596,7 +596,53 @@ function Tt(e) {
|
|
|
596
596
|
return f({ ...e, state: !0, attribute: !1 });
|
|
597
597
|
}
|
|
598
598
|
var x = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))(x || {});
|
|
599
|
-
const Ze =
|
|
599
|
+
const Ze = d`
|
|
600
|
+
<svg
|
|
601
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
602
|
+
height="24px"
|
|
603
|
+
viewBox="0 -960 960 960"
|
|
604
|
+
width="24px"
|
|
605
|
+
fill="currentColor"
|
|
606
|
+
>
|
|
607
|
+
<path d="M640-160v-280h160v280H640Zm-240 0v-640h160v640H400Zm-240 0v-440h160v440H160Z" />
|
|
608
|
+
</svg>
|
|
609
|
+
`, Ge = d`
|
|
610
|
+
<svg
|
|
611
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
612
|
+
height="24px"
|
|
613
|
+
viewBox="0 -960 960 960"
|
|
614
|
+
width="24px"
|
|
615
|
+
fill="currentColor"
|
|
616
|
+
>
|
|
617
|
+
<path
|
|
618
|
+
d="M160-160v-440h160v440H160Zm240 0v-400l160 160v240H400Zm160-354L400-674v-126h160v286Zm240 240L640-434v-6h160v166Zm-9 219L55-791l57-57 736 736-57 57Z"
|
|
619
|
+
/>
|
|
620
|
+
</svg>
|
|
621
|
+
`, Ke = d`
|
|
622
|
+
<svg
|
|
623
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
624
|
+
height="24px"
|
|
625
|
+
viewBox="0 -960 960 960"
|
|
626
|
+
width="24px"
|
|
627
|
+
fill="currentColor"
|
|
628
|
+
>
|
|
629
|
+
<path
|
|
630
|
+
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"
|
|
631
|
+
/>
|
|
632
|
+
</svg>
|
|
633
|
+
`, We = d`
|
|
634
|
+
<svg
|
|
635
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
636
|
+
width="16"
|
|
637
|
+
height="16"
|
|
638
|
+
fill="currentColor"
|
|
639
|
+
viewBox="0 0 16 16"
|
|
640
|
+
>
|
|
641
|
+
<path
|
|
642
|
+
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"
|
|
643
|
+
/>
|
|
644
|
+
</svg>
|
|
645
|
+
`;
|
|
600
646
|
var Je = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
|
|
601
647
|
return typeof e == "string" ? e.length > 0 : typeof e == "number";
|
|
602
648
|
}, $ = function(e, t, o) {
|
|
@@ -797,8 +843,8 @@ function no(e, t = {}) {
|
|
|
797
843
|
l = a, p = c;
|
|
798
844
|
for (const u of n) {
|
|
799
845
|
if (u === a) continue;
|
|
800
|
-
const
|
|
801
|
-
|
|
846
|
+
const v = Ct(e, u);
|
|
847
|
+
v > p && (p = v, l = u);
|
|
802
848
|
}
|
|
803
849
|
b.warn(
|
|
804
850
|
`No color option met the minimum contrast ratio of ${r}:1 against ${e}. Using ${l} with contrast ratio ${p.toFixed(2)}:1 instead.`
|
|
@@ -900,7 +946,7 @@ function ho(e) {
|
|
|
900
946
|
const t = e.replace(/[<>"']/g, "").trim();
|
|
901
947
|
return /^(#[0-9a-fA-F]{3,8}|rgb\([^)]+\)|rgba\([^)]+\)|hsl\([^)]+\)|hsla\([^)]+\)|[a-zA-Z]+)$/.test(t);
|
|
902
948
|
}
|
|
903
|
-
function
|
|
949
|
+
function R(e) {
|
|
904
950
|
return ho(e) ? e.replace(/[<>"']/g, "").trim() : (b.warn("Invalid color value:", e), "#000000");
|
|
905
951
|
}
|
|
906
952
|
function fo(e) {
|
|
@@ -992,7 +1038,7 @@ function lt(e) {
|
|
|
992
1038
|
const s = t / r * 100, i = o / r * 100;
|
|
993
1039
|
return Math.round(s - i);
|
|
994
1040
|
}
|
|
995
|
-
function
|
|
1041
|
+
function E() {
|
|
996
1042
|
return {
|
|
997
1043
|
count: 0,
|
|
998
1044
|
sum: 0,
|
|
@@ -1004,12 +1050,12 @@ function O() {
|
|
|
1004
1050
|
}
|
|
1005
1051
|
function yo(e) {
|
|
1006
1052
|
if (!zt())
|
|
1007
|
-
return
|
|
1053
|
+
return E();
|
|
1008
1054
|
try {
|
|
1009
1055
|
const t = ve(e);
|
|
1010
|
-
return t ? { ...
|
|
1056
|
+
return t ? { ...E(), ...t } : E();
|
|
1011
1057
|
} catch (t) {
|
|
1012
|
-
return b.warn("Failed to load localStats from localStorage", t),
|
|
1058
|
+
return b.warn("Failed to load localStats from localStorage", t), E();
|
|
1013
1059
|
}
|
|
1014
1060
|
}
|
|
1015
1061
|
function wo(e, t) {
|
|
@@ -1038,7 +1084,7 @@ function $o(e, t) {
|
|
|
1038
1084
|
}
|
|
1039
1085
|
function xo(e, t) {
|
|
1040
1086
|
if (!e.count && !t.count)
|
|
1041
|
-
return
|
|
1087
|
+
return E();
|
|
1042
1088
|
if (!e.count)
|
|
1043
1089
|
return { ...t };
|
|
1044
1090
|
const o = {
|
|
@@ -1109,7 +1155,7 @@ function Ao(e, t = 50) {
|
|
|
1109
1155
|
class _o {
|
|
1110
1156
|
// Tracks if user has ever made a selection (even if later deselected)
|
|
1111
1157
|
constructor(t) {
|
|
1112
|
-
this.stats =
|
|
1158
|
+
this.stats = E(), this.localStats = E(), this.prevLocalStats = E(), this.isLoading = !0, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
|
|
1113
1159
|
}
|
|
1114
1160
|
hostConnected() {
|
|
1115
1161
|
this.loadStats();
|
|
@@ -1138,11 +1184,11 @@ class _o {
|
|
|
1138
1184
|
const o = await this.getProjectId(), r = t.name, s = t.type;
|
|
1139
1185
|
let i;
|
|
1140
1186
|
if (t.dataFunc && typeof window < "u") {
|
|
1141
|
-
const
|
|
1142
|
-
let
|
|
1143
|
-
for (const
|
|
1144
|
-
if (
|
|
1145
|
-
i =
|
|
1187
|
+
const v = t.dataFunc.replace(/^window\./, "").split(".");
|
|
1188
|
+
let y = window;
|
|
1189
|
+
for (const P of v)
|
|
1190
|
+
if (y = y == null ? void 0 : y[P], y === void 0) break;
|
|
1191
|
+
i = y;
|
|
1146
1192
|
}
|
|
1147
1193
|
let a, n;
|
|
1148
1194
|
if (i && typeof i == "function") {
|
|
@@ -1161,12 +1207,12 @@ class _o {
|
|
|
1161
1207
|
const u = t.dataEndpoint || re;
|
|
1162
1208
|
if (!r)
|
|
1163
1209
|
throw new Error("Name parameter is required");
|
|
1164
|
-
const
|
|
1210
|
+
const v = `${u}/${encodeURIComponent(o)}/${encodeURIComponent(r)}`;
|
|
1165
1211
|
b.debug(`Fetching stats for: ${r}`, { endpoint: u, projectKey: o });
|
|
1166
|
-
const
|
|
1167
|
-
if (!
|
|
1168
|
-
throw new Error(`API request failed with status: ${
|
|
1169
|
-
if (a = await
|
|
1212
|
+
const y = await fetch(v);
|
|
1213
|
+
if (!y.ok)
|
|
1214
|
+
throw new Error(`API request failed with status: ${y.status}`);
|
|
1215
|
+
if (a = await y.json(), !a.success)
|
|
1170
1216
|
throw b.error("Backend returned unsuccessful response", a), new Error("Backend returned unsuccessful response");
|
|
1171
1217
|
n = a.data || {};
|
|
1172
1218
|
}
|
|
@@ -1213,9 +1259,9 @@ class _o {
|
|
|
1213
1259
|
const t = await this.getLocalStatsKey();
|
|
1214
1260
|
try {
|
|
1215
1261
|
const o = yo(t);
|
|
1216
|
-
b.debug("Loaded localStats from localStorage", o), this.localStats = o;
|
|
1262
|
+
b.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
|
|
1217
1263
|
} catch (o) {
|
|
1218
|
-
b.warn("Failed to generate localStorage key for localStats", o), this.localStats =
|
|
1264
|
+
b.warn("Failed to generate localStorage key for localStats", o), this.localStats = E();
|
|
1219
1265
|
}
|
|
1220
1266
|
this.host.requestUpdate();
|
|
1221
1267
|
}
|
|
@@ -1256,14 +1302,14 @@ class _o {
|
|
|
1256
1302
|
this.stats = xo(this.stats, this.localStats), b.debug("Stats updated - remote: ", this.stats), b.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
|
|
1257
1303
|
}
|
|
1258
1304
|
async markStatsAsSubmitted() {
|
|
1259
|
-
this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), await this.persistLocalStats(), this.host.requestUpdate();
|
|
1305
|
+
this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), this.prevLocalStats = { ...this.localStats }, await this.persistLocalStats(), this.host.requestUpdate();
|
|
1260
1306
|
}
|
|
1261
1307
|
async submitStats() {
|
|
1262
1308
|
if (!this.hasLocalStats() && !this.hasInteracted)
|
|
1263
1309
|
throw b.warn("No local stats to submit"), new Error("No local stats to submit");
|
|
1264
|
-
const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await ie(), s = await this.getProjectId(), i = t.name || "", a = this.localStats.sum, n = Object.keys(this.localStats.breakdown || {});
|
|
1310
|
+
const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await ie(), s = await this.getProjectId(), i = t.name || "", a = this.localStats.sum, n = Object.keys(this.localStats.breakdown || {}), l = this.prevLocalStats.sum, p = Object.keys(this.prevLocalStats.breakdown || {});
|
|
1265
1311
|
this.isSubmitting = !0, this.host.requestUpdate();
|
|
1266
|
-
const
|
|
1312
|
+
const c = {
|
|
1267
1313
|
sessionId: r,
|
|
1268
1314
|
projectId: s,
|
|
1269
1315
|
widgetName: i,
|
|
@@ -1271,17 +1317,19 @@ class _o {
|
|
|
1271
1317
|
url: window.location.href,
|
|
1272
1318
|
numericValue: a,
|
|
1273
1319
|
textValues: n,
|
|
1320
|
+
prevNumericValue: l,
|
|
1321
|
+
prevTextValues: p,
|
|
1274
1322
|
metadata: t.metadata,
|
|
1275
1323
|
timestamp: o
|
|
1276
|
-
},
|
|
1324
|
+
}, u = ko(JSON.stringify(c), o);
|
|
1277
1325
|
try {
|
|
1278
|
-
await this.sendStats({ ...
|
|
1279
|
-
} catch (
|
|
1280
|
-
b.warn("Failed to send stats event",
|
|
1326
|
+
await this.sendStats({ ...c, hash: u }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(c);
|
|
1327
|
+
} catch (v) {
|
|
1328
|
+
b.warn("Failed to send stats event", v);
|
|
1281
1329
|
} finally {
|
|
1282
1330
|
this.isSubmitting = !1, this.host.requestUpdate();
|
|
1283
1331
|
}
|
|
1284
|
-
return
|
|
1332
|
+
return c;
|
|
1285
1333
|
}
|
|
1286
1334
|
async sendStats(t) {
|
|
1287
1335
|
const o = JSON.stringify(t), r = this.host, s = r.dataEndpoint || re;
|
|
@@ -1551,7 +1599,7 @@ let Ce = class {
|
|
|
1551
1599
|
* Copyright 2018 Google LLC
|
|
1552
1600
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1553
1601
|
*/
|
|
1554
|
-
const
|
|
1602
|
+
const w = Se(class extends Ce {
|
|
1555
1603
|
constructor(e) {
|
|
1556
1604
|
var t;
|
|
1557
1605
|
if (super(e), e.type !== xe.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.");
|
|
@@ -1584,7 +1632,7 @@ const st = {
|
|
|
1584
1632
|
mobile: "480px",
|
|
1585
1633
|
tablet: "768px",
|
|
1586
1634
|
desktop: "1024px"
|
|
1587
|
-
},
|
|
1635
|
+
}, Lt = class Lt extends U {
|
|
1588
1636
|
constructor() {
|
|
1589
1637
|
super(...arguments), this.dataController = new _o(this), this.displayController = new Eo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.lockAnswer = !1, this.ariaLabel = null, this.minContrast = ge.AA_NORMAL, this.options = [], this.project = "public", this.questionPosition = "top", this.statsText = "{count} votes", this.buttonText = "Submit", this.buttonRadius = "sm", this.multiple = !1, this.readOnly = !1, this.handleEditToggleKeyDown = (t) => {
|
|
1590
1638
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
|
|
@@ -1618,7 +1666,7 @@ const st = {
|
|
|
1618
1666
|
let o = `:host {
|
|
1619
1667
|
`;
|
|
1620
1668
|
if (this.primaryColor) {
|
|
1621
|
-
const i =
|
|
1669
|
+
const i = R(this.primaryColor);
|
|
1622
1670
|
o += `--pc-primary-color: ${i} !important;
|
|
1623
1671
|
`;
|
|
1624
1672
|
const a = no(i, {
|
|
@@ -1629,27 +1677,27 @@ const st = {
|
|
|
1629
1677
|
`;
|
|
1630
1678
|
}
|
|
1631
1679
|
if (this.muteColor) {
|
|
1632
|
-
const i =
|
|
1680
|
+
const i = R(this.muteColor);
|
|
1633
1681
|
o += `--pc-mute-color: ${i} !important;
|
|
1634
1682
|
`;
|
|
1635
1683
|
}
|
|
1636
1684
|
if (this.textColor) {
|
|
1637
|
-
const i =
|
|
1685
|
+
const i = R(this.textColor);
|
|
1638
1686
|
o += `--pc-text-color: ${i} !important;
|
|
1639
1687
|
`;
|
|
1640
1688
|
}
|
|
1641
1689
|
if (this.backgroundColor) {
|
|
1642
|
-
const i =
|
|
1690
|
+
const i = R(this.backgroundColor);
|
|
1643
1691
|
o += `--pc-background-color: ${i} !important;
|
|
1644
1692
|
`;
|
|
1645
1693
|
}
|
|
1646
1694
|
const r = this.starColor || this.accentColor || this.primaryColor;
|
|
1647
1695
|
if (r) {
|
|
1648
|
-
const i =
|
|
1696
|
+
const i = R(r);
|
|
1649
1697
|
o += `--pc-star-color: ${i} !important;
|
|
1650
1698
|
`;
|
|
1651
1699
|
}
|
|
1652
|
-
const s = this.starHoverColor || (r ? `color-mix(in srgb, ${
|
|
1700
|
+
const s = this.starHoverColor || (r ? `color-mix(in srgb, ${R(r)} 80%, white)` : null);
|
|
1653
1701
|
if (s && (o += `--pc-star-hover-color: ${s} !important;
|
|
1654
1702
|
`), this.starSize) {
|
|
1655
1703
|
const i = oe(this.starSize, "1rem", 1.5);
|
|
@@ -1721,16 +1769,16 @@ const st = {
|
|
|
1721
1769
|
*/
|
|
1722
1770
|
renderEditToggleIcon(t = "edit-toggle-button") {
|
|
1723
1771
|
return this.displayController.shouldShowEditButton() ? d`
|
|
1724
|
-
<
|
|
1725
|
-
src="${Ke}"
|
|
1726
|
-
alt="Edit vote"
|
|
1772
|
+
<span
|
|
1727
1773
|
class="edit-toggle-icon"
|
|
1728
1774
|
data-testid="${t}"
|
|
1729
1775
|
@click="${this.handleEnterEditMode}"
|
|
1730
1776
|
role="button"
|
|
1731
1777
|
tabindex="0"
|
|
1778
|
+
aria-label="Edit vote"
|
|
1732
1779
|
@keydown="${this.handleEditToggleKeyDown}"
|
|
1733
|
-
|
|
1780
|
+
>${Ke}</span
|
|
1781
|
+
>
|
|
1734
1782
|
` : h;
|
|
1735
1783
|
}
|
|
1736
1784
|
renderStatsText() {
|
|
@@ -1740,16 +1788,16 @@ const st = {
|
|
|
1740
1788
|
}
|
|
1741
1789
|
renderChartToggle() {
|
|
1742
1790
|
return this.displayController.shouldShowChartToggle() ? d`
|
|
1743
|
-
<
|
|
1744
|
-
src="${this.displayController.isChartVisible ? Ge : Ze}"
|
|
1745
|
-
alt="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
|
|
1791
|
+
<span
|
|
1746
1792
|
class="chart-toggle-icon"
|
|
1747
1793
|
data-testid="chart-toggle-button"
|
|
1748
1794
|
@click="${() => this.displayController.toggleChartVisibility()}"
|
|
1749
1795
|
role="button"
|
|
1750
1796
|
tabindex="0"
|
|
1797
|
+
aria-label="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
|
|
1751
1798
|
@keydown="${() => this.displayController.toggleChartVisibility()}"
|
|
1752
|
-
|
|
1799
|
+
>${this.displayController.isChartVisible ? Ge : Ze}</span
|
|
1800
|
+
>
|
|
1753
1801
|
` : h;
|
|
1754
1802
|
}
|
|
1755
1803
|
renderStatus() {
|
|
@@ -1759,7 +1807,7 @@ const st = {
|
|
|
1759
1807
|
"pc-status": !0,
|
|
1760
1808
|
[`pc-flex-content-${k(this.statsPosition, this.statsAlign)}`]: !0
|
|
1761
1809
|
};
|
|
1762
|
-
return d`<div class="${
|
|
1810
|
+
return d`<div class="${w(o)}" data-testid="pc-status">
|
|
1763
1811
|
${this.renderStatsText()} ${this.renderChartToggle()} ${this.renderEditToggleIcon()}
|
|
1764
1812
|
</div>`;
|
|
1765
1813
|
}
|
|
@@ -1781,21 +1829,21 @@ const st = {
|
|
|
1781
1829
|
<div class="pc-thank-you" data-testid="thank-you">
|
|
1782
1830
|
<div class="pc-thank-you-msg" data-testid="thank-you-msg">
|
|
1783
1831
|
${t}
|
|
1784
|
-
<
|
|
1785
|
-
src="${We}"
|
|
1786
|
-
alt="Close"
|
|
1832
|
+
<span
|
|
1787
1833
|
class="thank-you-close-icon"
|
|
1788
1834
|
data-testid="close-thank-you-button"
|
|
1789
1835
|
@click="${() => this.displayController.toggleThankYouVisibility(!1)}"
|
|
1790
1836
|
role="button"
|
|
1791
|
-
|
|
1837
|
+
aria-label="Close"
|
|
1838
|
+
>${We}</span
|
|
1839
|
+
>
|
|
1792
1840
|
</div>
|
|
1793
1841
|
</div>
|
|
1794
1842
|
</div>
|
|
1795
1843
|
`;
|
|
1796
1844
|
}
|
|
1797
1845
|
};
|
|
1798
|
-
|
|
1846
|
+
Lt.styles = [
|
|
1799
1847
|
F`
|
|
1800
1848
|
:host {
|
|
1801
1849
|
/* Default values for CSS variables - can be overridden by external :root or parent definitions */
|
|
@@ -1885,7 +1933,7 @@ Rt.styles = [
|
|
|
1885
1933
|
}
|
|
1886
1934
|
`
|
|
1887
1935
|
];
|
|
1888
|
-
let m =
|
|
1936
|
+
let m = Lt;
|
|
1889
1937
|
g([
|
|
1890
1938
|
f({ type: String, attribute: "show-stats" })
|
|
1891
1939
|
], m.prototype, "showStats");
|
|
@@ -2369,6 +2417,9 @@ const zo = F`
|
|
|
2369
2417
|
/* Inline chart toggle icon - shared between components */
|
|
2370
2418
|
.chart-toggle-icon,
|
|
2371
2419
|
.edit-toggle-icon {
|
|
2420
|
+
display: inline-flex;
|
|
2421
|
+
align-items: center;
|
|
2422
|
+
justify-content: center;
|
|
2372
2423
|
margin-left: 0.2em;
|
|
2373
2424
|
width: 1.2em;
|
|
2374
2425
|
height: 1.2em;
|
|
@@ -2376,6 +2427,13 @@ const zo = F`
|
|
|
2376
2427
|
cursor: pointer;
|
|
2377
2428
|
transition: opacity 0.2s ease;
|
|
2378
2429
|
vertical-align: middle;
|
|
2430
|
+
color: var(--pc-text-color, var(--default-text-color));
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
.chart-toggle-icon svg,
|
|
2434
|
+
.edit-toggle-icon svg {
|
|
2435
|
+
width: 100%;
|
|
2436
|
+
height: 100%;
|
|
2379
2437
|
}
|
|
2380
2438
|
|
|
2381
2439
|
.chart-toggle-icon:hover,
|
|
@@ -2576,6 +2634,9 @@ const zo = F`
|
|
|
2576
2634
|
}
|
|
2577
2635
|
|
|
2578
2636
|
.thank-you-close-icon {
|
|
2637
|
+
display: inline-flex;
|
|
2638
|
+
align-items: center;
|
|
2639
|
+
justify-content: center;
|
|
2579
2640
|
width: 1.2em;
|
|
2580
2641
|
height: 1.2em;
|
|
2581
2642
|
cursor: pointer;
|
|
@@ -2583,6 +2644,13 @@ const zo = F`
|
|
|
2583
2644
|
position: absolute;
|
|
2584
2645
|
top: 0.2em;
|
|
2585
2646
|
right: 0.2em;
|
|
2647
|
+
color: var(--pc-text-color, var(--default-text-color));
|
|
2648
|
+
opacity: 0.6;
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
.thank-you-close-icon svg {
|
|
2652
|
+
width: 100%;
|
|
2653
|
+
height: 100%;
|
|
2586
2654
|
}
|
|
2587
2655
|
|
|
2588
2656
|
.thank-you-close-icon:hover {
|
|
@@ -2673,7 +2741,7 @@ let I = class extends m {
|
|
|
2673
2741
|
<button
|
|
2674
2742
|
data-testid="nps-button-${s}"
|
|
2675
2743
|
?disabled=${!this.displayController.allowEdit()}
|
|
2676
|
-
class=${
|
|
2744
|
+
class=${w(a)}
|
|
2677
2745
|
@click="${() => this.handleNumberClick(s)}"
|
|
2678
2746
|
@mouseenter="${() => this.handleNumberHover(s)}"
|
|
2679
2747
|
@focus="${() => this.handleNumberHover(s)}"
|
|
@@ -2766,9 +2834,9 @@ let I = class extends m {
|
|
|
2766
2834
|
[`pc-flex-align-${k(this.statsPosition, this.statsAlign)}`]: !0
|
|
2767
2835
|
};
|
|
2768
2836
|
return d`
|
|
2769
|
-
<div class="pc-container ${
|
|
2837
|
+
<div class="pc-container ${w(e)}" data-testid="nps-container">
|
|
2770
2838
|
${this.renderLabelAtStart()}
|
|
2771
|
-
<div class="pc-body ${
|
|
2839
|
+
<div class="pc-body ${w(t)}" data-testid="nps-body">
|
|
2772
2840
|
${this.renderStatusAtStart()} ${this.renderContent()} ${this.renderStatusAtEnd()}
|
|
2773
2841
|
</div>
|
|
2774
2842
|
${this.renderLabelAtEnd()}
|
|
@@ -3052,10 +3120,10 @@ const Mo = F`
|
|
|
3052
3120
|
visibility: hidden;
|
|
3053
3121
|
}
|
|
3054
3122
|
`;
|
|
3055
|
-
var
|
|
3056
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3123
|
+
var Lo = Object.defineProperty, Ro = Object.getOwnPropertyDescriptor, Mt = (e, t, o, r) => {
|
|
3124
|
+
for (var s = r > 1 ? void 0 : r ? Ro(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3057
3125
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3058
|
-
return r && s &&
|
|
3126
|
+
return r && s && Lo(t, o, s), s;
|
|
3059
3127
|
};
|
|
3060
3128
|
let tt = class extends m {
|
|
3061
3129
|
constructor() {
|
|
@@ -3066,7 +3134,7 @@ let tt = class extends m {
|
|
|
3066
3134
|
"pc-status": !0,
|
|
3067
3135
|
[`pc-flex-content-${k("bottom", this.statsAlign)}`]: !0
|
|
3068
3136
|
};
|
|
3069
|
-
return d`<div class="${
|
|
3137
|
+
return d`<div class="${w(t)}" data-testid="pc-status">
|
|
3070
3138
|
<span>${this.renderStatsText()} ${this.renderEditToggleIcon("stats-edit-button")}</span>
|
|
3071
3139
|
</div>`;
|
|
3072
3140
|
}
|
|
@@ -3081,7 +3149,7 @@ let tt = class extends m {
|
|
|
3081
3149
|
}, t = this.displayController.shouldDisableSubmitButton();
|
|
3082
3150
|
return d`
|
|
3083
3151
|
<button
|
|
3084
|
-
class="${
|
|
3152
|
+
class="${w(e)}"
|
|
3085
3153
|
data-testid="pc-submit-button"
|
|
3086
3154
|
@click="${this.handleSubmit}"
|
|
3087
3155
|
?disabled="${t}"
|
|
@@ -3162,7 +3230,7 @@ let tt = class extends m {
|
|
|
3162
3230
|
return d`
|
|
3163
3231
|
<button
|
|
3164
3232
|
data-testid="poll-option-i${t}"
|
|
3165
|
-
class="${
|
|
3233
|
+
class="${w(s)}"
|
|
3166
3234
|
@click="${() => this.handleClick(e)}"
|
|
3167
3235
|
?disabled="${r}"
|
|
3168
3236
|
id="${a}-option-${t}"
|
|
@@ -3189,7 +3257,7 @@ let tt = class extends m {
|
|
|
3189
3257
|
});
|
|
3190
3258
|
return d`
|
|
3191
3259
|
<div
|
|
3192
|
-
class="${
|
|
3260
|
+
class="${w({
|
|
3193
3261
|
"poll-container": !0
|
|
3194
3262
|
})}"
|
|
3195
3263
|
data-testid="poll-option-container"
|
|
@@ -3206,13 +3274,13 @@ let tt = class extends m {
|
|
|
3206
3274
|
renderBarChart() {
|
|
3207
3275
|
var l, p;
|
|
3208
3276
|
const e = ((l = this.dataController.stats) == null ? void 0 : l.breakdown) || {}, t = ((p = this.dataController.localStats) == null ? void 0 : p.breakdown) || {}, o = Object.values(e).reduce((c, u) => c + u, 0), r = this.options.map((c, u) => {
|
|
3209
|
-
const
|
|
3277
|
+
const v = e[c.value] || 0, y = o > 0 ? Math.round(v / o * 100) : 0, P = (t[c.value] || 0) > 0;
|
|
3210
3278
|
return {
|
|
3211
3279
|
option: c,
|
|
3212
3280
|
index: u,
|
|
3213
|
-
voteCount:
|
|
3214
|
-
percentage:
|
|
3215
|
-
isSelected:
|
|
3281
|
+
voteCount: v,
|
|
3282
|
+
percentage: y,
|
|
3283
|
+
isSelected: P
|
|
3216
3284
|
};
|
|
3217
3285
|
}), s = this.multiple ? _.GROUP : _.RADIOGROUP, i = this.question || this.name || "Options", a = B({
|
|
3218
3286
|
role: s,
|
|
@@ -3220,7 +3288,7 @@ let tt = class extends m {
|
|
|
3220
3288
|
});
|
|
3221
3289
|
return d`
|
|
3222
3290
|
<div
|
|
3223
|
-
class="${
|
|
3291
|
+
class="${w({
|
|
3224
3292
|
"poll-container": !0
|
|
3225
3293
|
})}"
|
|
3226
3294
|
data-testid="poll-chart-container"
|
|
@@ -3236,7 +3304,7 @@ let tt = class extends m {
|
|
|
3236
3304
|
};
|
|
3237
3305
|
return d`
|
|
3238
3306
|
<div
|
|
3239
|
-
class="${
|
|
3307
|
+
class="${w(u)}"
|
|
3240
3308
|
data-testid="poll-chart-item-${c.index}"
|
|
3241
3309
|
role="listitem"
|
|
3242
3310
|
aria-label="${c.option.label}: ${c.percentage}% (${c.voteCount} votes)"
|
|
@@ -3307,12 +3375,12 @@ let tt = class extends m {
|
|
|
3307
3375
|
});
|
|
3308
3376
|
return d`
|
|
3309
3377
|
<div
|
|
3310
|
-
class="pc-container ${
|
|
3378
|
+
class="pc-container ${w(t)}"
|
|
3311
3379
|
data-testid="poll-container"
|
|
3312
3380
|
...=${s}
|
|
3313
3381
|
>
|
|
3314
3382
|
${this.renderLabelAtStart()}
|
|
3315
|
-
<div class="${
|
|
3383
|
+
<div class="${w(r)}" data-testid="poll-body">
|
|
3316
3384
|
${this.renderContent()} ${this.renderFooter()}
|
|
3317
3385
|
</div>
|
|
3318
3386
|
${this.renderLabelAtEnd()}
|
|
@@ -3330,7 +3398,7 @@ Mt([
|
|
|
3330
3398
|
tt = Mt([
|
|
3331
3399
|
ot("pc-poll")
|
|
3332
3400
|
], tt);
|
|
3333
|
-
const
|
|
3401
|
+
const jo = F`
|
|
3334
3402
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
3335
3403
|
|
|
3336
3404
|
.pc-section {
|
|
@@ -3423,7 +3491,7 @@ const Uo = F`
|
|
|
3423
3491
|
* Copyright 2018 Google LLC
|
|
3424
3492
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3425
3493
|
*/
|
|
3426
|
-
const ke = "important",
|
|
3494
|
+
const ke = "important", Uo = " !" + ke, Bo = Se(class extends Ce {
|
|
3427
3495
|
constructor(e) {
|
|
3428
3496
|
var t;
|
|
3429
3497
|
if (super(e), e.type !== xe.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.");
|
|
@@ -3442,7 +3510,7 @@ const ke = "important", jo = " !" + ke, Bo = Se(class extends Ce {
|
|
|
3442
3510
|
const s = t[r];
|
|
3443
3511
|
if (s != null) {
|
|
3444
3512
|
this.ft.add(r);
|
|
3445
|
-
const i = typeof s == "string" && s.endsWith(
|
|
3513
|
+
const i = typeof s == "string" && s.endsWith(Uo);
|
|
3446
3514
|
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? ke : "") : o[r] = s;
|
|
3447
3515
|
}
|
|
3448
3516
|
}
|
|
@@ -3653,7 +3721,7 @@ let V = class extends m {
|
|
|
3653
3721
|
<div class="pc-section" data-testid="pc-section">
|
|
3654
3722
|
<span
|
|
3655
3723
|
data-testid="stars-view-star-${n}"
|
|
3656
|
-
class=${
|
|
3724
|
+
class=${w(c)}
|
|
3657
3725
|
style=${Bo(u)}
|
|
3658
3726
|
role="${r ? "button" : "presentation"}"
|
|
3659
3727
|
tabindex="${r ? "0" : ""}"
|
|
@@ -3703,9 +3771,9 @@ let V = class extends m {
|
|
|
3703
3771
|
[`pc-flex-align-${o}`]: !0
|
|
3704
3772
|
};
|
|
3705
3773
|
return d`
|
|
3706
|
-
<div class="pc-container ${
|
|
3774
|
+
<div class="pc-container ${w(t)}" data-testid="pc-container">
|
|
3707
3775
|
${this.renderLabelAtStart()}
|
|
3708
|
-
<div class="${
|
|
3776
|
+
<div class="${w(r)}" data-testid="stars-body">
|
|
3709
3777
|
${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderStars()}
|
|
3710
3778
|
${this.renderStatusAtEnd()}
|
|
3711
3779
|
</div>
|
|
@@ -3714,7 +3782,7 @@ let V = class extends m {
|
|
|
3714
3782
|
`;
|
|
3715
3783
|
}
|
|
3716
3784
|
};
|
|
3717
|
-
V.styles = [...m.styles, ut,
|
|
3785
|
+
V.styles = [...m.styles, ut, jo];
|
|
3718
3786
|
ht([
|
|
3719
3787
|
f({ type: String })
|
|
3720
3788
|
], V.prototype, "icon", 2);
|
|
@@ -3945,7 +4013,7 @@ let q = class extends m {
|
|
|
3945
4013
|
this.displayController.allowEdit() && (this.displayController.toggleReactionPopoverVisibility(), e.stopPropagation());
|
|
3946
4014
|
}
|
|
3947
4015
|
handleReactionClick(e) {
|
|
3948
|
-
this.displayController.allowEdit() && (this.dataController.toggleValueSelected(e.value, this.multiple), this.displayController.toggleReactionPopoverVisibility(!1));
|
|
4016
|
+
this.displayController.allowEdit() && (this.dataController.toggleValueSelected(e.value, this.multiple), this.dataController.submitStats(), this.displayController.toggleReactionPopoverVisibility(!1));
|
|
3949
4017
|
}
|
|
3950
4018
|
/**
|
|
3951
4019
|
* Renders the icon for a reaction
|
|
@@ -3978,7 +4046,7 @@ let q = class extends m {
|
|
|
3978
4046
|
}, n = `${e.tooltip || e.value} reaction${o ? ", selected" : ""}${t ? `, ${r} votes` : ""}`;
|
|
3979
4047
|
return d`
|
|
3980
4048
|
<button
|
|
3981
|
-
class="${
|
|
4049
|
+
class="${w(a)}"
|
|
3982
4050
|
@click="${() => this.handleReactionClick(e)}"
|
|
3983
4051
|
?disabled="${s}"
|
|
3984
4052
|
aria-pressed="${o}"
|
|
@@ -4020,7 +4088,7 @@ let q = class extends m {
|
|
|
4020
4088
|
bottom: this.popupPosition === "bottom" || this.popupPosition === "auto" && !this.shouldShowPopoverOnTop()
|
|
4021
4089
|
};
|
|
4022
4090
|
return d`
|
|
4023
|
-
<div class="${
|
|
4091
|
+
<div class="${w(e)}" role="menu">
|
|
4024
4092
|
<div class="popover-content">
|
|
4025
4093
|
${this.options.map((t) => {
|
|
4026
4094
|
const o = this.displayController.shouldDisableOption(t);
|
|
@@ -4067,7 +4135,7 @@ let q = class extends m {
|
|
|
4067
4135
|
(o) => this.dataController.isValueSelected(o.value)
|
|
4068
4136
|
);
|
|
4069
4137
|
return d`
|
|
4070
|
-
<div class="${
|
|
4138
|
+
<div class="${w(e)}">
|
|
4071
4139
|
${this.renderTriggerButton()}
|
|
4072
4140
|
${t.length > 0 ? d`
|
|
4073
4141
|
<div class="reaction-list">
|
|
@@ -4081,7 +4149,7 @@ let q = class extends m {
|
|
|
4081
4149
|
`;
|
|
4082
4150
|
} else
|
|
4083
4151
|
return d`
|
|
4084
|
-
<div class="${
|
|
4152
|
+
<div class="${w(e)}">
|
|
4085
4153
|
<div class="reaction-list">
|
|
4086
4154
|
${this.options.map((t) => this.renderReactionButton(t, this.showCounts))}
|
|
4087
4155
|
</div>
|
|
@@ -4125,9 +4193,9 @@ let q = class extends m {
|
|
|
4125
4193
|
[`pc-flex-align-${o}`]: !0
|
|
4126
4194
|
};
|
|
4127
4195
|
return d`
|
|
4128
|
-
<div class="${
|
|
4196
|
+
<div class="${w(t)}" data-testid="reaction-container">
|
|
4129
4197
|
${this.renderLabelAtStart()}
|
|
4130
|
-
<div class="${
|
|
4198
|
+
<div class="${w(r)}" data-testid="reaction-body">
|
|
4131
4199
|
${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderReactions()}
|
|
4132
4200
|
${this.renderStatusAtEnd()}
|
|
4133
4201
|
</div>
|
|
@@ -4162,7 +4230,7 @@ var Go = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, mt = (e, t
|
|
|
4162
4230
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
4163
4231
|
return r && s && Go(t, o, s), s;
|
|
4164
4232
|
};
|
|
4165
|
-
let H = class extends
|
|
4233
|
+
let H = class extends U {
|
|
4166
4234
|
constructor() {
|
|
4167
4235
|
super(), this.options = "", this.parsedOptions = [], H.injectGlobalStyle();
|
|
4168
4236
|
}
|