pollcatch 2.5.4 → 2.5.5
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 +615 -665
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
|
/**
|
|
@@ -1292,7 +1284,7 @@ class Qo {
|
|
|
1292
1284
|
for (const [i, a] of Object.entries(o)) {
|
|
1293
1285
|
if (a == null) continue;
|
|
1294
1286
|
if (i === "options" && typeof a == "string") {
|
|
1295
|
-
const n =
|
|
1287
|
+
const n = Be(a);
|
|
1296
1288
|
r.options = n.map((d) => ({
|
|
1297
1289
|
value: d,
|
|
1298
1290
|
label: d,
|
|
@@ -1308,66 +1300,61 @@ class Qo {
|
|
|
1308
1300
|
* Loads the stats for the widget.
|
|
1309
1301
|
*/
|
|
1310
1302
|
async loadServerStats() {
|
|
1311
|
-
var r, s, i;
|
|
1303
|
+
var r, s, i, a, l;
|
|
1312
1304
|
const t = this.host;
|
|
1313
1305
|
this.isLoading = !1, this.stats = this.localStats, this.host.requestUpdate();
|
|
1314
1306
|
const o = this.getWidgetIdentifier();
|
|
1315
1307
|
if (o)
|
|
1316
1308
|
try {
|
|
1317
|
-
let
|
|
1309
|
+
let n, d;
|
|
1318
1310
|
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;
|
|
1311
|
+
this.isLoadingConfig = !0, this.host.requestUpdate();
|
|
1312
|
+
const C = await $e(o), x = (s = (r = C.data) == null ? void 0 : r.config) == null ? void 0 : s.type;
|
|
1313
|
+
if (x && x !== t.type) {
|
|
1314
|
+
g.error(
|
|
1315
|
+
`Widget type mismatch: type="${t.type}" but server returned "${x}" for widget-id="${o.widgetId}"`
|
|
1316
|
+
), this.hasError = !0;
|
|
1317
|
+
return;
|
|
1332
1318
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1319
|
+
const P = ((a = (i = C.data) == null ? void 0 : i.config) == null ? void 0 : a.attributes) || null;
|
|
1320
|
+
n = ((l = C.data) == null ? void 0 : l.stats) || {}, this.applyWidgetAttributes(P);
|
|
1321
|
+
} else {
|
|
1322
|
+
let C;
|
|
1323
|
+
if (t.dataFunc && typeof window < "u") {
|
|
1324
|
+
const P = t.dataFunc.replace(/^window\./, "").split(".");
|
|
1325
|
+
let z = window;
|
|
1326
|
+
for (const It of P)
|
|
1327
|
+
if (z = z == null ? void 0 : z[It], z === void 0) break;
|
|
1328
|
+
C = z;
|
|
1329
|
+
}
|
|
1330
|
+
if (C && typeof C == "function") {
|
|
1331
|
+
d = this.getValidOptionKeys(t), g.debug(`Using data function for: ${t.widgetId || t.name}`, {
|
|
1335
1332
|
dataFuncName: t.dataFunc,
|
|
1336
|
-
options:
|
|
1333
|
+
options: d
|
|
1337
1334
|
});
|
|
1338
|
-
const x = await
|
|
1335
|
+
const x = await C(t.widgetId, t.name, d);
|
|
1339
1336
|
if (x && typeof x == "object" && "success" in x && "data" in x) {
|
|
1340
1337
|
if (!x.success)
|
|
1341
1338
|
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);
|
|
1339
|
+
n = x.data || {};
|
|
1354
1340
|
} else
|
|
1355
|
-
|
|
1356
|
-
}
|
|
1341
|
+
n = x || {};
|
|
1342
|
+
} else
|
|
1343
|
+
n = (await $e(o, t.dataEndpoint)).data || {};
|
|
1357
1344
|
}
|
|
1358
|
-
|
|
1359
|
-
const
|
|
1345
|
+
d ?? (d = this.getValidOptionKeys(t));
|
|
1346
|
+
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
1347
|
this.stats = {
|
|
1361
|
-
count:
|
|
1362
|
-
sum:
|
|
1363
|
-
avg:
|
|
1364
|
-
pct:
|
|
1365
|
-
nps: t.type === $.nps ?
|
|
1366
|
-
breakdown:
|
|
1367
|
-
updated:
|
|
1348
|
+
count: h,
|
|
1349
|
+
sum: b,
|
|
1350
|
+
avg: w,
|
|
1351
|
+
pct: E,
|
|
1352
|
+
nps: t.type === $.nps ? kt(p.breakdown) : 0,
|
|
1353
|
+
breakdown: p.breakdown,
|
|
1354
|
+
updated: n.updatedAt || n.updated_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
1368
1355
|
};
|
|
1369
|
-
} catch (
|
|
1370
|
-
throw g.error("Error loading stats:",
|
|
1356
|
+
} catch (n) {
|
|
1357
|
+
throw g.error("Error loading stats:", n, this.localStats), n;
|
|
1371
1358
|
} finally {
|
|
1372
1359
|
this.isLoading = !1, this.isLoadingConfig = !1, this.host.requestUpdate();
|
|
1373
1360
|
}
|
|
@@ -1398,10 +1385,10 @@ class Qo {
|
|
|
1398
1385
|
async loadLocalStats() {
|
|
1399
1386
|
const t = await this.getLocalStatsKey();
|
|
1400
1387
|
try {
|
|
1401
|
-
const o =
|
|
1388
|
+
const o = Uo(t);
|
|
1402
1389
|
g.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
|
|
1403
1390
|
} catch (o) {
|
|
1404
|
-
g.warn("Failed to generate localStorage key for localStats", o), this.localStats =
|
|
1391
|
+
g.warn("Failed to generate localStorage key for localStats", o), this.localStats = N();
|
|
1405
1392
|
}
|
|
1406
1393
|
this.host.requestUpdate();
|
|
1407
1394
|
}
|
|
@@ -1411,7 +1398,7 @@ class Qo {
|
|
|
1411
1398
|
async persistLocalStats() {
|
|
1412
1399
|
try {
|
|
1413
1400
|
const t = await this.getLocalStatsKey();
|
|
1414
|
-
|
|
1401
|
+
jo(t, this.localStats) || g.warn("Failed to save localStats to localStorage");
|
|
1415
1402
|
} catch (t) {
|
|
1416
1403
|
g.warn("Failed to save localStats to localStorage", t);
|
|
1417
1404
|
}
|
|
@@ -1425,7 +1412,7 @@ class Qo {
|
|
|
1425
1412
|
* @param textValues
|
|
1426
1413
|
*/
|
|
1427
1414
|
updateStats(t, o) {
|
|
1428
|
-
if (this.hasInteracted = !0, this.stats && (this.stats =
|
|
1415
|
+
if (this.hasInteracted = !0, this.stats && (this.stats = qo(this.stats, this.localStats)), this.localStats = {
|
|
1429
1416
|
count: t > 0 || o.length > 0 ? 1 : 0,
|
|
1430
1417
|
sum: t,
|
|
1431
1418
|
// e.g. number of stars, nps value
|
|
@@ -1439,7 +1426,7 @@ class Qo {
|
|
|
1439
1426
|
}, o && o.length > 0)
|
|
1440
1427
|
for (const r of o)
|
|
1441
1428
|
r && (this.localStats.breakdown[r] = 1);
|
|
1442
|
-
this.stats =
|
|
1429
|
+
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
1430
|
}
|
|
1444
1431
|
async markStatsAsSubmitted() {
|
|
1445
1432
|
this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), this.prevLocalStats = { ...this.localStats }, await this.persistLocalStats(), this.host.requestUpdate();
|
|
@@ -1447,7 +1434,7 @@ class Qo {
|
|
|
1447
1434
|
async submitStats() {
|
|
1448
1435
|
if (!this.hasLocalStats() && !this.hasInteracted)
|
|
1449
1436
|
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
|
|
1437
|
+
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
1438
|
this.isSubmitting = !0, this.host.requestUpdate();
|
|
1452
1439
|
const n = {
|
|
1453
1440
|
sessionId: r,
|
|
@@ -1461,7 +1448,7 @@ class Qo {
|
|
|
1461
1448
|
prevTextValues: l,
|
|
1462
1449
|
metadata: t.metadata,
|
|
1463
1450
|
timestamp: o
|
|
1464
|
-
}, d =
|
|
1451
|
+
}, d = Yo(JSON.stringify(n), o);
|
|
1465
1452
|
try {
|
|
1466
1453
|
await this.sendStats({ ...n, hash: d }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(n);
|
|
1467
1454
|
} catch (p) {
|
|
@@ -1479,11 +1466,11 @@ class Qo {
|
|
|
1479
1466
|
return;
|
|
1480
1467
|
}
|
|
1481
1468
|
const s = r.type === "registered" ? void 0 : o.dataEndpoint, i = Ve(s);
|
|
1482
|
-
if (!
|
|
1469
|
+
if (!Tt(i))
|
|
1483
1470
|
throw g.error("Invalid data endpoint", { dataEndpoint: i }), new Error(`Invalid data endpoint: ${i}`);
|
|
1484
1471
|
const a = JSON.stringify(t);
|
|
1485
1472
|
try {
|
|
1486
|
-
await
|
|
1473
|
+
await Go(r, a, s);
|
|
1487
1474
|
} catch (l) {
|
|
1488
1475
|
throw g.error("Failed to send analytics:", l), l;
|
|
1489
1476
|
}
|
|
@@ -1500,9 +1487,9 @@ class Qo {
|
|
|
1500
1487
|
sum: (o == null ? void 0 : o.sum) || 0,
|
|
1501
1488
|
avg: s,
|
|
1502
1489
|
pct: (o == null ? void 0 : o.pct) || 0,
|
|
1503
|
-
nps: r.type === $.nps ?
|
|
1490
|
+
nps: r.type === $.nps ? kt((o == null ? void 0 : o.breakdown) || {}) : 0
|
|
1504
1491
|
};
|
|
1505
|
-
return g.debug("Stats data: ", this.stats),
|
|
1492
|
+
return g.debug("Stats data: ", this.stats), Fo(t, i);
|
|
1506
1493
|
}
|
|
1507
1494
|
/**
|
|
1508
1495
|
* Checks if a value is selected in the local stats
|
|
@@ -1589,7 +1576,7 @@ class Qo {
|
|
|
1589
1576
|
return ((t = this.localStats) == null ? void 0 : t.submitted) !== void 0 && this.hasLocalStats();
|
|
1590
1577
|
}
|
|
1591
1578
|
}
|
|
1592
|
-
class
|
|
1579
|
+
class Xo {
|
|
1593
1580
|
constructor(t, o) {
|
|
1594
1581
|
this.isEditing = !0, this.isChartVisible = !1, this.isStatsVisible = !1, this.isThankYouVisible = !1, this.isReactionPopoverVisible = !1, this.initialized = !1, this.handleClickOutside = (r) => {
|
|
1595
1582
|
r.target !== this.host && (this.toggleThankYouVisibility(!1), this.toggleReactionPopoverVisibility(!1));
|
|
@@ -1677,8 +1664,8 @@ class tr {
|
|
|
1677
1664
|
return !(this.host.readonly || !this.isEditing);
|
|
1678
1665
|
}
|
|
1679
1666
|
}
|
|
1680
|
-
var
|
|
1681
|
-
function
|
|
1667
|
+
var Jt = /* @__PURE__ */ ((e) => (e.DECORATIVE = "decorative", e.FUNCTIONAL = "functional", e.STATUS = "status", e))(Jt || {});
|
|
1668
|
+
function je(e, t = {}) {
|
|
1682
1669
|
const { type: o = "functional", alt: r, ariaLabel: s, isSelected: i } = t;
|
|
1683
1670
|
if (!e)
|
|
1684
1671
|
return { alt: "", ariaHidden: !0 };
|
|
@@ -1687,20 +1674,20 @@ function qe(e, t = {}) {
|
|
|
1687
1674
|
o === "functional" && !r && !s && console.warn(
|
|
1688
1675
|
"No alt text or aria-label provided for functional icon. This may cause accessibility issues."
|
|
1689
1676
|
);
|
|
1690
|
-
const a = i ? " (selected)" : "", l =
|
|
1677
|
+
const a = i ? " (selected)" : "", l = Tt(e) && !r ? "" : r || e, n = s || (l ? `${l}${a}` : a);
|
|
1691
1678
|
return {
|
|
1692
1679
|
alt: l,
|
|
1693
1680
|
ariaLabel: n,
|
|
1694
1681
|
ariaHidden: !1
|
|
1695
1682
|
};
|
|
1696
1683
|
}
|
|
1697
|
-
function
|
|
1684
|
+
function Jo(e, t = "polite") {
|
|
1698
1685
|
let o = document.getElementById("screen-reader-announcer");
|
|
1699
1686
|
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
1687
|
o.textContent = e;
|
|
1701
1688
|
}, 50);
|
|
1702
1689
|
}
|
|
1703
|
-
function
|
|
1690
|
+
function Qo(e, t) {
|
|
1704
1691
|
return `${e}: ${t}`;
|
|
1705
1692
|
}
|
|
1706
1693
|
/**
|
|
@@ -1708,8 +1695,8 @@ function or(e, t) {
|
|
|
1708
1695
|
* Copyright 2017 Google LLC
|
|
1709
1696
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1710
1697
|
*/
|
|
1711
|
-
const
|
|
1712
|
-
let
|
|
1698
|
+
const qe = { ATTRIBUTE: 1 }, He = (e) => (...t) => ({ _$litDirective$: e, values: t });
|
|
1699
|
+
let Fe = class {
|
|
1713
1700
|
constructor(t) {
|
|
1714
1701
|
}
|
|
1715
1702
|
get _$AU() {
|
|
@@ -1730,10 +1717,10 @@ let Ye = class {
|
|
|
1730
1717
|
* Copyright 2018 Google LLC
|
|
1731
1718
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1732
1719
|
*/
|
|
1733
|
-
const
|
|
1720
|
+
const y = He(class extends Fe {
|
|
1734
1721
|
constructor(e) {
|
|
1735
1722
|
var t;
|
|
1736
|
-
if (super(e), e.type !==
|
|
1723
|
+
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
1724
|
}
|
|
1738
1725
|
render(e) {
|
|
1739
1726
|
return " " + Object.keys(e).filter((t) => e[t]).join(" ") + " ";
|
|
@@ -1751,21 +1738,21 @@ const w = Fe(class extends Ye {
|
|
|
1751
1738
|
const a = !!t[i];
|
|
1752
1739
|
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
1740
|
}
|
|
1754
|
-
return
|
|
1741
|
+
return q;
|
|
1755
1742
|
}
|
|
1756
1743
|
});
|
|
1757
|
-
var
|
|
1744
|
+
var tr = Object.defineProperty, v = (e, t, o, r) => {
|
|
1758
1745
|
for (var s = void 0, i = e.length - 1, a; i >= 0; i--)
|
|
1759
1746
|
(a = e[i]) && (s = a(t, o, s) || s);
|
|
1760
|
-
return s &&
|
|
1747
|
+
return s && tr(t, o, s), s;
|
|
1761
1748
|
};
|
|
1762
|
-
const
|
|
1749
|
+
const yt = {
|
|
1763
1750
|
mobile: "480px",
|
|
1764
1751
|
tablet: "768px",
|
|
1765
1752
|
desktop: "1024px"
|
|
1766
|
-
},
|
|
1753
|
+
}, Qt = class Qt extends D {
|
|
1767
1754
|
constructor() {
|
|
1768
|
-
super(...arguments), this.dataController = new
|
|
1755
|
+
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
1756
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
|
|
1770
1757
|
};
|
|
1771
1758
|
}
|
|
@@ -1797,10 +1784,10 @@ const bt = {
|
|
|
1797
1784
|
let o = `:host {
|
|
1798
1785
|
`;
|
|
1799
1786
|
if (this.primaryColor) {
|
|
1800
|
-
const i =
|
|
1787
|
+
const i = tt(this.primaryColor);
|
|
1801
1788
|
o += `--pc-primary-color: ${i} !important;
|
|
1802
1789
|
`;
|
|
1803
|
-
const a =
|
|
1790
|
+
const a = Ao(i, {
|
|
1804
1791
|
minContrast: this.minContrast,
|
|
1805
1792
|
colorOptions: ["black", "white", "light", "dark"]
|
|
1806
1793
|
});
|
|
@@ -1808,73 +1795,73 @@ const bt = {
|
|
|
1808
1795
|
`;
|
|
1809
1796
|
}
|
|
1810
1797
|
if (this.muteColor) {
|
|
1811
|
-
const i =
|
|
1798
|
+
const i = tt(this.muteColor);
|
|
1812
1799
|
o += `--pc-mute-color: ${i} !important;
|
|
1813
1800
|
`;
|
|
1814
1801
|
}
|
|
1815
1802
|
if (this.textColor) {
|
|
1816
|
-
const i =
|
|
1803
|
+
const i = tt(this.textColor);
|
|
1817
1804
|
o += `--pc-text-color: ${i} !important;
|
|
1818
1805
|
`;
|
|
1819
1806
|
}
|
|
1820
1807
|
if (this.backgroundColor) {
|
|
1821
|
-
const i =
|
|
1808
|
+
const i = tt(this.backgroundColor);
|
|
1822
1809
|
o += `--pc-background-color: ${i} !important;
|
|
1823
1810
|
`;
|
|
1824
1811
|
}
|
|
1825
1812
|
const r = this.starColor || this.accentColor || this.primaryColor;
|
|
1826
1813
|
if (r) {
|
|
1827
|
-
const i =
|
|
1814
|
+
const i = tt(r);
|
|
1828
1815
|
o += `--pc-star-color: ${i} !important;
|
|
1829
1816
|
`;
|
|
1830
1817
|
}
|
|
1831
|
-
const s = this.starHoverColor || (r ? `color-mix(in srgb, ${
|
|
1818
|
+
const s = this.starHoverColor || (r ? `color-mix(in srgb, ${tt(r)} 80%, white)` : null);
|
|
1832
1819
|
if (s && (o += `--pc-star-hover-color: ${s} !important;
|
|
1833
1820
|
`), this.starSize) {
|
|
1834
|
-
const i =
|
|
1821
|
+
const i = jt(this.starSize, "1.5em", 1.5);
|
|
1835
1822
|
o += `--pc-stars-star-size: ${i} !important;
|
|
1836
1823
|
`;
|
|
1837
1824
|
}
|
|
1838
1825
|
if (this.reactionSize) {
|
|
1839
|
-
const i =
|
|
1826
|
+
const i = jt(this.reactionSize, "1em", 1);
|
|
1840
1827
|
o += `--pc-reaction-size: ${i} !important;
|
|
1841
1828
|
`;
|
|
1842
1829
|
}
|
|
1843
1830
|
if (this.size) {
|
|
1844
|
-
const i =
|
|
1831
|
+
const i = jt(this.size);
|
|
1845
1832
|
o += `font-size: ${i} !important;
|
|
1846
1833
|
`;
|
|
1847
1834
|
}
|
|
1848
1835
|
if (this.buttonRadius) {
|
|
1849
|
-
const i =
|
|
1836
|
+
const i = To(this.buttonRadius);
|
|
1850
1837
|
o += `--pc-button-radius: ${i} !important;
|
|
1851
1838
|
`;
|
|
1852
1839
|
}
|
|
1853
1840
|
o += `}
|
|
1854
|
-
`, this.css && (o +=
|
|
1841
|
+
`, this.css && (o += Mo(zo(this.css))), t.textContent = o;
|
|
1855
1842
|
}
|
|
1856
1843
|
/**
|
|
1857
1844
|
* Update ARIA attributes for accessibility
|
|
1858
1845
|
*/
|
|
1859
1846
|
updateAriaAttributes() {
|
|
1860
|
-
this.ariaLabel &&
|
|
1847
|
+
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
1848
|
}
|
|
1862
1849
|
/**
|
|
1863
1850
|
* Update host CSS classes based on state
|
|
1864
1851
|
*/
|
|
1865
1852
|
updateHostClasses() {
|
|
1866
|
-
this.classList.toggle("is-loading", this.dataController.isLoading);
|
|
1853
|
+
this.classList.toggle("is-loading", this.dataController.isLoading), this.dataController.hasError && (this.style.display = "none");
|
|
1867
1854
|
}
|
|
1868
1855
|
/**
|
|
1869
1856
|
* Get responsive breakpoint utilities
|
|
1870
1857
|
*/
|
|
1871
1858
|
getBreakpointClasses() {
|
|
1872
1859
|
return {
|
|
1873
|
-
"pc-mobile": window.matchMedia(`(max-width: ${
|
|
1860
|
+
"pc-mobile": window.matchMedia(`(max-width: ${yt.mobile})`).matches,
|
|
1874
1861
|
"pc-tablet": window.matchMedia(
|
|
1875
|
-
`(min-width: ${
|
|
1862
|
+
`(min-width: ${yt.mobile}) and (max-width: ${yt.tablet})`
|
|
1876
1863
|
).matches,
|
|
1877
|
-
"pc-desktop": window.matchMedia(`(min-width: ${
|
|
1864
|
+
"pc-desktop": window.matchMedia(`(min-width: ${yt.desktop})`).matches
|
|
1878
1865
|
};
|
|
1879
1866
|
}
|
|
1880
1867
|
/**
|
|
@@ -1882,7 +1869,7 @@ const bt = {
|
|
|
1882
1869
|
*/
|
|
1883
1870
|
announceSelectionChange(t, o, r) {
|
|
1884
1871
|
const s = `Poll for "${t}"`, i = r ? `${o.label} selected` : `${o.label} unselected`;
|
|
1885
|
-
|
|
1872
|
+
Jo(Qo(s, i));
|
|
1886
1873
|
}
|
|
1887
1874
|
/** Common render methods */
|
|
1888
1875
|
renderLabel() {
|
|
@@ -1913,7 +1900,7 @@ const bt = {
|
|
|
1913
1900
|
tabindex="0"
|
|
1914
1901
|
aria-label="Edit vote"
|
|
1915
1902
|
@keydown="${this.handleEditToggleKeyDown}"
|
|
1916
|
-
>${
|
|
1903
|
+
>${Ct}</span
|
|
1917
1904
|
>
|
|
1918
1905
|
` : u;
|
|
1919
1906
|
}
|
|
@@ -1932,7 +1919,7 @@ const bt = {
|
|
|
1932
1919
|
tabindex="0"
|
|
1933
1920
|
aria-label="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
|
|
1934
1921
|
@keydown="${() => this.displayController.toggleChartVisibility()}"
|
|
1935
|
-
>${this.displayController.isChartVisible ?
|
|
1922
|
+
>${this.displayController.isChartVisible ? Zt : Gt}</span
|
|
1936
1923
|
>
|
|
1937
1924
|
` : u;
|
|
1938
1925
|
}
|
|
@@ -1941,9 +1928,9 @@ const bt = {
|
|
|
1941
1928
|
return u;
|
|
1942
1929
|
const o = {
|
|
1943
1930
|
"pc-status": !0,
|
|
1944
|
-
[`pc-flex-content-${
|
|
1931
|
+
[`pc-flex-content-${O(this.statsPosition, this.statsAlign)}`]: !0
|
|
1945
1932
|
};
|
|
1946
|
-
return c`<div class="${
|
|
1933
|
+
return c`<div class="${y(o)}" data-testid="pc-status">
|
|
1947
1934
|
${this.renderStatsText()} ${this.renderChartToggle()} ${this.renderEditToggleIcon()}
|
|
1948
1935
|
</div>`;
|
|
1949
1936
|
}
|
|
@@ -1959,7 +1946,7 @@ const bt = {
|
|
|
1959
1946
|
renderThankYouMessage() {
|
|
1960
1947
|
if (!this.displayController.shouldDisplayThankYouMsg())
|
|
1961
1948
|
return u;
|
|
1962
|
-
const t =
|
|
1949
|
+
const t = Ko(this.thankYouMsg || "");
|
|
1963
1950
|
return c`
|
|
1964
1951
|
<div class="pc-thank-you-overlay" data-testid="poll-thank-you-overlay">
|
|
1965
1952
|
<div class="pc-thank-you" data-testid="thank-you">
|
|
@@ -1971,7 +1958,7 @@ const bt = {
|
|
|
1971
1958
|
@click="${() => this.displayController.toggleThankYouVisibility(!1)}"
|
|
1972
1959
|
role="button"
|
|
1973
1960
|
aria-label="Close"
|
|
1974
|
-
>${
|
|
1961
|
+
>${Pt}</span
|
|
1975
1962
|
>
|
|
1976
1963
|
</div>
|
|
1977
1964
|
</div>
|
|
@@ -1979,8 +1966,8 @@ const bt = {
|
|
|
1979
1966
|
`;
|
|
1980
1967
|
}
|
|
1981
1968
|
};
|
|
1982
|
-
|
|
1983
|
-
|
|
1969
|
+
Qt.styles = [
|
|
1970
|
+
B`
|
|
1984
1971
|
:host {
|
|
1985
1972
|
/* Default values for CSS variables - can be overridden by external :root or parent definitions */
|
|
1986
1973
|
--default-font-size-base: 1rem;
|
|
@@ -2060,113 +2047,113 @@ Jt.styles = [
|
|
|
2060
2047
|
}
|
|
2061
2048
|
`
|
|
2062
2049
|
];
|
|
2063
|
-
let m =
|
|
2050
|
+
let m = Qt;
|
|
2064
2051
|
v([
|
|
2065
|
-
|
|
2052
|
+
f({ type: String, attribute: "show-stats" })
|
|
2066
2053
|
], m.prototype, "showStats");
|
|
2067
2054
|
v([
|
|
2068
|
-
|
|
2055
|
+
f({ type: Boolean, attribute: "show-chart" })
|
|
2069
2056
|
], m.prototype, "showChart");
|
|
2070
2057
|
v([
|
|
2071
|
-
|
|
2058
|
+
f({ type: Boolean, attribute: "initialized" })
|
|
2072
2059
|
], m.prototype, "initialized");
|
|
2073
2060
|
v([
|
|
2074
|
-
|
|
2061
|
+
f({ type: String, attribute: "primary-color" })
|
|
2075
2062
|
], m.prototype, "primaryColor");
|
|
2076
2063
|
v([
|
|
2077
|
-
|
|
2064
|
+
f({ type: String, attribute: "mute-color" })
|
|
2078
2065
|
], m.prototype, "muteColor");
|
|
2079
2066
|
v([
|
|
2080
|
-
|
|
2067
|
+
f({ type: String, attribute: "text-color" })
|
|
2081
2068
|
], m.prototype, "textColor");
|
|
2082
2069
|
v([
|
|
2083
|
-
|
|
2070
|
+
f({ type: String, attribute: "background-color" })
|
|
2084
2071
|
], m.prototype, "backgroundColor");
|
|
2085
2072
|
v([
|
|
2086
|
-
|
|
2073
|
+
f({ type: String, attribute: "accent-color" })
|
|
2087
2074
|
], m.prototype, "accentColor");
|
|
2088
2075
|
v([
|
|
2089
|
-
|
|
2076
|
+
f({ type: String, attribute: "star-color" })
|
|
2090
2077
|
], m.prototype, "starColor");
|
|
2091
2078
|
v([
|
|
2092
|
-
|
|
2079
|
+
f({ type: String, attribute: "star-hover-color" })
|
|
2093
2080
|
], m.prototype, "starHoverColor");
|
|
2094
2081
|
v([
|
|
2095
|
-
|
|
2082
|
+
f({ type: String, attribute: "star-size" })
|
|
2096
2083
|
], m.prototype, "starSize");
|
|
2097
2084
|
v([
|
|
2098
|
-
|
|
2085
|
+
f({ type: String, attribute: "reaction-size" })
|
|
2099
2086
|
], m.prototype, "reactionSize");
|
|
2100
2087
|
v([
|
|
2101
|
-
|
|
2088
|
+
f({ type: String })
|
|
2102
2089
|
], m.prototype, "size");
|
|
2103
2090
|
v([
|
|
2104
|
-
|
|
2091
|
+
f({ type: String, attribute: "aria-label" })
|
|
2105
2092
|
], m.prototype, "ariaLabel");
|
|
2106
2093
|
v([
|
|
2107
|
-
|
|
2094
|
+
f({ type: String, attribute: "aria-describedby" })
|
|
2108
2095
|
], m.prototype, "ariaDescribedby");
|
|
2109
2096
|
v([
|
|
2110
|
-
|
|
2097
|
+
f({ type: Number, attribute: "min-contrast" })
|
|
2111
2098
|
], m.prototype, "minContrast");
|
|
2112
2099
|
v([
|
|
2113
|
-
|
|
2100
|
+
f({ type: String })
|
|
2114
2101
|
], m.prototype, "css");
|
|
2115
2102
|
v([
|
|
2116
|
-
|
|
2103
|
+
f({ type: Array })
|
|
2117
2104
|
], m.prototype, "options");
|
|
2118
2105
|
v([
|
|
2119
|
-
|
|
2106
|
+
f({ type: String, attribute: "widget-id" })
|
|
2120
2107
|
], m.prototype, "widgetId");
|
|
2121
2108
|
v([
|
|
2122
|
-
|
|
2109
|
+
f({ type: String, attribute: "name" })
|
|
2123
2110
|
], m.prototype, "name");
|
|
2124
2111
|
v([
|
|
2125
|
-
|
|
2112
|
+
f({ type: String })
|
|
2126
2113
|
], m.prototype, "metadata");
|
|
2127
2114
|
v([
|
|
2128
|
-
|
|
2115
|
+
f({ type: String, attribute: "data-func" })
|
|
2129
2116
|
], m.prototype, "dataFunc");
|
|
2130
2117
|
v([
|
|
2131
|
-
|
|
2118
|
+
f({ type: String, attribute: "data-endpoint" })
|
|
2132
2119
|
], m.prototype, "dataEndpoint");
|
|
2133
2120
|
v([
|
|
2134
|
-
|
|
2121
|
+
f({ type: String })
|
|
2135
2122
|
], m.prototype, "question");
|
|
2136
2123
|
v([
|
|
2137
|
-
|
|
2124
|
+
f({ type: String, attribute: "question-position" })
|
|
2138
2125
|
], m.prototype, "questionPosition");
|
|
2139
2126
|
v([
|
|
2140
|
-
|
|
2127
|
+
f({ type: String, attribute: "question-align" })
|
|
2141
2128
|
], m.prototype, "questionAlign");
|
|
2142
2129
|
v([
|
|
2143
|
-
|
|
2130
|
+
f({ type: String, attribute: "stats-text" })
|
|
2144
2131
|
], m.prototype, "statsText");
|
|
2145
2132
|
v([
|
|
2146
|
-
|
|
2133
|
+
f({ type: String, attribute: "stats-position" })
|
|
2147
2134
|
], m.prototype, "statsPosition");
|
|
2148
2135
|
v([
|
|
2149
|
-
|
|
2136
|
+
f({ type: String, attribute: "stats-align" })
|
|
2150
2137
|
], m.prototype, "statsAlign");
|
|
2151
2138
|
v([
|
|
2152
|
-
|
|
2139
|
+
f({ type: String, attribute: "button-text" })
|
|
2153
2140
|
], m.prototype, "buttonText");
|
|
2154
2141
|
v([
|
|
2155
|
-
|
|
2142
|
+
f({ type: String, attribute: "button-radius" })
|
|
2156
2143
|
], m.prototype, "buttonRadius");
|
|
2157
2144
|
v([
|
|
2158
|
-
|
|
2145
|
+
f({ type: String, attribute: "thank-you-msg" })
|
|
2159
2146
|
], m.prototype, "thankYouMsg");
|
|
2160
2147
|
v([
|
|
2161
|
-
|
|
2148
|
+
f({ type: Boolean, attribute: "multiple" })
|
|
2162
2149
|
], m.prototype, "multiple");
|
|
2163
2150
|
v([
|
|
2164
|
-
|
|
2151
|
+
f({ type: Boolean, reflect: !0 })
|
|
2165
2152
|
], m.prototype, "inline");
|
|
2166
2153
|
v([
|
|
2167
|
-
|
|
2154
|
+
f({ type: Boolean, reflect: !0 })
|
|
2168
2155
|
], m.prototype, "readonly");
|
|
2169
|
-
const
|
|
2156
|
+
const er = B`
|
|
2170
2157
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
2171
2158
|
|
|
2172
2159
|
.pc-body {
|
|
@@ -2617,7 +2604,7 @@ const sr = R`
|
|
|
2617
2604
|
animation: none;
|
|
2618
2605
|
}
|
|
2619
2606
|
}
|
|
2620
|
-
`,
|
|
2607
|
+
`, _t = B`
|
|
2621
2608
|
/* Default values for CSS variables - can be overridden by external :root or parent definitions */
|
|
2622
2609
|
:host {
|
|
2623
2610
|
--default-primary-color: #2196f3;
|
|
@@ -3336,7 +3323,7 @@ const sr = R`
|
|
|
3336
3323
|
opacity: 1;
|
|
3337
3324
|
}
|
|
3338
3325
|
}
|
|
3339
|
-
`,
|
|
3326
|
+
`, or = B`
|
|
3340
3327
|
:host {
|
|
3341
3328
|
--popover-bg: light-dark(#ffffff, #1a1a1a);
|
|
3342
3329
|
--popover-border: light-dark(#e0e0e0, #333333);
|
|
@@ -3458,21 +3445,21 @@ const sr = R`
|
|
|
3458
3445
|
max-width: 100%;
|
|
3459
3446
|
}
|
|
3460
3447
|
`;
|
|
3461
|
-
var
|
|
3462
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3448
|
+
var rr = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, V = (e, t, o, r) => {
|
|
3449
|
+
for (var s = r > 1 ? void 0 : r ? sr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3463
3450
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3464
|
-
return r && s &&
|
|
3451
|
+
return r && s && rr(t, o, s), s;
|
|
3465
3452
|
};
|
|
3466
|
-
let
|
|
3453
|
+
let _ = class extends D {
|
|
3467
3454
|
constructor() {
|
|
3468
3455
|
super(...arguments), this.open = !1, this.position = "auto", this.isClosing = !1, this.computedPosition = "bottom", this.popoverStyles = {}, this.arrowStyles = {}, this.updatePosition = () => {
|
|
3469
|
-
var
|
|
3456
|
+
var h;
|
|
3470
3457
|
if (!this.anchor || !this.open) return;
|
|
3471
|
-
const e = this.anchor.getBoundingClientRect(), t = window.innerWidth, o = window.innerHeight, r = 12, s = (
|
|
3458
|
+
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
3459
|
let l = this.position;
|
|
3473
3460
|
if (l === "auto") {
|
|
3474
|
-
const b = o - e.bottom,
|
|
3475
|
-
l = b >= a + r || b >=
|
|
3461
|
+
const b = o - e.bottom, w = e.top;
|
|
3462
|
+
l = b >= a + r || b >= w ? "bottom" : "top";
|
|
3476
3463
|
}
|
|
3477
3464
|
this.computedPosition = l;
|
|
3478
3465
|
let n, d;
|
|
@@ -3536,7 +3523,7 @@ let T = class extends N {
|
|
|
3536
3523
|
return c`
|
|
3537
3524
|
<div class="pc-popover-scrim" @click=${this.handleScrimClick}></div>
|
|
3538
3525
|
<div
|
|
3539
|
-
class=${
|
|
3526
|
+
class=${y(e)}
|
|
3540
3527
|
data-position=${this.computedPosition}
|
|
3541
3528
|
style=${Object.entries(this.popoverStyles).map(([t, o]) => `${t}: ${o}`).join("; ")}
|
|
3542
3529
|
role="dialog"
|
|
@@ -3552,35 +3539,35 @@ let T = class extends N {
|
|
|
3552
3539
|
`;
|
|
3553
3540
|
}
|
|
3554
3541
|
};
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
],
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
],
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
],
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
],
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
],
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
],
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
],
|
|
3577
|
-
|
|
3542
|
+
_.styles = [or];
|
|
3543
|
+
V([
|
|
3544
|
+
f({ type: Boolean, reflect: !0 })
|
|
3545
|
+
], _.prototype, "open", 2);
|
|
3546
|
+
V([
|
|
3547
|
+
f({ type: String })
|
|
3548
|
+
], _.prototype, "position", 2);
|
|
3549
|
+
V([
|
|
3550
|
+
f({ attribute: !1 })
|
|
3551
|
+
], _.prototype, "anchor", 2);
|
|
3552
|
+
V([
|
|
3553
|
+
k()
|
|
3554
|
+
], _.prototype, "isClosing", 2);
|
|
3555
|
+
V([
|
|
3556
|
+
k()
|
|
3557
|
+
], _.prototype, "computedPosition", 2);
|
|
3558
|
+
V([
|
|
3559
|
+
k()
|
|
3560
|
+
], _.prototype, "popoverStyles", 2);
|
|
3561
|
+
V([
|
|
3562
|
+
k()
|
|
3563
|
+
], _.prototype, "arrowStyles", 2);
|
|
3564
|
+
V([
|
|
3578
3565
|
ft(".pc-popover")
|
|
3579
|
-
],
|
|
3580
|
-
|
|
3566
|
+
], _.prototype, "popoverElement", 2);
|
|
3567
|
+
_ = V([
|
|
3581
3568
|
F("pc-popover")
|
|
3582
|
-
],
|
|
3583
|
-
const
|
|
3569
|
+
], _);
|
|
3570
|
+
const ir = B`
|
|
3584
3571
|
:host {
|
|
3585
3572
|
--sheet-bg: light-dark(#ffffff, #1a1a1a);
|
|
3586
3573
|
--sheet-border: light-dark(#e0e0e0, #333333);
|
|
@@ -3693,12 +3680,12 @@ const lr = R`
|
|
|
3693
3680
|
max-width: 100%;
|
|
3694
3681
|
}
|
|
3695
3682
|
`;
|
|
3696
|
-
var
|
|
3697
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3683
|
+
var ar = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, Q = (e, t, o, r) => {
|
|
3684
|
+
for (var s = r > 1 ? void 0 : r ? nr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3698
3685
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3699
|
-
return r && s &&
|
|
3686
|
+
return r && s && ar(t, o, s), s;
|
|
3700
3687
|
};
|
|
3701
|
-
let
|
|
3688
|
+
let R = class extends D {
|
|
3702
3689
|
constructor() {
|
|
3703
3690
|
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
3691
|
if (e.key === "Escape" && this.open && (e.preventDefault(), e.stopPropagation(), this.close()), e.key === "Tab" && this.open && this.sheetElement) {
|
|
@@ -3776,8 +3763,8 @@ let D = class extends N {
|
|
|
3776
3763
|
dragging: this.isDragging
|
|
3777
3764
|
};
|
|
3778
3765
|
return c`
|
|
3779
|
-
<div class=${
|
|
3780
|
-
<div class=${
|
|
3766
|
+
<div class=${y(e)} @click=${this.handleScrimClick}></div>
|
|
3767
|
+
<div class=${y(t)} role="dialog" aria-modal="true" tabindex="-1">
|
|
3781
3768
|
<div
|
|
3782
3769
|
class="pc-sheet-handle"
|
|
3783
3770
|
@touchstart=${this.handleDragStart}
|
|
@@ -3792,35 +3779,35 @@ let D = class extends N {
|
|
|
3792
3779
|
`;
|
|
3793
3780
|
}
|
|
3794
3781
|
};
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
],
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
],
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
],
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
],
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
],
|
|
3811
|
-
|
|
3782
|
+
R.styles = [ir];
|
|
3783
|
+
Q([
|
|
3784
|
+
f({ type: Boolean, reflect: !0 })
|
|
3785
|
+
], R.prototype, "open", 2);
|
|
3786
|
+
Q([
|
|
3787
|
+
f({ type: Boolean, attribute: "drag-to-close" })
|
|
3788
|
+
], R.prototype, "dragToClose", 2);
|
|
3789
|
+
Q([
|
|
3790
|
+
k()
|
|
3791
|
+
], R.prototype, "isClosing", 2);
|
|
3792
|
+
Q([
|
|
3793
|
+
k()
|
|
3794
|
+
], R.prototype, "isDragging", 2);
|
|
3795
|
+
Q([
|
|
3796
|
+
k()
|
|
3797
|
+
], R.prototype, "dragOffset", 2);
|
|
3798
|
+
Q([
|
|
3812
3799
|
ft(".pc-bottom-sheet")
|
|
3813
|
-
],
|
|
3814
|
-
|
|
3800
|
+
], R.prototype, "sheetElement", 2);
|
|
3801
|
+
R = Q([
|
|
3815
3802
|
F("pc-bottom-sheet")
|
|
3816
|
-
],
|
|
3817
|
-
var
|
|
3818
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3803
|
+
], R);
|
|
3804
|
+
var lr = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, gt = (e, t, o, r) => {
|
|
3805
|
+
for (var s = r > 1 ? void 0 : r ? cr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3819
3806
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3820
|
-
return r && s &&
|
|
3807
|
+
return r && s && lr(t, o, s), s;
|
|
3821
3808
|
};
|
|
3822
|
-
const
|
|
3823
|
-
let Z = class extends
|
|
3809
|
+
const dr = 768;
|
|
3810
|
+
let Z = class extends D {
|
|
3824
3811
|
constructor() {
|
|
3825
3812
|
super(...arguments), this.open = !1, this.position = "auto", this.isMobile = !1, this.handleMediaChange = (e) => {
|
|
3826
3813
|
this.isMobile = e.matches;
|
|
@@ -3836,7 +3823,7 @@ let Z = class extends N {
|
|
|
3836
3823
|
super.disconnectedCallback(), (e = this.mediaQuery) == null || e.removeEventListener("change", this.handleMediaChange);
|
|
3837
3824
|
}
|
|
3838
3825
|
setupMediaQuery() {
|
|
3839
|
-
this.mediaQuery = window.matchMedia(`(max-width: ${
|
|
3826
|
+
this.mediaQuery = window.matchMedia(`(max-width: ${dr - 1}px)`), this.isMobile = this.mediaQuery.matches, this.mediaQuery.addEventListener("change", this.handleMediaChange);
|
|
3840
3827
|
}
|
|
3841
3828
|
render() {
|
|
3842
3829
|
return this.isMobile ? c`
|
|
@@ -3855,32 +3842,32 @@ let Z = class extends N {
|
|
|
3855
3842
|
`;
|
|
3856
3843
|
}
|
|
3857
3844
|
};
|
|
3858
|
-
Z.styles =
|
|
3845
|
+
Z.styles = B`
|
|
3859
3846
|
:host {
|
|
3860
3847
|
display: contents;
|
|
3861
3848
|
}
|
|
3862
3849
|
`;
|
|
3863
3850
|
gt([
|
|
3864
|
-
|
|
3851
|
+
f({ type: Boolean, reflect: !0 })
|
|
3865
3852
|
], Z.prototype, "open", 2);
|
|
3866
3853
|
gt([
|
|
3867
|
-
|
|
3854
|
+
f({ type: String })
|
|
3868
3855
|
], Z.prototype, "position", 2);
|
|
3869
3856
|
gt([
|
|
3870
|
-
|
|
3857
|
+
f({ attribute: !1 })
|
|
3871
3858
|
], Z.prototype, "anchor", 2);
|
|
3872
3859
|
gt([
|
|
3873
|
-
|
|
3860
|
+
k()
|
|
3874
3861
|
], Z.prototype, "isMobile", 2);
|
|
3875
3862
|
Z = gt([
|
|
3876
3863
|
F("pc-responsive-modal")
|
|
3877
3864
|
], Z);
|
|
3878
|
-
var
|
|
3879
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3865
|
+
var pr = Object.defineProperty, ur = Object.getOwnPropertyDescriptor, Y = (e, t, o, r) => {
|
|
3866
|
+
for (var s = r > 1 ? void 0 : r ? ur(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3880
3867
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3881
|
-
return r && s &&
|
|
3868
|
+
return r && s && pr(t, o, s), s;
|
|
3882
3869
|
};
|
|
3883
|
-
let
|
|
3870
|
+
let I = class extends m {
|
|
3884
3871
|
constructor() {
|
|
3885
3872
|
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
3873
|
this.hoverValue = -1;
|
|
@@ -3892,20 +3879,20 @@ let O = class extends m {
|
|
|
3892
3879
|
* Render NPS buttons for edit mode
|
|
3893
3880
|
*/
|
|
3894
3881
|
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:
|
|
3882
|
+
const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o = ot({
|
|
3883
|
+
role: L.GROUP,
|
|
3897
3884
|
ariaLabel: this.question || "NPS Rating",
|
|
3898
3885
|
ariaDescribedby: `${t}-description`
|
|
3899
3886
|
}), r = e.map((s) => {
|
|
3900
3887
|
const i = this.dataController.isValueSelected(String(s)), a = {
|
|
3901
3888
|
"nps-button": !0,
|
|
3902
3889
|
selected: i
|
|
3903
|
-
}, l =
|
|
3890
|
+
}, l = _o(`Rate ${s}`, i, !1);
|
|
3904
3891
|
return c`
|
|
3905
3892
|
<button
|
|
3906
3893
|
data-testid="nps-button-${s}"
|
|
3907
3894
|
?disabled=${!this.displayController.allowEdit()}
|
|
3908
|
-
class=${
|
|
3895
|
+
class=${y(a)}
|
|
3909
3896
|
@click="${() => this.handleNumberClick(s)}"
|
|
3910
3897
|
@mouseenter="${() => this.handleNumberHover(s)}"
|
|
3911
3898
|
@focus="${() => this.handleNumberHover(s)}"
|
|
@@ -3944,10 +3931,10 @@ let O = class extends m {
|
|
|
3944
3931
|
* NPS score displayed prominently in the middle
|
|
3945
3932
|
*/
|
|
3946
3933
|
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 = (
|
|
3934
|
+
const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = (P) => ({
|
|
3935
|
+
x: o + s * Math.cos(P),
|
|
3936
|
+
y: r - s * Math.sin(P)
|
|
3937
|
+
}), 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
3938
|
return c`
|
|
3952
3939
|
<div class="nps-semicircle-gauge" data-testid="nps-semicircle-gauge">
|
|
3953
3940
|
<svg viewBox="0 0 200 115">
|
|
@@ -3958,12 +3945,12 @@ let O = class extends m {
|
|
|
3958
3945
|
/>
|
|
3959
3946
|
|
|
3960
3947
|
<!-- Colored segments -->
|
|
3961
|
-
<path class="gauge-arc gauge-arc-detractor" d="${
|
|
3948
|
+
<path class="gauge-arc gauge-arc-detractor" d="${h}" />
|
|
3962
3949
|
<path class="gauge-arc gauge-arc-passive" d="${b}" />
|
|
3963
|
-
<path class="gauge-arc gauge-arc-promoter" d="${
|
|
3950
|
+
<path class="gauge-arc gauge-arc-promoter" d="${w}" />
|
|
3964
3951
|
|
|
3965
3952
|
<!-- Needle indicator -->
|
|
3966
|
-
<circle class="gauge-needle" cx="${
|
|
3953
|
+
<circle class="gauge-needle" cx="${x.x}" cy="${x.y}" r="5" />
|
|
3967
3954
|
|
|
3968
3955
|
<!-- Score display in center -->
|
|
3969
3956
|
<text class="gauge-score" x="${o}" y="${r - 15}">${t}</text>
|
|
@@ -4023,7 +4010,7 @@ let O = class extends m {
|
|
|
4023
4010
|
* Uses SVG with 3 colored segments for detractors/passives/promoters
|
|
4024
4011
|
*/
|
|
4025
4012
|
renderInlineGauge() {
|
|
4026
|
-
const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s =
|
|
4013
|
+
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
4014
|
if (i === 0)
|
|
4028
4015
|
return c`
|
|
4029
4016
|
<div class="inline-nps-gauge">
|
|
@@ -4032,9 +4019,9 @@ let O = class extends m {
|
|
|
4032
4019
|
</svg>
|
|
4033
4020
|
</div>
|
|
4034
4021
|
`;
|
|
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
|
|
4022
|
+
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();
|
|
4023
|
+
let x = "gauge-bg";
|
|
4024
|
+
return C !== null && (C <= 6 ? x = "gauge-detractor" : C <= 8 ? x = "gauge-passive" : x = "gauge-promoter"), c`
|
|
4038
4025
|
<div class="inline-nps-gauge">
|
|
4039
4026
|
<svg viewBox="0 0 20 20">
|
|
4040
4027
|
<!-- Background circle -->
|
|
@@ -4055,7 +4042,7 @@ let O = class extends m {
|
|
|
4055
4042
|
cy="10"
|
|
4056
4043
|
r="${o}"
|
|
4057
4044
|
stroke-dasharray="${p} ${r}"
|
|
4058
|
-
stroke-dashoffset="${
|
|
4045
|
+
stroke-dashoffset="${w}"
|
|
4059
4046
|
/>
|
|
4060
4047
|
<!-- Promoter segment (green) -->
|
|
4061
4048
|
<circle
|
|
@@ -4063,11 +4050,11 @@ let O = class extends m {
|
|
|
4063
4050
|
cx="10"
|
|
4064
4051
|
cy="10"
|
|
4065
4052
|
r="${o}"
|
|
4066
|
-
stroke-dasharray="${
|
|
4067
|
-
stroke-dashoffset="${
|
|
4053
|
+
stroke-dasharray="${h} ${r}"
|
|
4054
|
+
stroke-dashoffset="${E}"
|
|
4068
4055
|
/>
|
|
4069
4056
|
<!-- Center dot showing user's score category -->
|
|
4070
|
-
<circle class="gauge-dot ${
|
|
4057
|
+
<circle class="gauge-dot ${x}" cx="10" cy="10" r="2" />
|
|
4071
4058
|
</svg>
|
|
4072
4059
|
</div>
|
|
4073
4060
|
`;
|
|
@@ -4078,7 +4065,7 @@ let O = class extends m {
|
|
|
4078
4065
|
* Shows add icon when no selection, edit icon when user has submitted
|
|
4079
4066
|
*/
|
|
4080
4067
|
renderInlineTrigger() {
|
|
4081
|
-
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ?
|
|
4068
|
+
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? Ct : Oe;
|
|
4082
4069
|
return c`
|
|
4083
4070
|
<button
|
|
4084
4071
|
class="pc-inline-trigger"
|
|
@@ -4110,7 +4097,7 @@ let O = class extends m {
|
|
|
4110
4097
|
};
|
|
4111
4098
|
return c`
|
|
4112
4099
|
<button
|
|
4113
|
-
class=${
|
|
4100
|
+
class=${y(i)}
|
|
4114
4101
|
@click=${() => this.handlePopoverNumberClick(r)}
|
|
4115
4102
|
@mouseenter=${() => this.handleNumberHover(r)}
|
|
4116
4103
|
@mouseleave=${this.handleNumberLeave}
|
|
@@ -4144,7 +4131,7 @@ let O = class extends m {
|
|
|
4144
4131
|
@keydown="${(e) => {
|
|
4145
4132
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
|
|
4146
4133
|
}}"
|
|
4147
|
-
>${this.displayController.isChartVisible ?
|
|
4134
|
+
>${this.displayController.isChartVisible ? Zt : Gt}</span
|
|
4148
4135
|
>
|
|
4149
4136
|
`;
|
|
4150
4137
|
}
|
|
@@ -4163,7 +4150,7 @@ let O = class extends m {
|
|
|
4163
4150
|
aria-label="Close"
|
|
4164
4151
|
data-testid="popover-close-button"
|
|
4165
4152
|
>
|
|
4166
|
-
${
|
|
4153
|
+
${Pt}
|
|
4167
4154
|
</button>
|
|
4168
4155
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
4169
4156
|
${this.renderPopoverNpsButtons()}
|
|
@@ -4213,16 +4200,16 @@ let O = class extends m {
|
|
|
4213
4200
|
renderStandardMode() {
|
|
4214
4201
|
const e = {
|
|
4215
4202
|
[`pc-flex-pos-${this.questionPosition}`]: !0,
|
|
4216
|
-
[`pc-flex-align-${
|
|
4203
|
+
[`pc-flex-align-${O(this.questionPosition, this.questionAlign)}`]: !0
|
|
4217
4204
|
}, t = {
|
|
4218
4205
|
nps: !0,
|
|
4219
4206
|
[`pc-flex-pos-${this.statsPosition}`]: !0,
|
|
4220
|
-
[`pc-flex-align-${
|
|
4207
|
+
[`pc-flex-align-${O(this.statsPosition, this.statsAlign)}`]: !0
|
|
4221
4208
|
};
|
|
4222
4209
|
return c`
|
|
4223
|
-
<div class="pc-container ${
|
|
4210
|
+
<div class="pc-container ${y(e)}" data-testid="nps-container">
|
|
4224
4211
|
${this.renderLabelAtStart()}
|
|
4225
|
-
<div class="pc-body ${
|
|
4212
|
+
<div class="pc-body ${y(t)}" data-testid="nps-body">
|
|
4226
4213
|
${this.renderStatusAtStart()} ${this.renderContent()} ${this.renderStatusAtEnd()}
|
|
4227
4214
|
</div>
|
|
4228
4215
|
${this.renderLabelAtEnd()}
|
|
@@ -4236,32 +4223,32 @@ let O = class extends m {
|
|
|
4236
4223
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
4237
4224
|
}
|
|
4238
4225
|
};
|
|
4239
|
-
|
|
4226
|
+
I.styles = [...m.styles, _t, er];
|
|
4240
4227
|
Y([
|
|
4241
|
-
|
|
4242
|
-
],
|
|
4228
|
+
f({ type: String, attribute: "min-label" })
|
|
4229
|
+
], I.prototype, "minLabel", 2);
|
|
4243
4230
|
Y([
|
|
4244
|
-
|
|
4245
|
-
],
|
|
4231
|
+
f({ type: String, attribute: "max-label" })
|
|
4232
|
+
], I.prototype, "maxLabel", 2);
|
|
4246
4233
|
Y([
|
|
4247
|
-
|
|
4248
|
-
],
|
|
4234
|
+
f({ type: String, attribute: "thank-you-msg" })
|
|
4235
|
+
], I.prototype, "thankYouMsg", 2);
|
|
4249
4236
|
Y([
|
|
4250
|
-
|
|
4251
|
-
],
|
|
4237
|
+
f({ type: String, attribute: "min-max-position" })
|
|
4238
|
+
], I.prototype, "minMaxPosition", 2);
|
|
4252
4239
|
Y([
|
|
4253
|
-
|
|
4254
|
-
],
|
|
4240
|
+
k()
|
|
4241
|
+
], I.prototype, "hoverValue", 2);
|
|
4255
4242
|
Y([
|
|
4256
|
-
|
|
4257
|
-
],
|
|
4243
|
+
k()
|
|
4244
|
+
], I.prototype, "popoverOpen", 2);
|
|
4258
4245
|
Y([
|
|
4259
4246
|
ft(".pc-inline-trigger")
|
|
4260
|
-
],
|
|
4261
|
-
|
|
4247
|
+
], I.prototype, "triggerElement", 2);
|
|
4248
|
+
I = Y([
|
|
4262
4249
|
F("pc-nps")
|
|
4263
|
-
],
|
|
4264
|
-
const
|
|
4250
|
+
], I);
|
|
4251
|
+
const hr = B`
|
|
4265
4252
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
4266
4253
|
|
|
4267
4254
|
.pc-container {
|
|
@@ -4646,10 +4633,10 @@ const mr = R`
|
|
|
4646
4633
|
opacity: 0.8;
|
|
4647
4634
|
}
|
|
4648
4635
|
`;
|
|
4649
|
-
var
|
|
4650
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
4636
|
+
var fr = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, mt = (e, t, o, r) => {
|
|
4637
|
+
for (var s = r > 1 ? void 0 : r ? gr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
4651
4638
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
4652
|
-
return r && s &&
|
|
4639
|
+
return r && s && fr(t, o, s), s;
|
|
4653
4640
|
};
|
|
4654
4641
|
let X = class extends m {
|
|
4655
4642
|
constructor() {
|
|
@@ -4658,9 +4645,9 @@ let X = class extends m {
|
|
|
4658
4645
|
renderStatus() {
|
|
4659
4646
|
const t = {
|
|
4660
4647
|
"pc-status": !0,
|
|
4661
|
-
[`pc-flex-content-${
|
|
4648
|
+
[`pc-flex-content-${O("bottom", this.statsAlign)}`]: !0
|
|
4662
4649
|
};
|
|
4663
|
-
return c`<div class="${
|
|
4650
|
+
return c`<div class="${y(t)}" data-testid="pc-status">
|
|
4664
4651
|
<span>${this.renderStatsText()} ${this.renderEditToggleIcon("stats-edit-button")}</span>
|
|
4665
4652
|
</div>`;
|
|
4666
4653
|
}
|
|
@@ -4675,7 +4662,7 @@ let X = class extends m {
|
|
|
4675
4662
|
}, t = this.displayController.shouldDisableSubmitButton();
|
|
4676
4663
|
return c`
|
|
4677
4664
|
<button
|
|
4678
|
-
class="${
|
|
4665
|
+
class="${y(e)}"
|
|
4679
4666
|
data-testid="pc-submit-button"
|
|
4680
4667
|
@click="${this.handleSubmit}"
|
|
4681
4668
|
?disabled="${t}"
|
|
@@ -4709,16 +4696,16 @@ let X = class extends m {
|
|
|
4709
4696
|
*/
|
|
4710
4697
|
renderOptionIcon(e) {
|
|
4711
4698
|
if (!(e != null && e.icon)) return "";
|
|
4712
|
-
const t =
|
|
4699
|
+
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
4700
|
type: t,
|
|
4714
4701
|
alt: o,
|
|
4715
4702
|
isSelected: r
|
|
4716
4703
|
});
|
|
4717
|
-
return
|
|
4704
|
+
return Re(e == null ? void 0 : e.icon) ? c`<span
|
|
4718
4705
|
class="poll-option-icon"
|
|
4719
4706
|
aria-hidden="${s.ariaHidden ? "true" : "false"}"
|
|
4720
4707
|
>${e == null ? void 0 : e.icon}</span
|
|
4721
|
-
>` :
|
|
4708
|
+
>` : Tt(e == null ? void 0 : e.icon) ? c`<img
|
|
4722
4709
|
src="${e == null ? void 0 : e.icon}"
|
|
4723
4710
|
alt="${s.alt}"
|
|
4724
4711
|
class="poll-option-icon-img"
|
|
@@ -4734,7 +4721,7 @@ let X = class extends m {
|
|
|
4734
4721
|
* Renders the selection indicator (checkbox or radio button) with proper ARIA roles
|
|
4735
4722
|
*/
|
|
4736
4723
|
renderSelectionIndicator() {
|
|
4737
|
-
const e = this.multiple ?
|
|
4724
|
+
const e = this.multiple ? L.CHECKBOX : L.RADIO;
|
|
4738
4725
|
return this.multiple ? c`<span class="poll-checkbox" role="${e}"></span>` : c`<span class="poll-radio" role="${e}"></span>`;
|
|
4739
4726
|
}
|
|
4740
4727
|
/**
|
|
@@ -4746,7 +4733,7 @@ let X = class extends m {
|
|
|
4746
4733
|
selected: o,
|
|
4747
4734
|
"poll-option--compact": this.compact,
|
|
4748
4735
|
"poll-option--disabled": r
|
|
4749
|
-
}, i = t + 1, a = `poll-${this.type}-${i}`, l =
|
|
4736
|
+
}, i = t + 1, a = `poll-${this.type}-${i}`, l = Oo(
|
|
4750
4737
|
e.label,
|
|
4751
4738
|
o,
|
|
4752
4739
|
r,
|
|
@@ -4756,7 +4743,7 @@ let X = class extends m {
|
|
|
4756
4743
|
return c`
|
|
4757
4744
|
<button
|
|
4758
4745
|
data-testid="poll-option-i${t}"
|
|
4759
|
-
class="${
|
|
4746
|
+
class="${y(s)}"
|
|
4760
4747
|
@click="${(n) => {
|
|
4761
4748
|
n.stopPropagation(), this.handleClick(e);
|
|
4762
4749
|
}}"
|
|
@@ -4780,13 +4767,13 @@ let X = class extends m {
|
|
|
4780
4767
|
*/
|
|
4781
4768
|
renderPollOptions() {
|
|
4782
4769
|
var s;
|
|
4783
|
-
const e = this.multiple ?
|
|
4770
|
+
const e = this.multiple ? L.GROUP : L.RADIOGROUP, t = this.question || this.name || "Options", o = ot({
|
|
4784
4771
|
role: e,
|
|
4785
4772
|
ariaLabel: t
|
|
4786
4773
|
});
|
|
4787
4774
|
return c`
|
|
4788
4775
|
<div
|
|
4789
|
-
class="${
|
|
4776
|
+
class="${y({
|
|
4790
4777
|
"poll-container": !0
|
|
4791
4778
|
})}"
|
|
4792
4779
|
data-testid="poll-option-container"
|
|
@@ -4802,22 +4789,22 @@ let X = class extends m {
|
|
|
4802
4789
|
*/
|
|
4803
4790
|
renderBarChart() {
|
|
4804
4791
|
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,
|
|
4792
|
+
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) => {
|
|
4793
|
+
const b = e[p.value] || 0, w = o > 0 ? Math.round(b / o * 100) : 0, E = (t[p.value] || 0) > 0;
|
|
4807
4794
|
return {
|
|
4808
4795
|
option: p,
|
|
4809
|
-
index:
|
|
4796
|
+
index: h,
|
|
4810
4797
|
voteCount: b,
|
|
4811
|
-
percentage:
|
|
4812
|
-
isSelected:
|
|
4798
|
+
percentage: w,
|
|
4799
|
+
isSelected: E
|
|
4813
4800
|
};
|
|
4814
|
-
}), s = this.multiple ?
|
|
4801
|
+
}), s = this.multiple ? L.GROUP : L.RADIOGROUP, i = this.question || this.name || "Options", a = ot({
|
|
4815
4802
|
role: s,
|
|
4816
4803
|
ariaLabel: i
|
|
4817
4804
|
});
|
|
4818
4805
|
return c`
|
|
4819
4806
|
<div
|
|
4820
|
-
class="${
|
|
4807
|
+
class="${y({
|
|
4821
4808
|
"poll-container": !0
|
|
4822
4809
|
})}"
|
|
4823
4810
|
data-testid="poll-chart-container"
|
|
@@ -4825,7 +4812,7 @@ let X = class extends m {
|
|
|
4825
4812
|
...=${a}
|
|
4826
4813
|
>
|
|
4827
4814
|
${r.map((p) => {
|
|
4828
|
-
const
|
|
4815
|
+
const h = {
|
|
4829
4816
|
"poll-option": !0,
|
|
4830
4817
|
"poll-option--compact": this.compact,
|
|
4831
4818
|
"poll-option--chart-view": !0,
|
|
@@ -4833,7 +4820,7 @@ let X = class extends m {
|
|
|
4833
4820
|
};
|
|
4834
4821
|
return c`
|
|
4835
4822
|
<div
|
|
4836
|
-
class="${
|
|
4823
|
+
class="${y(h)}"
|
|
4837
4824
|
data-testid="poll-chart-item-${p.index}"
|
|
4838
4825
|
role="listitem"
|
|
4839
4826
|
aria-label="${p.option.label}: ${p.percentage}% (${p.voteCount} votes)"
|
|
@@ -4904,7 +4891,7 @@ let X = class extends m {
|
|
|
4904
4891
|
* Shows add icon when no selection, edit icon when user has submitted
|
|
4905
4892
|
*/
|
|
4906
4893
|
renderInlineTrigger() {
|
|
4907
|
-
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ?
|
|
4894
|
+
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? Ct : Oe;
|
|
4908
4895
|
return c`
|
|
4909
4896
|
<button
|
|
4910
4897
|
class="pc-inline-trigger"
|
|
@@ -4963,7 +4950,7 @@ let X = class extends m {
|
|
|
4963
4950
|
aria-label="Close"
|
|
4964
4951
|
data-testid="popover-close-button"
|
|
4965
4952
|
>
|
|
4966
|
-
${
|
|
4953
|
+
${Pt}
|
|
4967
4954
|
</button>
|
|
4968
4955
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
4969
4956
|
${e ? this.renderBarChart() : this.renderPollOptions()}
|
|
@@ -4980,7 +4967,7 @@ let X = class extends m {
|
|
|
4980
4967
|
@keydown=${(s) => {
|
|
4981
4968
|
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), this.handlePopoverEditClick());
|
|
4982
4969
|
}}
|
|
4983
|
-
>${
|
|
4970
|
+
>${Ct}</span
|
|
4984
4971
|
>` : u}
|
|
4985
4972
|
</div>` : u}
|
|
4986
4973
|
</div>
|
|
@@ -5037,25 +5024,25 @@ let X = class extends m {
|
|
|
5037
5024
|
* Render standard mode - original behavior
|
|
5038
5025
|
*/
|
|
5039
5026
|
renderStandardMode() {
|
|
5040
|
-
const e =
|
|
5027
|
+
const e = O(this.questionPosition, this.questionAlign), t = {
|
|
5041
5028
|
[`pc-flex-pos-${this.questionPosition}`]: !0,
|
|
5042
5029
|
[`pc-flex-align-${e}`]: !0
|
|
5043
|
-
}, o =
|
|
5030
|
+
}, o = O(this.statsPosition, this.statsAlign), r = {
|
|
5044
5031
|
"pc-body": !0,
|
|
5045
5032
|
[`pc-flex-pos-${this.statsPosition}`]: !0,
|
|
5046
5033
|
[`pc-flex-align-${o}`]: !0
|
|
5047
|
-
}, s =
|
|
5048
|
-
role:
|
|
5034
|
+
}, s = ot({
|
|
5035
|
+
role: L.REGION,
|
|
5049
5036
|
ariaLabel: this.question || this.name || "Poll"
|
|
5050
5037
|
});
|
|
5051
5038
|
return c`
|
|
5052
5039
|
<div
|
|
5053
|
-
class="pc-container ${
|
|
5040
|
+
class="pc-container ${y(t)}"
|
|
5054
5041
|
data-testid="poll-container"
|
|
5055
5042
|
...=${s}
|
|
5056
5043
|
>
|
|
5057
5044
|
${this.renderLabelAtStart()}
|
|
5058
|
-
<div class="${
|
|
5045
|
+
<div class="${y(r)}" data-testid="poll-body">
|
|
5059
5046
|
${this.renderContent()} ${this.renderFooter()}
|
|
5060
5047
|
</div>
|
|
5061
5048
|
${this.renderLabelAtEnd()}
|
|
@@ -5066,15 +5053,15 @@ let X = class extends m {
|
|
|
5066
5053
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
5067
5054
|
}
|
|
5068
5055
|
};
|
|
5069
|
-
X.styles = [...m.styles,
|
|
5056
|
+
X.styles = [...m.styles, _t, hr];
|
|
5070
5057
|
mt([
|
|
5071
|
-
|
|
5058
|
+
f({ type: Boolean })
|
|
5072
5059
|
], X.prototype, "multiple", 2);
|
|
5073
5060
|
mt([
|
|
5074
|
-
|
|
5061
|
+
f({ type: Boolean })
|
|
5075
5062
|
], X.prototype, "compact", 2);
|
|
5076
5063
|
mt([
|
|
5077
|
-
|
|
5064
|
+
k()
|
|
5078
5065
|
], X.prototype, "popoverOpen", 2);
|
|
5079
5066
|
mt([
|
|
5080
5067
|
ft(".pc-inline-trigger")
|
|
@@ -5082,7 +5069,7 @@ mt([
|
|
|
5082
5069
|
X = mt([
|
|
5083
5070
|
F("pc-poll")
|
|
5084
5071
|
], X);
|
|
5085
|
-
const
|
|
5072
|
+
const mr = B`
|
|
5086
5073
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
5087
5074
|
|
|
5088
5075
|
.pc-section {
|
|
@@ -5269,10 +5256,10 @@ const yr = R`
|
|
|
5269
5256
|
* Copyright 2018 Google LLC
|
|
5270
5257
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5271
5258
|
*/
|
|
5272
|
-
const
|
|
5259
|
+
const Ye = "important", vr = " !" + Ye, br = He(class extends Fe {
|
|
5273
5260
|
constructor(e) {
|
|
5274
5261
|
var t;
|
|
5275
|
-
if (super(e), e.type !==
|
|
5262
|
+
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
5263
|
}
|
|
5277
5264
|
render(e) {
|
|
5278
5265
|
return Object.keys(e).reduce((t, o) => {
|
|
@@ -5288,11 +5275,11 @@ const We = "important", wr = " !" + We, xr = Fe(class extends Ye {
|
|
|
5288
5275
|
const s = t[r];
|
|
5289
5276
|
if (s != null) {
|
|
5290
5277
|
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 ?
|
|
5278
|
+
const i = typeof s == "string" && s.endsWith(vr);
|
|
5279
|
+
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? Ye : "") : o[r] = s;
|
|
5293
5280
|
}
|
|
5294
5281
|
}
|
|
5295
|
-
return
|
|
5282
|
+
return q;
|
|
5296
5283
|
}
|
|
5297
5284
|
});
|
|
5298
5285
|
function wt(e, t = {}) {
|
|
@@ -5324,7 +5311,7 @@ function wt(e, t = {}) {
|
|
|
5324
5311
|
</div>
|
|
5325
5312
|
`;
|
|
5326
5313
|
}
|
|
5327
|
-
const
|
|
5314
|
+
const Se = {
|
|
5328
5315
|
// Faces
|
|
5329
5316
|
smile: "😊",
|
|
5330
5317
|
laugh: "😄",
|
|
@@ -5467,19 +5454,19 @@ const $e = {
|
|
|
5467
5454
|
hiking: "🥾",
|
|
5468
5455
|
yoga: "🧘"
|
|
5469
5456
|
};
|
|
5470
|
-
function
|
|
5457
|
+
function Et(e) {
|
|
5471
5458
|
let t = "❓", o = !1;
|
|
5472
|
-
return e ? e in
|
|
5459
|
+
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
5460
|
icon: t,
|
|
5474
5461
|
isRemoteImage: o
|
|
5475
5462
|
};
|
|
5476
5463
|
}
|
|
5477
|
-
var
|
|
5478
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
5464
|
+
var yr = Object.defineProperty, xr = Object.getOwnPropertyDescriptor, it = (e, t, o, r) => {
|
|
5465
|
+
for (var s = r > 1 ? void 0 : r ? xr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
5479
5466
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
5480
|
-
return r && s &&
|
|
5467
|
+
return r && s && yr(t, o, s), s;
|
|
5481
5468
|
};
|
|
5482
|
-
let
|
|
5469
|
+
let H = class extends m {
|
|
5483
5470
|
constructor() {
|
|
5484
5471
|
super(), this.type = $.stars, this.icon = "★", this.numStars = 5, this.hoverValue = -1, this.popoverOpen = !1, this.handleStarKeyDown = (e) => {
|
|
5485
5472
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -5502,14 +5489,14 @@ let q = class extends m {
|
|
|
5502
5489
|
* Renders the star icon using resolveIcon for emoji, URL, or MDI support
|
|
5503
5490
|
*/
|
|
5504
5491
|
renderStarIcon() {
|
|
5505
|
-
const { icon: e, isRemoteImage: t } =
|
|
5492
|
+
const { icon: e, isRemoteImage: t } = Et(this.icon);
|
|
5506
5493
|
return t ? c`<img class="star-icon-img" src="${e}" alt="star" />` : e;
|
|
5507
5494
|
}
|
|
5508
5495
|
/**
|
|
5509
5496
|
* Gets the resolved icon string (for use in chart labels)
|
|
5510
5497
|
*/
|
|
5511
5498
|
getResolvedIconString() {
|
|
5512
|
-
const { icon: e, isRemoteImage: t } =
|
|
5499
|
+
const { icon: e, isRemoteImage: t } = Et(this.icon);
|
|
5513
5500
|
return t ? "★" : e;
|
|
5514
5501
|
}
|
|
5515
5502
|
/**
|
|
@@ -5520,22 +5507,22 @@ let q = class extends m {
|
|
|
5520
5507
|
renderStars(e = !1) {
|
|
5521
5508
|
var n;
|
|
5522
5509
|
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),
|
|
5510
|
+
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
5511
|
star: !0,
|
|
5525
|
-
selected:
|
|
5512
|
+
selected: h,
|
|
5526
5513
|
partial: b,
|
|
5527
5514
|
"view-mode": !a
|
|
5528
|
-
},
|
|
5515
|
+
}, E = b ? { "--partial-fill": `${i % 1 * 100}%` } : {}, C = e ? () => this.handlePopoverStarClick(d) : () => this.handleStarClick(d);
|
|
5529
5516
|
return c`
|
|
5530
5517
|
<div class="pc-section" data-testid="pc-section">
|
|
5531
5518
|
<span
|
|
5532
5519
|
data-testid="${e ? "popover" : "stars-view"}-star-${d}"
|
|
5533
|
-
class=${w
|
|
5534
|
-
style=${
|
|
5520
|
+
class=${y(w)}
|
|
5521
|
+
style=${br(E)}
|
|
5535
5522
|
role="${a ? "button" : "presentation"}"
|
|
5536
5523
|
tabindex="${a ? "0" : ""}"
|
|
5537
5524
|
aria-label="${a ? `Rate ${d} star${d > 1 ? "s" : ""}` : ""}"
|
|
5538
|
-
@click="${
|
|
5525
|
+
@click="${C}"
|
|
5539
5526
|
@mouseenter="${() => this.handleStarHover(d)}"
|
|
5540
5527
|
@focus="${() => this.handleStarHover(d)}"
|
|
5541
5528
|
@mouseleave="${this.handleStarLeave}"
|
|
@@ -5626,7 +5613,7 @@ let q = class extends m {
|
|
|
5626
5613
|
};
|
|
5627
5614
|
return c`
|
|
5628
5615
|
<button
|
|
5629
|
-
class=${
|
|
5616
|
+
class=${y(i)}
|
|
5630
5617
|
@click=${() => {
|
|
5631
5618
|
this.popoverOpen = !0;
|
|
5632
5619
|
}}
|
|
@@ -5659,7 +5646,7 @@ let q = class extends m {
|
|
|
5659
5646
|
aria-label="Close"
|
|
5660
5647
|
data-testid="popover-close-button"
|
|
5661
5648
|
>
|
|
5662
|
-
${
|
|
5649
|
+
${Pt}
|
|
5663
5650
|
</button>
|
|
5664
5651
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
5665
5652
|
${this.renderStars(!0)}
|
|
@@ -5708,7 +5695,7 @@ let q = class extends m {
|
|
|
5708
5695
|
@keydown="${(e) => {
|
|
5709
5696
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
|
|
5710
5697
|
}}"
|
|
5711
|
-
>${this.displayController.isChartVisible ?
|
|
5698
|
+
>${this.displayController.isChartVisible ? Zt : Gt}</span
|
|
5712
5699
|
>
|
|
5713
5700
|
`;
|
|
5714
5701
|
}
|
|
@@ -5766,18 +5753,18 @@ let q = class extends m {
|
|
|
5766
5753
|
* Render standard mode - original behavior
|
|
5767
5754
|
*/
|
|
5768
5755
|
renderStandardMode() {
|
|
5769
|
-
const e =
|
|
5756
|
+
const e = O(this.questionPosition, this.questionAlign), t = {
|
|
5770
5757
|
[`pc-flex-pos-${this.questionPosition}`]: !0,
|
|
5771
5758
|
[`pc-flex-align-${e}`]: !0
|
|
5772
|
-
}, o =
|
|
5759
|
+
}, o = O(this.statsPosition, this.statsAlign), r = {
|
|
5773
5760
|
"pc-body": !0,
|
|
5774
5761
|
[`pc-flex-pos-${this.statsPosition}`]: !0,
|
|
5775
5762
|
[`pc-flex-align-${o}`]: !0
|
|
5776
5763
|
}, s = !this.displayController.shouldShowChart();
|
|
5777
5764
|
return c`
|
|
5778
|
-
<div class="pc-container ${
|
|
5765
|
+
<div class="pc-container ${y(t)}" data-testid="pc-container">
|
|
5779
5766
|
${this.renderLabelAtStart()}
|
|
5780
|
-
<div class="${
|
|
5767
|
+
<div class="${y(r)}" data-testid="stars-body">
|
|
5781
5768
|
${this.renderStatusAtStart()} ${this.renderChart()}
|
|
5782
5769
|
${s ? this.renderStars() : u} ${this.renderStatusAtEnd()}
|
|
5783
5770
|
</div>
|
|
@@ -5789,26 +5776,26 @@ let q = class extends m {
|
|
|
5789
5776
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
5790
5777
|
}
|
|
5791
5778
|
};
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
],
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
],
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
],
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
],
|
|
5805
|
-
|
|
5779
|
+
H.styles = [...m.styles, _t, mr];
|
|
5780
|
+
it([
|
|
5781
|
+
f({ type: String })
|
|
5782
|
+
], H.prototype, "icon", 2);
|
|
5783
|
+
it([
|
|
5784
|
+
f({ type: Number, attribute: "num-stars" })
|
|
5785
|
+
], H.prototype, "numStars", 2);
|
|
5786
|
+
it([
|
|
5787
|
+
k()
|
|
5788
|
+
], H.prototype, "hoverValue", 2);
|
|
5789
|
+
it([
|
|
5790
|
+
k()
|
|
5791
|
+
], H.prototype, "popoverOpen", 2);
|
|
5792
|
+
it([
|
|
5806
5793
|
ft(".pc-inline-trigger")
|
|
5807
|
-
],
|
|
5808
|
-
|
|
5794
|
+
], H.prototype, "triggerElement", 2);
|
|
5795
|
+
H = it([
|
|
5809
5796
|
F("pc-stars")
|
|
5810
|
-
],
|
|
5811
|
-
const
|
|
5797
|
+
], H);
|
|
5798
|
+
const wr = B`
|
|
5812
5799
|
/* Adjust stats text for reactions */
|
|
5813
5800
|
.pc-stats-text {
|
|
5814
5801
|
font-size: var(--pc-font-size-small, var(--default-font-size-small));
|
|
@@ -6071,13 +6058,13 @@ const Cr = R`
|
|
|
6071
6058
|
animation: none;
|
|
6072
6059
|
}
|
|
6073
6060
|
}
|
|
6074
|
-
`,
|
|
6075
|
-
var
|
|
6076
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
6061
|
+
`, $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";
|
|
6062
|
+
var Sr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, Ot = (e, t, o, r) => {
|
|
6063
|
+
for (var s = r > 1 ? void 0 : r ? Cr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
6077
6064
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
6078
|
-
return r && s &&
|
|
6065
|
+
return r && s && Sr(t, o, s), s;
|
|
6079
6066
|
};
|
|
6080
|
-
let
|
|
6067
|
+
let st = class extends m {
|
|
6081
6068
|
constructor() {
|
|
6082
6069
|
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
6070
|
}
|
|
@@ -6101,7 +6088,7 @@ let rt = class extends m {
|
|
|
6101
6088
|
* Renders the icon for a reaction
|
|
6102
6089
|
*/
|
|
6103
6090
|
renderReactionIcon(e, t) {
|
|
6104
|
-
const { icon: o, isRemoteImage: r } =
|
|
6091
|
+
const { icon: o, isRemoteImage: r } = Et(e), s = Jt.FUNCTIONAL, i = t.tooltip || `${t.value} reaction`, a = je(o, {
|
|
6105
6092
|
type: s,
|
|
6106
6093
|
alt: i,
|
|
6107
6094
|
ariaLabel: i,
|
|
@@ -6128,7 +6115,7 @@ let rt = class extends m {
|
|
|
6128
6115
|
}, l = `${e.tooltip || e.value} reaction${o ? ", selected" : ""}${t ? `, ${r} votes` : ""}`;
|
|
6129
6116
|
return c`
|
|
6130
6117
|
<button
|
|
6131
|
-
class="${
|
|
6118
|
+
class="${y(a)}"
|
|
6132
6119
|
@click="${() => this.handleReactionClick(e)}"
|
|
6133
6120
|
?disabled="${s}"
|
|
6134
6121
|
aria-pressed="${o}"
|
|
@@ -6155,7 +6142,7 @@ let rt = class extends m {
|
|
|
6155
6142
|
aria-expanded="${this.displayController.shouldShowReactionPopover()}"
|
|
6156
6143
|
aria-haspopup="true"
|
|
6157
6144
|
>
|
|
6158
|
-
<img src="${
|
|
6145
|
+
<img src="${$r}" alt="" class="trigger-icon" />
|
|
6159
6146
|
</button>
|
|
6160
6147
|
`;
|
|
6161
6148
|
}
|
|
@@ -6170,7 +6157,7 @@ let rt = class extends m {
|
|
|
6170
6157
|
bottom: this.popupPosition === "bottom" || this.popupPosition === "auto" && !this.shouldShowPopoverOnTop()
|
|
6171
6158
|
};
|
|
6172
6159
|
return c`
|
|
6173
|
-
<div class="${
|
|
6160
|
+
<div class="${y(e)}" role="menu">
|
|
6174
6161
|
<div class="popover-content">
|
|
6175
6162
|
${this.options.map((t) => {
|
|
6176
6163
|
const o = this.displayController.shouldDisableOption(t);
|
|
@@ -6217,7 +6204,7 @@ let rt = class extends m {
|
|
|
6217
6204
|
(o) => this.dataController.isValueSelected(o.value)
|
|
6218
6205
|
);
|
|
6219
6206
|
return c`
|
|
6220
|
-
<div class="${
|
|
6207
|
+
<div class="${y(e)}">
|
|
6221
6208
|
${t.length > 0 ? c`
|
|
6222
6209
|
<div class="reaction-list">
|
|
6223
6210
|
${t.map(
|
|
@@ -6230,7 +6217,7 @@ let rt = class extends m {
|
|
|
6230
6217
|
`;
|
|
6231
6218
|
} else
|
|
6232
6219
|
return c`
|
|
6233
|
-
<div class="${
|
|
6220
|
+
<div class="${y(e)}">
|
|
6234
6221
|
<div class="reaction-list">
|
|
6235
6222
|
${this.options.map((t) => this.renderReactionButton(t, this.showCounts))}
|
|
6236
6223
|
</div>
|
|
@@ -6245,7 +6232,7 @@ let rt = class extends m {
|
|
|
6245
6232
|
const e = this.dataController.getBreakdownInfo(), o = Object.entries(e.breakdownCount).filter(
|
|
6246
6233
|
([n, d]) => this.options.some((p) => p.value === n)
|
|
6247
6234
|
).map(([n, d]) => {
|
|
6248
|
-
const p = this.options.find((
|
|
6235
|
+
const p = this.options.find((h) => h.value === n);
|
|
6249
6236
|
return {
|
|
6250
6237
|
label: n,
|
|
6251
6238
|
// Use the reaction value as label
|
|
@@ -6294,18 +6281,18 @@ let rt = class extends m {
|
|
|
6294
6281
|
* (Reactions are inherently inline, so inline mode = standard mode)
|
|
6295
6282
|
*/
|
|
6296
6283
|
renderStandardMode() {
|
|
6297
|
-
const e =
|
|
6284
|
+
const e = O(this.questionPosition, this.questionAlign), t = {
|
|
6298
6285
|
[`pc-flex-pos-${this.questionPosition}`]: !0,
|
|
6299
6286
|
[`pc-flex-align-${e}`]: !0
|
|
6300
|
-
}, o =
|
|
6287
|
+
}, o = O(this.statsPosition, this.statsAlign), r = {
|
|
6301
6288
|
"pc-body": !0,
|
|
6302
6289
|
[`pc-flex-pos-${this.statsPosition}`]: !0,
|
|
6303
6290
|
[`pc-flex-align-${o}`]: !0
|
|
6304
6291
|
};
|
|
6305
6292
|
return c`
|
|
6306
|
-
<div class="${
|
|
6293
|
+
<div class="${y(t)}" data-testid="reaction-container">
|
|
6307
6294
|
${this.renderLabelAtStart()}
|
|
6308
|
-
<div class="${
|
|
6295
|
+
<div class="${y(r)}" data-testid="reaction-body">
|
|
6309
6296
|
${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderReactions()}
|
|
6310
6297
|
${this.renderStatusAtEnd()}
|
|
6311
6298
|
</div>
|
|
@@ -6317,35 +6304,35 @@ let rt = class extends m {
|
|
|
6317
6304
|
return this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
6318
6305
|
}
|
|
6319
6306
|
};
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
],
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
],
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
],
|
|
6330
|
-
|
|
6307
|
+
st.styles = [...m.styles, _t, wr];
|
|
6308
|
+
Ot([
|
|
6309
|
+
f({ type: Boolean, attribute: "show-counts" })
|
|
6310
|
+
], st.prototype, "showCounts", 2);
|
|
6311
|
+
Ot([
|
|
6312
|
+
f({ type: Boolean, reflect: !0 })
|
|
6313
|
+
], st.prototype, "compact", 2);
|
|
6314
|
+
Ot([
|
|
6315
|
+
f({ type: String, attribute: "popup-position" })
|
|
6316
|
+
], st.prototype, "popupPosition", 2);
|
|
6317
|
+
st = Ot([
|
|
6331
6318
|
F("pc-reaction")
|
|
6332
|
-
],
|
|
6319
|
+
], st);
|
|
6333
6320
|
function nt(e, t, o = void 0) {
|
|
6334
6321
|
const r = e.getAttribute(t);
|
|
6335
6322
|
return r === null ? o : r == null ? void 0 : r.trim();
|
|
6336
6323
|
}
|
|
6337
|
-
function
|
|
6324
|
+
function kr(e, t = void 0) {
|
|
6338
6325
|
const o = e.textContent;
|
|
6339
6326
|
return o === "" || o === null ? t : o == null ? void 0 : o.trim();
|
|
6340
6327
|
}
|
|
6341
|
-
var
|
|
6342
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
6328
|
+
var Er = Object.defineProperty, Ar = Object.getOwnPropertyDescriptor, vt = (e, t, o, r) => {
|
|
6329
|
+
for (var s = r > 1 ? void 0 : r ? Ar(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
6343
6330
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
6344
|
-
return r && s &&
|
|
6331
|
+
return r && s && Er(t, o, s), s;
|
|
6345
6332
|
};
|
|
6346
|
-
let
|
|
6333
|
+
let J = class extends D {
|
|
6347
6334
|
constructor() {
|
|
6348
|
-
super(), this.options = "", this.parsedOptions = [],
|
|
6335
|
+
super(), this.options = "", this.parsedOptions = [], J.injectGlobalStyle();
|
|
6349
6336
|
}
|
|
6350
6337
|
/**
|
|
6351
6338
|
* Inject global style to hide poll-catch-option elements
|
|
@@ -6369,9 +6356,6 @@ let H = class extends N {
|
|
|
6369
6356
|
createRenderRoot() {
|
|
6370
6357
|
return this;
|
|
6371
6358
|
}
|
|
6372
|
-
connectedCallback() {
|
|
6373
|
-
super.connectedCallback(), this.widgetId && (this.type = void 0, this.prefetchWidgetConfig());
|
|
6374
|
-
}
|
|
6375
6359
|
forceUpdate() {
|
|
6376
6360
|
this.forwardAttributesToWidget(), this.forwardOptionsToWidget();
|
|
6377
6361
|
}
|
|
@@ -6388,35 +6372,6 @@ let H = class extends N {
|
|
|
6388
6372
|
updated(e) {
|
|
6389
6373
|
this.forwardAttributesToWidget(), (e.has("type") || e.has("options")) && this.forwardOptionsToWidget();
|
|
6390
6374
|
}
|
|
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
6375
|
/**
|
|
6421
6376
|
* Forward all attributes except 'type' to the child widget
|
|
6422
6377
|
*/
|
|
@@ -6434,17 +6389,17 @@ let H = class extends N {
|
|
|
6434
6389
|
const e = this.querySelector("pc-poll, pc-reaction");
|
|
6435
6390
|
if (!e) return;
|
|
6436
6391
|
const t = this.querySelectorAll("poll-catch-option");
|
|
6437
|
-
let r =
|
|
6392
|
+
let r = Be(this.options).map((s) => ({
|
|
6438
6393
|
value: s,
|
|
6439
6394
|
label: s,
|
|
6440
6395
|
icon: e.tagName === "PC-REACTION" ? s : void 0
|
|
6441
6396
|
// REACTION widget uses options for the icon
|
|
6442
6397
|
}));
|
|
6443
6398
|
t && t.length > 0 && (r = Array.from(t).map((s) => {
|
|
6444
|
-
const i = nt(s, "value", "") || "", a = nt(s, "label",
|
|
6399
|
+
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
6400
|
if (l !== void 0) {
|
|
6446
|
-
const
|
|
6447
|
-
p.icon =
|
|
6401
|
+
const h = Et(l);
|
|
6402
|
+
p.icon = h.icon;
|
|
6448
6403
|
}
|
|
6449
6404
|
return n !== void 0 && (p.tooltip = n), d !== void 0 && (p.disabled = !0), p;
|
|
6450
6405
|
})), this.parsedOptions = r;
|
|
@@ -6453,8 +6408,6 @@ let H = class extends N {
|
|
|
6453
6408
|
* Render the appropriate widget based on the type
|
|
6454
6409
|
*/
|
|
6455
6410
|
render() {
|
|
6456
|
-
if (this.isPrefetching)
|
|
6457
|
-
return u;
|
|
6458
6411
|
switch (this.type) {
|
|
6459
6412
|
case $.nps:
|
|
6460
6413
|
return c`<pc-nps></pc-nps>`;
|
|
@@ -6465,30 +6418,27 @@ let H = class extends N {
|
|
|
6465
6418
|
case $.reaction:
|
|
6466
6419
|
return c`<pc-reaction .options=${this.parsedOptions}></pc-reaction>`;
|
|
6467
6420
|
default:
|
|
6468
|
-
return
|
|
6421
|
+
return console.warn(
|
|
6469
6422
|
`poll-catch: Unknown widget type "${this.type}". Supported types: nps, poll, stars, reaction.`
|
|
6470
6423
|
), u;
|
|
6471
6424
|
}
|
|
6472
6425
|
}
|
|
6473
6426
|
};
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
],
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
],
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
],
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
],
|
|
6486
|
-
|
|
6487
|
-
C()
|
|
6488
|
-
], H.prototype, "isPrefetching", 2);
|
|
6489
|
-
H = it([
|
|
6427
|
+
vt([
|
|
6428
|
+
f({ type: String })
|
|
6429
|
+
], J.prototype, "type", 2);
|
|
6430
|
+
vt([
|
|
6431
|
+
f({ type: String })
|
|
6432
|
+
], J.prototype, "options", 2);
|
|
6433
|
+
vt([
|
|
6434
|
+
f({ type: String, attribute: "widget-id" })
|
|
6435
|
+
], J.prototype, "widgetId", 2);
|
|
6436
|
+
vt([
|
|
6437
|
+
k()
|
|
6438
|
+
], J.prototype, "parsedOptions", 2);
|
|
6439
|
+
J = vt([
|
|
6490
6440
|
F("poll-catch")
|
|
6491
|
-
],
|
|
6441
|
+
], J);
|
|
6492
6442
|
export {
|
|
6493
|
-
|
|
6443
|
+
J as PollCatch
|
|
6494
6444
|
};
|