pollcatch 2.1.2 → 2.1.3
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 +93 -87
package/package.json
CHANGED
package/pc.js
CHANGED
|
@@ -45,7 +45,7 @@ const ke = (e) => new ae(typeof e == "string" ? e : e + "", void 0, _t), F = (e,
|
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is: _e, defineProperty: Ee, getOwnPropertyDescriptor: Pe, getOwnPropertyNames: Oe, getOwnPropertySymbols: Te, getPrototypeOf: ze } = Object,
|
|
48
|
+
const { is: _e, defineProperty: Ee, getOwnPropertyDescriptor: Pe, getOwnPropertyNames: Oe, getOwnPropertySymbols: Te, getPrototypeOf: ze } = Object, T = globalThis, Ut = T.trustedTypes, Ie = Ut ? Ut.emptyScript : "", mt = T.reactiveElementPolyfillSupport, K = (e, t) => e, at = { toAttribute(e, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
e = e ? Ie : null;
|
|
@@ -74,7 +74,7 @@ const { is: _e, defineProperty: Ee, getOwnPropertyDescriptor: Pe, getOwnProperty
|
|
|
74
74
|
}
|
|
75
75
|
return o;
|
|
76
76
|
} }, Et = (e, t) => !_e(e, t), jt = { attribute: !0, type: String, converter: at, reflect: !1, hasChanged: Et };
|
|
77
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
77
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), T.litPropertyMetadata ?? (T.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
78
|
let U = class extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
@@ -273,15 +273,15 @@ let U = class extends HTMLElement {
|
|
|
273
273
|
firstUpdated(t) {
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
|
-
U.elementStyles = [], U.shadowRootOptions = { mode: "open" }, U[K("elementProperties")] = /* @__PURE__ */ new Map(), U[K("finalized")] = /* @__PURE__ */ new Map(), mt == null || mt({ ReactiveElement: U }), (
|
|
276
|
+
U.elementStyles = [], U.shadowRootOptions = { mode: "open" }, U[K("elementProperties")] = /* @__PURE__ */ new Map(), U[K("finalized")] = /* @__PURE__ */ new Map(), mt == null || mt({ ReactiveElement: U }), (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, Bt = nt ? nt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ne = "$lit$",
|
|
283
|
-
\f\r]`, Z = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Dt = /-->/g, Vt = />/g,
|
|
284
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), qt = /'/g, Ht = /"/g, ce = /^(?:script|style|textarea|title)$/i, Le = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), d = Le(1),
|
|
282
|
+
const W = globalThis, nt = W.trustedTypes, Bt = nt ? nt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ne = "$lit$", P = `lit$${Math.random().toFixed(9).slice(2)}$`, le = "?" + P, Ne = `<${le}>`, L = document, X = () => L.createComment(""), Q = (e) => e === null || typeof e != "object" && typeof e != "function", Pt = Array.isArray, Me = (e) => Pt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", bt = `[
|
|
283
|
+
\f\r]`, Z = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Dt = /-->/g, Vt = />/g, N = RegExp(`>|${bt}(?:([^\\s"'>=/]+)(${bt}*=${bt}*(?:[^
|
|
284
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), qt = /'/g, Ht = /"/g, ce = /^(?:script|style|textarea|title)$/i, Le = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), d = Le(1), z = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Ft = /* @__PURE__ */ new WeakMap(), M = L.createTreeWalker(L, 129);
|
|
285
285
|
function de(e, t) {
|
|
286
286
|
if (!Pt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
287
287
|
return Bt !== void 0 ? Bt.createHTML(t) : t;
|
|
@@ -292,9 +292,9 @@ const Re = (e, t) => {
|
|
|
292
292
|
for (let n = 0; n < o; n++) {
|
|
293
293
|
const l = e[n];
|
|
294
294
|
let p, c, h = -1, w = 0;
|
|
295
|
-
for (; w < l.length && (a.lastIndex = w, c = a.exec(l), c !== null); ) w = a.lastIndex, a === Z ? c[1] === "!--" ? a = Dt : c[1] !== void 0 ? a = Vt : c[2] !== void 0 ? (ce.test(c[2]) && (s = RegExp("</" + c[2], "g")), a =
|
|
296
|
-
const
|
|
297
|
-
i += a === Z ? l + Ne : h >= 0 ? (r.push(p), l.slice(0, h) + ne + l.slice(h) +
|
|
295
|
+
for (; w < l.length && (a.lastIndex = w, c = a.exec(l), c !== null); ) w = a.lastIndex, a === Z ? c[1] === "!--" ? a = Dt : c[1] !== void 0 ? a = Vt : c[2] !== void 0 ? (ce.test(c[2]) && (s = RegExp("</" + c[2], "g")), a = N) : c[3] !== void 0 && (a = N) : a === N ? c[0] === ">" ? (a = s ?? Z, h = -1) : c[1] === void 0 ? h = -2 : (h = a.lastIndex - c[2].length, p = c[1], a = c[3] === void 0 ? N : c[3] === '"' ? Ht : qt) : a === Ht || a === qt ? a = N : a === Dt || a === Vt ? a = Z : (a = N, s = void 0);
|
|
296
|
+
const v = a === N && e[n + 1].startsWith("/>") ? " " : "";
|
|
297
|
+
i += a === Z ? l + Ne : h >= 0 ? (r.push(p), l.slice(0, h) + ne + l.slice(h) + P + v) : l + P + (h === -2 ? n : v);
|
|
298
298
|
}
|
|
299
299
|
return [de(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
|
|
300
300
|
};
|
|
@@ -304,40 +304,40 @@ let kt = class pe {
|
|
|
304
304
|
this.parts = [];
|
|
305
305
|
let i = 0, a = 0;
|
|
306
306
|
const n = t.length - 1, l = this.parts, [p, c] = Re(t, o);
|
|
307
|
-
if (this.el = pe.createElement(p, r),
|
|
307
|
+
if (this.el = pe.createElement(p, r), M.currentNode = this.el.content, o === 2 || o === 3) {
|
|
308
308
|
const h = this.el.content.firstChild;
|
|
309
309
|
h.replaceWith(...h.childNodes);
|
|
310
310
|
}
|
|
311
|
-
for (; (s =
|
|
311
|
+
for (; (s = M.nextNode()) !== null && l.length < n; ) {
|
|
312
312
|
if (s.nodeType === 1) {
|
|
313
313
|
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(ne)) {
|
|
314
|
-
const w = c[a++],
|
|
315
|
-
l.push({ type: 1, index: i, name:
|
|
316
|
-
} else h.startsWith(
|
|
314
|
+
const w = c[a++], v = s.getAttribute(h).split(P), E = /([.?@])?(.*)/.exec(w);
|
|
315
|
+
l.push({ type: 1, index: i, name: E[2], strings: v, ctor: E[1] === "." ? je : E[1] === "?" ? Be : E[1] === "@" ? De : ct }), s.removeAttribute(h);
|
|
316
|
+
} else h.startsWith(P) && (l.push({ type: 6, index: i }), s.removeAttribute(h));
|
|
317
317
|
if (ce.test(s.tagName)) {
|
|
318
|
-
const h = s.textContent.split(
|
|
318
|
+
const h = s.textContent.split(P), w = h.length - 1;
|
|
319
319
|
if (w > 0) {
|
|
320
320
|
s.textContent = nt ? nt.emptyScript : "";
|
|
321
|
-
for (let
|
|
321
|
+
for (let v = 0; v < w; v++) s.append(h[v], X()), M.nextNode(), l.push({ type: 2, index: ++i });
|
|
322
322
|
s.append(h[w], X());
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
} else if (s.nodeType === 8) if (s.data === le) l.push({ type: 2, index: i });
|
|
326
326
|
else {
|
|
327
327
|
let h = -1;
|
|
328
|
-
for (; (h = s.data.indexOf(
|
|
328
|
+
for (; (h = s.data.indexOf(P, h + 1)) !== -1; ) l.push({ type: 7, index: i }), h += P.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
|
};
|
|
338
338
|
function D(e, t, o = e, r) {
|
|
339
339
|
var a, n;
|
|
340
|
-
if (t ===
|
|
340
|
+
if (t === z) return t;
|
|
341
341
|
let s = r !== void 0 ? (a = o._$Co) == null ? void 0 : a[r] : o._$Cl;
|
|
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;
|
|
@@ -353,17 +353,17 @@ let Ue = 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) ??
|
|
357
|
-
|
|
358
|
-
let i =
|
|
356
|
+
const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? L).importNode(o, !0);
|
|
357
|
+
M.currentNode = s;
|
|
358
|
+
let i = M.nextNode(), a = 0, n = 0, l = r[0];
|
|
359
359
|
for (; l !== void 0; ) {
|
|
360
360
|
if (a === l.index) {
|
|
361
361
|
let p;
|
|
362
362
|
l.type === 2 ? p = new et(i, i.nextSibling, this, t) : l.type === 1 ? p = new l.ctor(i, l.name, l.strings, this, t) : l.type === 6 && (p = new Ve(i, this, t)), this._$AV.push(p), l = r[++n];
|
|
363
363
|
}
|
|
364
|
-
a !== (l == null ? void 0 : l.index) && (i =
|
|
364
|
+
a !== (l == null ? void 0 : l.index) && (i = M.nextNode(), a++);
|
|
365
365
|
}
|
|
366
|
-
return
|
|
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 === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !==
|
|
393
|
+
t = D(this, t, o), Q(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== z && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Me(t) ? this.k(t) : this._(t);
|
|
394
394
|
}
|
|
395
395
|
O(t) {
|
|
396
396
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -399,7 +399,7 @@ class et {
|
|
|
399
399
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
400
400
|
}
|
|
401
401
|
_(t) {
|
|
402
|
-
this._$AH !== u && Q(this._$AH) ? this._$AA.nextSibling.data = t : this.T(
|
|
402
|
+
this._$AH !== u && 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;
|
|
@@ -446,11 +446,11 @@ class ct {
|
|
|
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 = D(this, t, o, 0), a = !Q(t) || t !== this._$AH && t !==
|
|
449
|
+
if (i === void 0) t = D(this, t, o, 0), a = !Q(t) || t !== this._$AH && t !== z, a && (this._$AH = t);
|
|
450
450
|
else {
|
|
451
451
|
const n = t;
|
|
452
452
|
let l, p;
|
|
453
|
-
for (t = i[0], l = 0; l < i.length - 1; l++) p = D(this, n[r + l], o, l), p ===
|
|
453
|
+
for (t = i[0], l = 0; l < i.length - 1; l++) p = D(this, n[r + l], o, l), p === z && (p = this._$AH[l]), a || (a = !Q(p) || p !== this._$AH[l]), p === u ? t = u : t !== u && (t += (p ?? "") + i[l + 1]), this._$AH[l] = p;
|
|
454
454
|
}
|
|
455
455
|
a && !s && this.j(t);
|
|
456
456
|
}
|
|
@@ -479,7 +479,7 @@ class De extends ct {
|
|
|
479
479
|
super(t, o, r, s, i), this.type = 5;
|
|
480
480
|
}
|
|
481
481
|
_$AI(t, o = this) {
|
|
482
|
-
if ((t = D(this, t, o, 0) ?? u) ===
|
|
482
|
+
if ((t = D(this, t, o, 0) ?? u) === z) 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
|
}
|
|
@@ -537,7 +537,7 @@ let j = class extends U {
|
|
|
537
537
|
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
|
538
538
|
}
|
|
539
539
|
render() {
|
|
540
|
-
return
|
|
540
|
+
return z;
|
|
541
541
|
}
|
|
542
542
|
};
|
|
543
543
|
var ie;
|
|
@@ -599,7 +599,7 @@ var x = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.p
|
|
|
599
599
|
const Ye = "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='M640-160v-280h160v280H640Zm-240%200v-640h160v640H400Zm-240%200v-440h160v440H160Z'/%3e%3c/svg%3e", Ze = "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='M160-160v-440h160v440H160Zm240%200v-400l160%20160v240H400Zm160-354L400-674v-126h160v286Zm240%20240L640-434v-6h160v166Zm-9%20219L55-791l57-57%20736%20736-57%2057Z'/%3e%3c/svg%3e", Ge = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%20-960%20960%20960'%20width='24px'%20fill='currentColor'%3e%3cpath%20d='M200-200h57l391-391-57-57-391%20391v57Zm-80%2080v-170l528-527q12-11%2026.5-17t30.5-6q16%200%2031%206t26%2018l55%2056q12%2011%2017.5%2026t5.5%2030q0%2016-5.5%2030.5T817-647L290-120H120Zm640-584-56-56%2056%2056Zm-141%2085-28-29%2057%2057-29-28Z'/%3e%3c/svg%3e", Ke = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20fill='%23666666'%20class='bi%20bi-x'%20viewBox='0%200%2016%2016'%3e%3cpath%20d='M4.646%204.646a.5.5%200%200%201%20.708%200L8%207.293l2.646-2.647a.5.5%200%200%201%20.708.708L8.707%208l2.647%202.646a.5.5%200%200%201-.708.708L8%208.707l-2.646%202.647a.5.5%200%200%201-.708-.708L7.293%208%204.646%205.354a.5.5%200%200%201%200-.708'/%3e%3c/svg%3e";
|
|
600
600
|
var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
|
|
601
601
|
return typeof e == "string" ? e.length > 0 : typeof e == "number";
|
|
602
|
-
},
|
|
602
|
+
}, $ = function(e, t, o) {
|
|
603
603
|
return t === void 0 && (t = 0), o === void 0 && (o = Math.pow(10, t)), Math.round(o * e) / o + 0;
|
|
604
604
|
}, S = function(e, t, o) {
|
|
605
605
|
return t === void 0 && (t = 0), o === void 0 && (o = 1), e > o ? o : e > t ? e : t;
|
|
@@ -608,7 +608,7 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
|
|
|
608
608
|
}, Yt = function(e) {
|
|
609
609
|
return { r: S(e.r, 0, 255), g: S(e.g, 0, 255), b: S(e.b, 0, 255), a: S(e.a) };
|
|
610
610
|
}, yt = function(e) {
|
|
611
|
-
return { r:
|
|
611
|
+
return { r: $(e.r), g: $(e.g), b: $(e.b), a: $(e.a, 3) };
|
|
612
612
|
}, Je = /^#([0-9a-f]{3,8})$/i, rt = function(e) {
|
|
613
613
|
var t = e.toString(16);
|
|
614
614
|
return t.length < 2 ? "0" + t : t;
|
|
@@ -623,7 +623,7 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
|
|
|
623
623
|
}, Zt = function(e) {
|
|
624
624
|
return { h: ue(e.h), s: S(e.s, 0, 100), l: S(e.l, 0, 100), a: S(e.a) };
|
|
625
625
|
}, Gt = function(e) {
|
|
626
|
-
return { h:
|
|
626
|
+
return { h: $(e.h), s: $(e.s), l: $(e.l), a: $(e.a, 3) };
|
|
627
627
|
}, Kt = function(e) {
|
|
628
628
|
return fe((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 }));
|
|
629
629
|
var t, o, r;
|
|
@@ -632,7 +632,7 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
|
|
|
632
632
|
var t, o, r, s;
|
|
633
633
|
}, Xe = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Qe = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, to = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, eo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Wt = { string: [[function(e) {
|
|
634
634
|
var t = Je.exec(e);
|
|
635
|
-
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 ?
|
|
635
|
+
return t ? (e = t[1]).length <= 4 ? { r: parseInt(e[0] + e[0], 16), g: parseInt(e[1] + e[1], 16), b: parseInt(e[2] + e[2], 16), a: e.length === 4 ? $(parseInt(e[3] + e[3], 16) / 255, 2) : 1 } : e.length === 6 || e.length === 8 ? { r: parseInt(e.substr(0, 2), 16), g: parseInt(e.substr(2, 2), 16), b: parseInt(e.substr(4, 2), 16), a: e.length === 8 ? $(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
|
|
636
636
|
}, "hex"], [function(e) {
|
|
637
637
|
var t = to.exec(e) || eo.exec(e);
|
|
638
638
|
return t ? t[2] !== t[4] || t[4] !== t[6] ? null : Yt({ 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;
|
|
@@ -679,13 +679,13 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
|
|
|
679
679
|
return e.prototype.isValid = function() {
|
|
680
680
|
return this.parsed !== null;
|
|
681
681
|
}, e.prototype.brightness = function() {
|
|
682
|
-
return
|
|
682
|
+
return $($t(this.rgba), 2);
|
|
683
683
|
}, e.prototype.isDark = function() {
|
|
684
684
|
return $t(this.rgba) < 0.5;
|
|
685
685
|
}, e.prototype.isLight = function() {
|
|
686
686
|
return $t(this.rgba) >= 0.5;
|
|
687
687
|
}, e.prototype.toHex = function() {
|
|
688
|
-
return t = yt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? rt(
|
|
688
|
+
return t = yt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? rt($(255 * i)) : "", "#" + rt(o) + rt(r) + rt(s) + a;
|
|
689
689
|
var t, o, r, s, i, a;
|
|
690
690
|
}, e.prototype.toRgb = function() {
|
|
691
691
|
return yt(this.rgba);
|
|
@@ -698,7 +698,7 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
|
|
|
698
698
|
return t = Gt(J(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
|
|
699
699
|
var t, o, r, s, i;
|
|
700
700
|
}, e.prototype.toHsv = function() {
|
|
701
|
-
return t = he(this.rgba), { h:
|
|
701
|
+
return t = he(this.rgba), { h: $(t.h), s: $(t.s), v: $(t.v), a: $(t.a, 3) };
|
|
702
702
|
var t;
|
|
703
703
|
}, e.prototype.invert = function() {
|
|
704
704
|
return C({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
|
|
@@ -716,11 +716,11 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
|
|
|
716
716
|
}, e.prototype.rotate = function(t) {
|
|
717
717
|
return t === void 0 && (t = 15), this.hue(this.hue() + t);
|
|
718
718
|
}, e.prototype.alpha = function(t) {
|
|
719
|
-
return typeof t == "number" ? C({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) :
|
|
719
|
+
return typeof t == "number" ? C({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : $(this.rgba.a, 3);
|
|
720
720
|
var o;
|
|
721
721
|
}, e.prototype.hue = function(t) {
|
|
722
722
|
var o = J(this.rgba);
|
|
723
|
-
return typeof t == "number" ? C({ h: t, s: o.s, l: o.l, a: o.a }) :
|
|
723
|
+
return typeof t == "number" ? C({ h: t, s: o.s, l: o.l, a: o.a }) : $(o.h);
|
|
724
724
|
}, e.prototype.isEqual = function(t) {
|
|
725
725
|
return this.toHex() === C(t).toHex();
|
|
726
726
|
}, e;
|
|
@@ -986,7 +986,7 @@ function lt(e) {
|
|
|
986
986
|
const s = t / r * 100, i = o / r * 100;
|
|
987
987
|
return Math.round(s - i);
|
|
988
988
|
}
|
|
989
|
-
function
|
|
989
|
+
function O() {
|
|
990
990
|
return {
|
|
991
991
|
count: 0,
|
|
992
992
|
sum: 0,
|
|
@@ -998,12 +998,12 @@ function P() {
|
|
|
998
998
|
}
|
|
999
999
|
function vo(e) {
|
|
1000
1000
|
if (!Tt())
|
|
1001
|
-
return
|
|
1001
|
+
return O();
|
|
1002
1002
|
try {
|
|
1003
1003
|
const t = be(e);
|
|
1004
|
-
return t ? { ...
|
|
1004
|
+
return t ? { ...O(), ...t } : O();
|
|
1005
1005
|
} catch (t) {
|
|
1006
|
-
return b.warn("Failed to load localStats from localStorage", t),
|
|
1006
|
+
return b.warn("Failed to load localStats from localStorage", t), O();
|
|
1007
1007
|
}
|
|
1008
1008
|
}
|
|
1009
1009
|
function yo(e, t) {
|
|
@@ -1032,7 +1032,7 @@ function wo(e, t) {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
function $o(e, t) {
|
|
1034
1034
|
if (!e.count && !t.count)
|
|
1035
|
-
return
|
|
1035
|
+
return O();
|
|
1036
1036
|
if (!e.count)
|
|
1037
1037
|
return { ...t };
|
|
1038
1038
|
const o = {
|
|
@@ -1100,7 +1100,7 @@ function ko(e, t = 50) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
class Ao {
|
|
1102
1102
|
constructor(t) {
|
|
1103
|
-
this.stats =
|
|
1103
|
+
this.stats = O(), this.localStats = O(), this.isLoading = !0, this.isSubmitting = !1, (this.host = t).addController(this);
|
|
1104
1104
|
}
|
|
1105
1105
|
hostConnected() {
|
|
1106
1106
|
this.loadStats();
|
|
@@ -1130,7 +1130,13 @@ class Ao {
|
|
|
1130
1130
|
if (!r)
|
|
1131
1131
|
throw new Error("Name parameter is required");
|
|
1132
1132
|
let i;
|
|
1133
|
-
t.dataFunc && typeof window < "u"
|
|
1133
|
+
if (t.dataFunc && typeof window < "u") {
|
|
1134
|
+
const w = t.dataFunc.replace(/^window\./, "").split(".");
|
|
1135
|
+
let v = window;
|
|
1136
|
+
for (const E of w)
|
|
1137
|
+
if (v = v == null ? void 0 : v[E], v === void 0) break;
|
|
1138
|
+
i = v;
|
|
1139
|
+
}
|
|
1134
1140
|
let a;
|
|
1135
1141
|
if (i && typeof i == "function")
|
|
1136
1142
|
b.debug(`Using data function for: ${r}`, {
|
|
@@ -1140,10 +1146,10 @@ class Ao {
|
|
|
1140
1146
|
else {
|
|
1141
1147
|
const h = t.dataEndpoint || ee, w = `${h}/${encodeURIComponent(o)}/${encodeURIComponent(r)}`;
|
|
1142
1148
|
b.debug(`Fetching stats for: ${r}`, { endpoint: h, projectKey: o });
|
|
1143
|
-
const
|
|
1144
|
-
if (
|
|
1145
|
-
throw new Error(`API request failed with status: ${
|
|
1146
|
-
a = await
|
|
1149
|
+
const v = await fetch(w);
|
|
1150
|
+
if (!v.ok)
|
|
1151
|
+
throw new Error(`API request failed with status: ${v.status}`);
|
|
1152
|
+
a = await v.json();
|
|
1147
1153
|
}
|
|
1148
1154
|
if (!a.success)
|
|
1149
1155
|
throw b.error("Backend returned unsuccessful response", a), new Error("Backend returned unsuccessful response");
|
|
@@ -1172,7 +1178,7 @@ class Ao {
|
|
|
1172
1178
|
const o = vo(t);
|
|
1173
1179
|
b.debug("Loaded localStats from localStorage", o), this.localStats = o;
|
|
1174
1180
|
} catch (o) {
|
|
1175
|
-
b.warn("Failed to generate localStorage key for localStats", o), this.localStats =
|
|
1181
|
+
b.warn("Failed to generate localStorage key for localStats", o), this.localStats = O();
|
|
1176
1182
|
}
|
|
1177
1183
|
this.host.requestUpdate();
|
|
1178
1184
|
}
|
|
@@ -1510,7 +1516,7 @@ let xe = class {
|
|
|
1510
1516
|
* Copyright 2018 Google LLC
|
|
1511
1517
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1512
1518
|
*/
|
|
1513
|
-
const
|
|
1519
|
+
const y = $e(class extends xe {
|
|
1514
1520
|
constructor(e) {
|
|
1515
1521
|
var t;
|
|
1516
1522
|
if (super(e), e.type !== we.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.");
|
|
@@ -1531,7 +1537,7 @@ const v = $e(class extends xe {
|
|
|
1531
1537
|
const a = !!t[i];
|
|
1532
1538
|
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)));
|
|
1533
1539
|
}
|
|
1534
|
-
return
|
|
1540
|
+
return z;
|
|
1535
1541
|
}
|
|
1536
1542
|
});
|
|
1537
1543
|
var Oo = Object.defineProperty, g = (e, t, o, r) => {
|
|
@@ -1713,7 +1719,7 @@ const st = {
|
|
|
1713
1719
|
"pc-status": !0,
|
|
1714
1720
|
[`pc-flex-content-${k(this.statsPosition, this.statsAlign)}`]: !0
|
|
1715
1721
|
};
|
|
1716
|
-
return d`<div class="${
|
|
1722
|
+
return d`<div class="${y(o)}" data-testid="pc-status">
|
|
1717
1723
|
${this.renderStatsText()} ${this.renderChartToggle()} ${this.renderEditToggleIcon()}
|
|
1718
1724
|
</div>`;
|
|
1719
1725
|
}
|
|
@@ -2599,7 +2605,7 @@ var zo = Object.defineProperty, Io = Object.getOwnPropertyDescriptor, Y = (e, t,
|
|
|
2599
2605
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
2600
2606
|
return r && s && zo(t, o, s), s;
|
|
2601
2607
|
};
|
|
2602
|
-
let
|
|
2608
|
+
let I = class extends m {
|
|
2603
2609
|
constructor() {
|
|
2604
2610
|
super(), this.min = 0, this.max = 10, this.type = x.nps, this.minLabel = "Not at all", this.maxLabel = "Extremely", this.minMaxPosition = "top", this.hoverValue = -1, this.handleNumberLeave = () => {
|
|
2605
2611
|
this.hoverValue = -1;
|
|
@@ -2624,7 +2630,7 @@ let z = class extends m {
|
|
|
2624
2630
|
<button
|
|
2625
2631
|
data-testid="nps-button-${s}"
|
|
2626
2632
|
?disabled=${!this.displayController.allowEdit()}
|
|
2627
|
-
class=${
|
|
2633
|
+
class=${y(a)}
|
|
2628
2634
|
@click="${() => this.handleNumberClick(s)}"
|
|
2629
2635
|
@mouseenter="${() => this.handleNumberHover(s)}"
|
|
2630
2636
|
@focus="${() => this.handleNumberHover(s)}"
|
|
@@ -2717,9 +2723,9 @@ let z = class extends m {
|
|
|
2717
2723
|
[`pc-flex-align-${k(this.statsPosition, this.statsAlign)}`]: !0
|
|
2718
2724
|
};
|
|
2719
2725
|
return d`
|
|
2720
|
-
<div class="pc-container ${
|
|
2726
|
+
<div class="pc-container ${y(e)}" data-testid="nps-container">
|
|
2721
2727
|
${this.renderLabelAtStart()}
|
|
2722
|
-
<div class="pc-body ${
|
|
2728
|
+
<div class="pc-body ${y(t)}" data-testid="nps-body">
|
|
2723
2729
|
${this.renderStatusAtStart()} ${this.renderContent()} ${this.renderStatusAtEnd()}
|
|
2724
2730
|
</div>
|
|
2725
2731
|
${this.renderLabelAtEnd()}
|
|
@@ -2727,25 +2733,25 @@ let z = class extends m {
|
|
|
2727
2733
|
`;
|
|
2728
2734
|
}
|
|
2729
2735
|
};
|
|
2730
|
-
|
|
2736
|
+
I.styles = [...m.styles, pt, To];
|
|
2731
2737
|
Y([
|
|
2732
2738
|
f({ type: String, attribute: "min-label" })
|
|
2733
|
-
],
|
|
2739
|
+
], I.prototype, "minLabel", 2);
|
|
2734
2740
|
Y([
|
|
2735
2741
|
f({ type: String, attribute: "max-label" })
|
|
2736
|
-
],
|
|
2742
|
+
], I.prototype, "maxLabel", 2);
|
|
2737
2743
|
Y([
|
|
2738
2744
|
f({ type: String, attribute: "thank-you-msg" })
|
|
2739
|
-
],
|
|
2745
|
+
], I.prototype, "thankYouMsg", 2);
|
|
2740
2746
|
Y([
|
|
2741
2747
|
f({ type: String, attribute: "min-max-position" })
|
|
2742
|
-
],
|
|
2748
|
+
], I.prototype, "minMaxPosition", 2);
|
|
2743
2749
|
Y([
|
|
2744
2750
|
Ot()
|
|
2745
|
-
],
|
|
2746
|
-
|
|
2751
|
+
], I.prototype, "hoverValue", 2);
|
|
2752
|
+
I = Y([
|
|
2747
2753
|
ot("pc-nps")
|
|
2748
|
-
],
|
|
2754
|
+
], I);
|
|
2749
2755
|
const No = F`
|
|
2750
2756
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
2751
2757
|
|
|
@@ -3017,7 +3023,7 @@ let tt = class extends m {
|
|
|
3017
3023
|
"pc-status": !0,
|
|
3018
3024
|
[`pc-flex-content-${k("bottom", this.statsAlign)}`]: !0
|
|
3019
3025
|
};
|
|
3020
|
-
return d`<div class="${
|
|
3026
|
+
return d`<div class="${y(t)}" data-testid="pc-status">
|
|
3021
3027
|
<span>${this.renderStatsText()} ${this.renderEditToggleIcon("stats-edit-button")}</span>
|
|
3022
3028
|
</div>`;
|
|
3023
3029
|
}
|
|
@@ -3032,7 +3038,7 @@ let tt = class extends m {
|
|
|
3032
3038
|
}, t = this.displayController.shouldDisableSubmitButton();
|
|
3033
3039
|
return d`
|
|
3034
3040
|
<button
|
|
3035
|
-
class="${
|
|
3041
|
+
class="${y(e)}"
|
|
3036
3042
|
data-testid="pc-submit-button"
|
|
3037
3043
|
@click="${this.handleSubmit}"
|
|
3038
3044
|
?disabled="${t}"
|
|
@@ -3113,7 +3119,7 @@ let tt = class extends m {
|
|
|
3113
3119
|
return d`
|
|
3114
3120
|
<button
|
|
3115
3121
|
data-testid="poll-option-i${t}"
|
|
3116
|
-
class="${
|
|
3122
|
+
class="${y(s)}"
|
|
3117
3123
|
@click="${() => this.handleClick(e)}"
|
|
3118
3124
|
?disabled="${r}"
|
|
3119
3125
|
id="${a}-option-${t}"
|
|
@@ -3140,7 +3146,7 @@ let tt = class extends m {
|
|
|
3140
3146
|
});
|
|
3141
3147
|
return d`
|
|
3142
3148
|
<div
|
|
3143
|
-
class="${
|
|
3149
|
+
class="${y({
|
|
3144
3150
|
"poll-container": !0
|
|
3145
3151
|
})}"
|
|
3146
3152
|
data-testid="poll-option-container"
|
|
@@ -3157,13 +3163,13 @@ let tt = class extends m {
|
|
|
3157
3163
|
renderBarChart() {
|
|
3158
3164
|
var l, p;
|
|
3159
3165
|
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, h) => c + h, 0), r = this.options.map((c, h) => {
|
|
3160
|
-
const w = e[c.value] || 0,
|
|
3166
|
+
const w = e[c.value] || 0, v = o > 0 ? Math.round(w / o * 100) : 0, E = (t[c.value] || 0) > 0;
|
|
3161
3167
|
return {
|
|
3162
3168
|
option: c,
|
|
3163
3169
|
index: h,
|
|
3164
3170
|
voteCount: w,
|
|
3165
|
-
percentage:
|
|
3166
|
-
isSelected:
|
|
3171
|
+
percentage: v,
|
|
3172
|
+
isSelected: E
|
|
3167
3173
|
};
|
|
3168
3174
|
}), s = this.multiple ? _.GROUP : _.RADIOGROUP, i = this.question || this.name || "Options", a = B({
|
|
3169
3175
|
role: s,
|
|
@@ -3171,7 +3177,7 @@ let tt = class extends m {
|
|
|
3171
3177
|
});
|
|
3172
3178
|
return d`
|
|
3173
3179
|
<div
|
|
3174
|
-
class="${
|
|
3180
|
+
class="${y({
|
|
3175
3181
|
"poll-container": !0
|
|
3176
3182
|
})}"
|
|
3177
3183
|
data-testid="poll-chart-container"
|
|
@@ -3187,7 +3193,7 @@ let tt = class extends m {
|
|
|
3187
3193
|
};
|
|
3188
3194
|
return d`
|
|
3189
3195
|
<div
|
|
3190
|
-
class="${
|
|
3196
|
+
class="${y(h)}"
|
|
3191
3197
|
data-testid="poll-chart-item-${c.index}"
|
|
3192
3198
|
role="listitem"
|
|
3193
3199
|
aria-label="${c.option.label}: ${c.percentage}% (${c.voteCount} votes)"
|
|
@@ -3258,12 +3264,12 @@ let tt = class extends m {
|
|
|
3258
3264
|
});
|
|
3259
3265
|
return d`
|
|
3260
3266
|
<div
|
|
3261
|
-
class="pc-container ${
|
|
3267
|
+
class="pc-container ${y(t)}"
|
|
3262
3268
|
data-testid="poll-container"
|
|
3263
3269
|
...=${s}
|
|
3264
3270
|
>
|
|
3265
3271
|
${this.renderLabelAtStart()}
|
|
3266
|
-
<div class="${
|
|
3272
|
+
<div class="${y(r)}" data-testid="poll-body">
|
|
3267
3273
|
${this.renderContent()} ${this.renderFooter()}
|
|
3268
3274
|
</div>
|
|
3269
3275
|
${this.renderLabelAtEnd()}
|
|
@@ -3386,7 +3392,7 @@ const Se = "important", Uo = " !" + Se, jo = $e(class extends xe {
|
|
|
3386
3392
|
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? Se : "") : o[r] = s;
|
|
3387
3393
|
}
|
|
3388
3394
|
}
|
|
3389
|
-
return
|
|
3395
|
+
return z;
|
|
3390
3396
|
}
|
|
3391
3397
|
});
|
|
3392
3398
|
var Bo = Object.defineProperty, Do = Object.getOwnPropertyDescriptor, ut = (e, t, o, r) => {
|
|
@@ -3430,7 +3436,7 @@ let V = class extends m {
|
|
|
3430
3436
|
<div class="pc-section" data-testid="pc-section">
|
|
3431
3437
|
<span
|
|
3432
3438
|
data-testid="stars-view-star-${n}"
|
|
3433
|
-
class=${
|
|
3439
|
+
class=${y(c)}
|
|
3434
3440
|
style=${jo(h)}
|
|
3435
3441
|
role="${r ? "button" : "presentation"}"
|
|
3436
3442
|
tabindex="${r ? "0" : ""}"
|
|
@@ -3480,9 +3486,9 @@ let V = class extends m {
|
|
|
3480
3486
|
[`pc-flex-align-${o}`]: !0
|
|
3481
3487
|
};
|
|
3482
3488
|
return d`
|
|
3483
|
-
<div class="pc-container ${
|
|
3489
|
+
<div class="pc-container ${y(t)}" data-testid="pc-container">
|
|
3484
3490
|
${this.renderLabelAtStart()}
|
|
3485
|
-
<div class="${
|
|
3491
|
+
<div class="${y(r)}" data-testid="stars-body">
|
|
3486
3492
|
${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderStars()}
|
|
3487
3493
|
${this.renderStatusAtEnd()}
|
|
3488
3494
|
</div>
|
|
@@ -3905,7 +3911,7 @@ let q = class extends m {
|
|
|
3905
3911
|
}, n = `${e.tooltip || e.value} reaction${o ? ", selected" : ""}${t ? `, ${r} votes` : ""}`;
|
|
3906
3912
|
return d`
|
|
3907
3913
|
<button
|
|
3908
|
-
class="${
|
|
3914
|
+
class="${y(a)}"
|
|
3909
3915
|
@click="${() => this.handleReactionClick(e)}"
|
|
3910
3916
|
?disabled="${s}"
|
|
3911
3917
|
aria-pressed="${o}"
|
|
@@ -3947,7 +3953,7 @@ let q = class extends m {
|
|
|
3947
3953
|
bottom: this.popupPosition === "bottom" || this.popupPosition === "auto" && !this.shouldShowPopoverOnTop()
|
|
3948
3954
|
};
|
|
3949
3955
|
return d`
|
|
3950
|
-
<div class="${
|
|
3956
|
+
<div class="${y(e)}" role="menu">
|
|
3951
3957
|
<div class="popover-content">
|
|
3952
3958
|
${this.options.map((t) => {
|
|
3953
3959
|
const o = this.displayController.shouldDisableOption(t);
|
|
@@ -3994,7 +4000,7 @@ let q = class extends m {
|
|
|
3994
4000
|
(o) => this.getReactionCount(o.value) > 0
|
|
3995
4001
|
);
|
|
3996
4002
|
return d`
|
|
3997
|
-
<div class="${
|
|
4003
|
+
<div class="${y(e)}">
|
|
3998
4004
|
${this.renderTriggerButton()}
|
|
3999
4005
|
${t.length > 0 ? d`
|
|
4000
4006
|
<div class="reaction-list">
|
|
@@ -4008,7 +4014,7 @@ let q = class extends m {
|
|
|
4008
4014
|
`;
|
|
4009
4015
|
} else
|
|
4010
4016
|
return d`
|
|
4011
|
-
<div class="${
|
|
4017
|
+
<div class="${y(e)}">
|
|
4012
4018
|
<div class="reaction-list">
|
|
4013
4019
|
${this.options.map((t) => this.renderReactionButton(t, this.showCounts))}
|
|
4014
4020
|
</div>
|
|
@@ -4052,9 +4058,9 @@ let q = class extends m {
|
|
|
4052
4058
|
[`pc-flex-align-${o}`]: !0
|
|
4053
4059
|
};
|
|
4054
4060
|
return d`
|
|
4055
|
-
<div class="${
|
|
4061
|
+
<div class="${y(t)}" data-testid="reaction-container">
|
|
4056
4062
|
${this.renderLabelAtStart()}
|
|
4057
|
-
<div class="${
|
|
4063
|
+
<div class="${y(r)}" data-testid="reaction-body">
|
|
4058
4064
|
${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderReactions()}
|
|
4059
4065
|
${this.renderStatusAtEnd()}
|
|
4060
4066
|
</div>
|