pollcatch 2.3.4 → 2.4.0
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 +612 -568
package/pc.js
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
7
|
-
let
|
|
6
|
+
const wt = globalThis, Yt = wt.ShadowRoot && (wt.ShadyCSS === void 0 || wt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Kt = Symbol(), ee = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
let Ee = class {
|
|
8
8
|
constructor(t, o, r) {
|
|
9
|
-
if (this._$cssResult$ = !0, r !==
|
|
9
|
+
if (this._$cssResult$ = !0, r !== Kt) 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 (Yt && t === void 0) {
|
|
16
16
|
const r = o !== void 0 && o.length === 1;
|
|
17
|
-
r && (t =
|
|
17
|
+
r && (t = ee.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && ee.set(o, t));
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
}
|
|
@@ -22,33 +22,33 @@ let Se = class {
|
|
|
22
22
|
return this.cssText;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const Fe = (e) => new Ee(typeof e == "string" ? e : e + "", void 0, Kt), 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 Ee(o, e, Kt);
|
|
32
|
+
}, Ye = (e, t) => {
|
|
33
|
+
if (Yt) 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 = wt.litNonce;
|
|
36
36
|
s !== void 0 && r.setAttribute("nonce", s), r.textContent = o.cssText, e.appendChild(r);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, oe = Yt ? (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 Fe(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: Ke, defineProperty: We, getOwnPropertyDescriptor: Ge, getOwnPropertyNames: Ze, getOwnPropertySymbols: Je, getPrototypeOf: Xe } = Object, q = globalThis, re = q.trustedTypes, Qe = re ? re.emptyScript : "", Mt = q.reactiveElementPolyfillSupport, dt = (e, t) => e, St = { toAttribute(e, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
|
-
e = e ?
|
|
51
|
+
e = e ? Qe : null;
|
|
52
52
|
break;
|
|
53
53
|
case Object:
|
|
54
54
|
case Array:
|
|
@@ -73,23 +73,23 @@ const { is: Fe, defineProperty: Ye, getOwnPropertyDescriptor: Ke, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return o;
|
|
76
|
-
} },
|
|
77
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
78
|
-
let
|
|
76
|
+
} }, Wt = (e, t) => !Ke(e, t), se = { attribute: !0, type: String, converter: St, reflect: !1, hasChanged: Wt };
|
|
77
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), q.litPropertyMetadata ?? (q.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
|
+
let ot = class extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
81
81
|
}
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(t, o =
|
|
85
|
+
static createProperty(t, o = se) {
|
|
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 && We(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 } = Ge(this.prototype, t) ?? { get() {
|
|
93
93
|
return this[o];
|
|
94
94
|
}, set(a) {
|
|
95
95
|
this[o] = a;
|
|
@@ -102,17 +102,17 @@ let Q = class extends HTMLElement {
|
|
|
102
102
|
}, configurable: !0, enumerable: !0 };
|
|
103
103
|
}
|
|
104
104
|
static getPropertyOptions(t) {
|
|
105
|
-
return this.elementProperties.get(t) ??
|
|
105
|
+
return this.elementProperties.get(t) ?? se;
|
|
106
106
|
}
|
|
107
107
|
static _$Ei() {
|
|
108
|
-
if (this.hasOwnProperty(
|
|
109
|
-
const t =
|
|
108
|
+
if (this.hasOwnProperty(dt("elementProperties"))) return;
|
|
109
|
+
const t = Xe(this);
|
|
110
110
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
111
111
|
}
|
|
112
112
|
static finalize() {
|
|
113
|
-
if (this.hasOwnProperty(
|
|
114
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
115
|
-
const o = this.properties, r = [...
|
|
113
|
+
if (this.hasOwnProperty(dt("finalized"))) return;
|
|
114
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(dt("properties"))) {
|
|
115
|
+
const o = this.properties, r = [...Ze(o), ...Je(o)];
|
|
116
116
|
for (const s of r) this.createProperty(s, o[s]);
|
|
117
117
|
}
|
|
118
118
|
const t = this[Symbol.metadata];
|
|
@@ -131,8 +131,8 @@ let Q = class extends HTMLElement {
|
|
|
131
131
|
const o = [];
|
|
132
132
|
if (Array.isArray(t)) {
|
|
133
133
|
const r = new Set(t.flat(1 / 0).reverse());
|
|
134
|
-
for (const s of r) o.unshift(
|
|
135
|
-
} else t !== void 0 && o.push(
|
|
134
|
+
for (const s of r) o.unshift(oe(s));
|
|
135
|
+
} else t !== void 0 && o.push(oe(t));
|
|
136
136
|
return o;
|
|
137
137
|
}
|
|
138
138
|
static _$Eu(t, o) {
|
|
@@ -161,7 +161,7 @@ let Q = class extends HTMLElement {
|
|
|
161
161
|
}
|
|
162
162
|
createRenderRoot() {
|
|
163
163
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
164
|
-
return
|
|
164
|
+
return Ye(t, this.constructor.elementStyles), t;
|
|
165
165
|
}
|
|
166
166
|
connectedCallback() {
|
|
167
167
|
var t;
|
|
@@ -186,7 +186,7 @@ let Q = 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 : St).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 Q = 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 : St;
|
|
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 ?? Wt)(this[t], o)) return;
|
|
204
204
|
this.P(t, o, r);
|
|
205
205
|
}
|
|
206
206
|
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
@@ -273,76 +273,76 @@ let Q = class extends HTMLElement {
|
|
|
273
273
|
firstUpdated(t) {
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
|
-
|
|
276
|
+
ot.elementStyles = [], ot.shadowRootOptions = { mode: "open" }, ot[dt("elementProperties")] = /* @__PURE__ */ new Map(), ot[dt("finalized")] = /* @__PURE__ */ new Map(), Mt == null || Mt({ ReactiveElement: ot }), (q.reactiveElementVersions ?? (q.reactiveElementVersions = [])).push("2.0.4");
|
|
277
277
|
/**
|
|
278
278
|
* @license
|
|
279
279
|
* Copyright 2017 Google LLC
|
|
280
280
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
281
281
|
*/
|
|
282
|
-
const
|
|
283
|
-
\f\r]`,
|
|
284
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
285
|
-
function
|
|
286
|
-
if (!
|
|
287
|
-
return
|
|
282
|
+
const pt = globalThis, Ct = pt.trustedTypes, ie = Ct ? Ct.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Ae = "$lit$", j = `lit$${Math.random().toFixed(9).slice(2)}$`, Pe = "?" + j, to = `<${Pe}>`, J = document, ht = () => J.createComment(""), ft = (e) => e === null || typeof e != "object" && typeof e != "function", Gt = Array.isArray, eo = (e) => Gt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", Lt = `[
|
|
283
|
+
\f\r]`, lt = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ae = /-->/g, ne = />/g, G = RegExp(`>|${Lt}(?:([^\\s"'>=/]+)(${Lt}*=${Lt}*(?:[^
|
|
284
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), le = /'/g, ce = /"/g, Te = /^(?:script|style|textarea|title)$/i, oo = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), c = oo(1), H = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), de = /* @__PURE__ */ new WeakMap(), Z = J.createTreeWalker(J, 129);
|
|
285
|
+
function _e(e, t) {
|
|
286
|
+
if (!Gt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
287
|
+
return ie !== void 0 ? ie.createHTML(t) : t;
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const ro = (e, t) => {
|
|
290
290
|
const o = e.length - 1, r = [];
|
|
291
|
-
let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a =
|
|
291
|
+
let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = lt;
|
|
292
292
|
for (let l = 0; l < o; l++) {
|
|
293
293
|
const n = e[l];
|
|
294
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 ===
|
|
296
|
-
const x = a ===
|
|
297
|
-
i += a ===
|
|
295
|
+
for (; b < n.length && (a.lastIndex = b, p = a.exec(n), p !== null); ) b = a.lastIndex, a === lt ? p[1] === "!--" ? a = ae : p[1] !== void 0 ? a = ne : p[2] !== void 0 ? (Te.test(p[2]) && (s = RegExp("</" + p[2], "g")), a = G) : p[3] !== void 0 && (a = G) : a === G ? p[0] === ">" ? (a = s ?? lt, h = -1) : p[1] === void 0 ? h = -2 : (h = a.lastIndex - p[2].length, d = p[1], a = p[3] === void 0 ? G : p[3] === '"' ? ce : le) : a === ce || a === le ? a = G : a === ae || a === ne ? a = lt : (a = G, s = void 0);
|
|
296
|
+
const x = a === G && e[l + 1].startsWith("/>") ? " " : "";
|
|
297
|
+
i += a === lt ? n + to : h >= 0 ? (r.push(d), n.slice(0, h) + Ae + n.slice(h) + j + x) : n + j + (h === -2 ? l : x);
|
|
298
298
|
}
|
|
299
|
-
return [
|
|
299
|
+
return [_e(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
|
|
300
300
|
};
|
|
301
|
-
let
|
|
301
|
+
let Ft = class Oe {
|
|
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 =
|
|
306
|
+
const l = t.length - 1, n = this.parts, [d, p] = ro(t, o);
|
|
307
|
+
if (this.el = Oe.createElement(d, r), Z.currentNode = this.el.content, o === 2 || o === 3) {
|
|
308
308
|
const h = this.el.content.firstChild;
|
|
309
309
|
h.replaceWith(...h.childNodes);
|
|
310
310
|
}
|
|
311
|
-
for (; (s =
|
|
311
|
+
for (; (s = Z.nextNode()) !== null && n.length < l; ) {
|
|
312
312
|
if (s.nodeType === 1) {
|
|
313
|
-
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(
|
|
314
|
-
const b = p[a++], x = s.getAttribute(h).split(
|
|
315
|
-
n.push({ type: 1, index: i, name: E[2], strings: x, ctor: E[1] === "." ?
|
|
316
|
-
} else h.startsWith(
|
|
317
|
-
if (
|
|
318
|
-
const h = s.textContent.split(
|
|
313
|
+
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Ae)) {
|
|
314
|
+
const b = p[a++], x = s.getAttribute(h).split(j), E = /([.?@])?(.*)/.exec(b);
|
|
315
|
+
n.push({ type: 1, index: i, name: E[2], strings: x, ctor: E[1] === "." ? io : E[1] === "?" ? ao : E[1] === "@" ? no : Pt }), s.removeAttribute(h);
|
|
316
|
+
} else h.startsWith(j) && (n.push({ type: 6, index: i }), s.removeAttribute(h));
|
|
317
|
+
if (Te.test(s.tagName)) {
|
|
318
|
+
const h = s.textContent.split(j), b = h.length - 1;
|
|
319
319
|
if (b > 0) {
|
|
320
|
-
s.textContent =
|
|
321
|
-
for (let x = 0; x < b; x++) s.append(h[x],
|
|
322
|
-
s.append(h[b],
|
|
320
|
+
s.textContent = Ct ? Ct.emptyScript : "";
|
|
321
|
+
for (let x = 0; x < b; x++) s.append(h[x], ht()), Z.nextNode(), n.push({ type: 2, index: ++i });
|
|
322
|
+
s.append(h[b], ht());
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
} else if (s.nodeType === 8) if (s.data ===
|
|
325
|
+
} else if (s.nodeType === 8) if (s.data === Pe) n.push({ type: 2, index: i });
|
|
326
326
|
else {
|
|
327
327
|
let h = -1;
|
|
328
|
-
for (; (h = s.data.indexOf(
|
|
328
|
+
for (; (h = s.data.indexOf(j, h + 1)) !== -1; ) n.push({ type: 7, index: i }), h += j.length - 1;
|
|
329
329
|
}
|
|
330
330
|
i++;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
static createElement(t, o) {
|
|
334
|
-
const r =
|
|
334
|
+
const r = J.createElement("template");
|
|
335
335
|
return r.innerHTML = t, r;
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
|
-
function
|
|
338
|
+
function st(e, t, o = e, r) {
|
|
339
339
|
var a, l;
|
|
340
|
-
if (t ===
|
|
340
|
+
if (t === H) return t;
|
|
341
341
|
let s = r !== void 0 ? (a = o._$Co) == null ? void 0 : a[r] : o._$Cl;
|
|
342
|
-
const i =
|
|
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 =
|
|
342
|
+
const i = ft(t) ? void 0 : t._$litDirective$;
|
|
343
|
+
return (s == null ? void 0 : s.constructor) !== i && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), i === void 0 ? s = void 0 : (s = new i(e), s._$AT(e, o, r)), r !== void 0 ? (o._$Co ?? (o._$Co = []))[r] = s : o._$Cl = s), s !== void 0 && (t = st(e, s._$AS(e, t.values), s, r)), t;
|
|
344
344
|
}
|
|
345
|
-
let
|
|
345
|
+
let so = class {
|
|
346
346
|
constructor(t, o) {
|
|
347
347
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = o;
|
|
348
348
|
}
|
|
@@ -353,24 +353,24 @@ let oo = class {
|
|
|
353
353
|
return this._$AM._$AU;
|
|
354
354
|
}
|
|
355
355
|
u(t) {
|
|
356
|
-
const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ??
|
|
357
|
-
|
|
358
|
-
let i =
|
|
356
|
+
const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? J).importNode(o, !0);
|
|
357
|
+
Z.currentNode = s;
|
|
358
|
+
let i = Z.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
|
|
362
|
+
n.type === 2 ? d = new gt(i, i.nextSibling, this, t) : n.type === 1 ? d = new n.ctor(i, n.name, n.strings, this, t) : n.type === 6 && (d = new lo(i, this, t)), this._$AV.push(d), n = r[++l];
|
|
363
363
|
}
|
|
364
|
-
a !== (n == null ? void 0 : n.index) && (i =
|
|
364
|
+
a !== (n == null ? void 0 : n.index) && (i = Z.nextNode(), a++);
|
|
365
365
|
}
|
|
366
|
-
return
|
|
366
|
+
return Z.currentNode = J, s;
|
|
367
367
|
}
|
|
368
368
|
p(t) {
|
|
369
369
|
let o = 0;
|
|
370
370
|
for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, o), o += r.strings.length - 2) : r._$AI(t[o])), o++;
|
|
371
371
|
}
|
|
372
372
|
};
|
|
373
|
-
class
|
|
373
|
+
class gt {
|
|
374
374
|
get _$AU() {
|
|
375
375
|
var t;
|
|
376
376
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
@@ -390,7 +390,7 @@ class ut {
|
|
|
390
390
|
return this._$AB;
|
|
391
391
|
}
|
|
392
392
|
_$AI(t, o = this) {
|
|
393
|
-
t =
|
|
393
|
+
t = st(this, t, o), ft(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : eo(t) ? this.k(t) : this._(t);
|
|
394
394
|
}
|
|
395
395
|
O(t) {
|
|
396
396
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -399,26 +399,26 @@ class ut {
|
|
|
399
399
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
400
400
|
}
|
|
401
401
|
_(t) {
|
|
402
|
-
this._$AH !== u &&
|
|
402
|
+
this._$AH !== u && ft(this._$AH) ? this._$AA.nextSibling.data = t : this.T(J.createTextNode(t)), this._$AH = t;
|
|
403
403
|
}
|
|
404
404
|
$(t) {
|
|
405
405
|
var i;
|
|
406
|
-
const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el =
|
|
406
|
+
const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Ft.createElement(_e(r.h, r.h[0]), this.options)), r);
|
|
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 so(s, this), l = a.u(this.options);
|
|
410
410
|
a.p(o), this.T(l), this._$AH = a;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
_$AC(t) {
|
|
414
|
-
let o =
|
|
415
|
-
return o === void 0 &&
|
|
414
|
+
let o = de.get(t.strings);
|
|
415
|
+
return o === void 0 && de.set(t.strings, o = new Ft(t)), o;
|
|
416
416
|
}
|
|
417
417
|
k(t) {
|
|
418
|
-
|
|
418
|
+
Gt(this._$AH) || (this._$AH = [], this._$AR());
|
|
419
419
|
const o = this._$AH;
|
|
420
420
|
let r, s = 0;
|
|
421
|
-
for (const i of t) s === o.length ? o.push(r = new
|
|
421
|
+
for (const i of t) s === o.length ? o.push(r = new gt(this.O(ht()), this.O(ht()), this, this.options)) : r = o[s], r._$AI(i), s++;
|
|
422
422
|
s < o.length && (this._$AR(r && r._$AB.nextSibling, s), o.length = s);
|
|
423
423
|
}
|
|
424
424
|
_$AR(t = this._$AA.nextSibling, o) {
|
|
@@ -433,7 +433,7 @@ class ut {
|
|
|
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 Pt {
|
|
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 = st(this, t, o, 0), a = !ft(t) || t !== this._$AH && t !== H, a && (this._$AH = t);
|
|
450
450
|
else {
|
|
451
451
|
const l = t;
|
|
452
452
|
let n, d;
|
|
453
|
-
for (t = i[0], n = 0; n < i.length - 1; n++) d =
|
|
453
|
+
for (t = i[0], n = 0; n < i.length - 1; n++) d = st(this, l[r + n], o, n), d === H && (d = this._$AH[n]), a || (a = !ft(d) || d !== this._$AH[n]), d === u ? t = u : t !== u && (t += (d ?? "") + i[n + 1]), this._$AH[n] = d;
|
|
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 io = class extends Pt {
|
|
462
462
|
constructor() {
|
|
463
463
|
super(...arguments), this.type = 3;
|
|
464
464
|
}
|
|
@@ -466,7 +466,7 @@ let ro = class extends Et {
|
|
|
466
466
|
this.element[this.name] = t === u ? void 0 : t;
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
|
-
class
|
|
469
|
+
class ao extends Pt {
|
|
470
470
|
constructor() {
|
|
471
471
|
super(...arguments), this.type = 4;
|
|
472
472
|
}
|
|
@@ -474,12 +474,12 @@ class so extends Et {
|
|
|
474
474
|
this.element.toggleAttribute(this.name, !!t && t !== u);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
class
|
|
477
|
+
class no extends Pt {
|
|
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 = st(this, t, o, 0) ?? u) === H) return;
|
|
483
483
|
const r = this._$AH, s = t === u && r !== u || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, i = t !== u && (r === u || s);
|
|
484
484
|
s && this.element.removeEventListener(this.name, this, r), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
485
485
|
}
|
|
@@ -488,7 +488,7 @@ class io 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 lo {
|
|
492
492
|
constructor(t, o, r) {
|
|
493
493
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = o, this.options = r;
|
|
494
494
|
}
|
|
@@ -496,17 +496,17 @@ class ao {
|
|
|
496
496
|
return this._$AM._$AU;
|
|
497
497
|
}
|
|
498
498
|
_$AI(t) {
|
|
499
|
-
|
|
499
|
+
st(this, t);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
const
|
|
502
|
+
const Nt = pt.litHtmlPolyfillSupport;
|
|
503
|
+
Nt == null || Nt(Ft, gt), (pt.litHtmlVersions ?? (pt.litHtmlVersions = [])).push("3.2.1");
|
|
504
|
+
const co = (e, t, o) => {
|
|
505
505
|
const r = (o == null ? void 0 : o.renderBefore) ?? t;
|
|
506
506
|
let s = r._$litPart$;
|
|
507
507
|
if (s === void 0) {
|
|
508
508
|
const i = (o == null ? void 0 : o.renderBefore) ?? null;
|
|
509
|
-
r._$litPart$ = s = new
|
|
509
|
+
r._$litPart$ = s = new gt(t.insertBefore(ht(), i), i, void 0, o ?? {});
|
|
510
510
|
}
|
|
511
511
|
return s._$AI(e), s;
|
|
512
512
|
};
|
|
@@ -515,7 +515,7 @@ const no = (e, t, o) => {
|
|
|
515
515
|
* Copyright 2017 Google LLC
|
|
516
516
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
517
517
|
*/
|
|
518
|
-
let
|
|
518
|
+
let R = class extends ot {
|
|
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 Q {
|
|
|
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 = co(o, this.renderRoot, this.renderOptions);
|
|
530
530
|
}
|
|
531
531
|
connectedCallback() {
|
|
532
532
|
var t;
|
|
@@ -537,20 +537,20 @@ let N = class extends Q {
|
|
|
537
537
|
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
|
538
538
|
}
|
|
539
539
|
render() {
|
|
540
|
-
return
|
|
540
|
+
return H;
|
|
541
541
|
}
|
|
542
542
|
};
|
|
543
|
-
var
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
|
|
543
|
+
var ke;
|
|
544
|
+
R._$litElement$ = !0, R.finalized = !0, (ke = globalThis.litElementHydrateSupport) == null || ke.call(globalThis, { LitElement: R });
|
|
545
|
+
const Dt = globalThis.litElementPolyfillSupport;
|
|
546
|
+
Dt == null || Dt({ LitElement: R });
|
|
547
547
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
|
548
548
|
/**
|
|
549
549
|
* @license
|
|
550
550
|
* Copyright 2017 Google LLC
|
|
551
551
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
552
552
|
*/
|
|
553
|
-
const
|
|
553
|
+
const Y = (e) => (t, o) => {
|
|
554
554
|
o !== void 0 ? o.addInitializer(() => {
|
|
555
555
|
customElements.define(e, t);
|
|
556
556
|
}) : customElements.define(e, t);
|
|
@@ -560,7 +560,7 @@ const H = (e) => (t, o) => {
|
|
|
560
560
|
* Copyright 2017 Google LLC
|
|
561
561
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
562
562
|
*/
|
|
563
|
-
const
|
|
563
|
+
const po = { attribute: !0, type: String, converter: St, reflect: !1, hasChanged: Wt }, uo = (e = po, t, o) => {
|
|
564
564
|
const { kind: r, metadata: s } = o;
|
|
565
565
|
let i = globalThis.litPropertyMetadata.get(s);
|
|
566
566
|
if (i === void 0 && globalThis.litPropertyMetadata.set(s, i = /* @__PURE__ */ new Map()), i.set(o.name, e), r === "accessor") {
|
|
@@ -582,7 +582,7 @@ const lo = { attribute: !0, type: String, converter: wt, reflect: !1, hasChanged
|
|
|
582
582
|
throw Error("Unsupported decorator location: " + r);
|
|
583
583
|
};
|
|
584
584
|
function f(e) {
|
|
585
|
-
return (t, o) => typeof o == "object" ?
|
|
585
|
+
return (t, o) => typeof o == "object" ? uo(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);
|
|
@@ -600,25 +600,25 @@ function k(e) {
|
|
|
600
600
|
* Copyright 2017 Google LLC
|
|
601
601
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
602
602
|
*/
|
|
603
|
-
const
|
|
603
|
+
const ho = (e, t, o) => (o.configurable = !0, o.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, o), o);
|
|
604
604
|
/**
|
|
605
605
|
* @license
|
|
606
606
|
* Copyright 2017 Google LLC
|
|
607
607
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
608
608
|
*/
|
|
609
|
-
function
|
|
609
|
+
function mt(e, t) {
|
|
610
610
|
return (o, r, s) => {
|
|
611
611
|
const i = (a) => {
|
|
612
612
|
var l;
|
|
613
613
|
return ((l = a.renderRoot) == null ? void 0 : l.querySelector(e)) ?? null;
|
|
614
614
|
};
|
|
615
|
-
return
|
|
615
|
+
return ho(o, r, { get() {
|
|
616
616
|
return i(this);
|
|
617
617
|
} });
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
620
|
var S = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))(S || {});
|
|
621
|
-
const
|
|
621
|
+
const Zt = c`
|
|
622
622
|
<svg
|
|
623
623
|
xmlns="http://www.w3.org/2000/svg"
|
|
624
624
|
height="24px"
|
|
@@ -628,7 +628,7 @@ const Gt = c`
|
|
|
628
628
|
>
|
|
629
629
|
<path d="M640-160v-280h160v280H640Zm-240 0v-640h160v640H400Zm-240 0v-440h160v440H160Z" />
|
|
630
630
|
</svg>
|
|
631
|
-
`,
|
|
631
|
+
`, Jt = c`
|
|
632
632
|
<svg
|
|
633
633
|
xmlns="http://www.w3.org/2000/svg"
|
|
634
634
|
height="24px"
|
|
@@ -640,7 +640,7 @@ const Gt = 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
|
+
`, kt = c`
|
|
644
644
|
<svg
|
|
645
645
|
xmlns="http://www.w3.org/2000/svg"
|
|
646
646
|
height="24px"
|
|
@@ -652,7 +652,7 @@ const Gt = 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
|
+
`, Tt = c`
|
|
656
656
|
<svg
|
|
657
657
|
xmlns="http://www.w3.org/2000/svg"
|
|
658
658
|
width="16"
|
|
@@ -664,7 +664,7 @@ const Gt = 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
|
+
`, Ie = c`
|
|
668
668
|
<svg
|
|
669
669
|
xmlns="http://www.w3.org/2000/svg"
|
|
670
670
|
height="24px"
|
|
@@ -675,156 +675,156 @@ const Gt = c`
|
|
|
675
675
|
<path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z" />
|
|
676
676
|
</svg>
|
|
677
677
|
`;
|
|
678
|
-
var
|
|
678
|
+
var fo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
|
|
679
679
|
return typeof e == "string" ? e.length > 0 : typeof e == "number";
|
|
680
680
|
}, $ = 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
|
+
}, P = 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
|
+
}, ze = function(e) {
|
|
685
685
|
return (e = isFinite(e) ? e % 360 : 0) > 0 ? e : e + 360;
|
|
686
|
-
},
|
|
687
|
-
return { r:
|
|
688
|
-
},
|
|
686
|
+
}, pe = function(e) {
|
|
687
|
+
return { r: P(e.r, 0, 255), g: P(e.g, 0, 255), b: P(e.b, 0, 255), a: P(e.a) };
|
|
688
|
+
}, Rt = function(e) {
|
|
689
689
|
return { r: $(e.r), g: $(e.g), b: $(e.b), a: $(e.a, 3) };
|
|
690
|
-
},
|
|
690
|
+
}, go = /^#([0-9a-f]{3,8})$/i, yt = function(e) {
|
|
691
691
|
var t = e.toString(16);
|
|
692
692
|
return t.length < 2 ? "0" + t : t;
|
|
693
|
-
},
|
|
693
|
+
}, Me = 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
|
+
}, Le = 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
|
-
}, de = function(e) {
|
|
702
|
-
return { h: _e(e.h), s: A(e.s, 0, 100), l: A(e.l, 0, 100), a: A(e.a) };
|
|
703
|
-
}, pe = function(e) {
|
|
704
|
-
return { h: $(e.h), s: $(e.s), l: $(e.l), a: $(e.a, 3) };
|
|
705
701
|
}, ue = function(e) {
|
|
706
|
-
return
|
|
702
|
+
return { h: ze(e.h), s: P(e.s, 0, 100), l: P(e.l, 0, 100), a: P(e.a) };
|
|
703
|
+
}, he = function(e) {
|
|
704
|
+
return { h: $(e.h), s: $(e.s), l: $(e.l), a: $(e.a, 3) };
|
|
705
|
+
}, fe = function(e) {
|
|
706
|
+
return Le((o = (t = e).s, { h: t.h, s: (o *= ((r = t.l) < 50 ? r : 100 - r) / 100) > 0 ? 2 * o / (r + o) * 100 : 0, v: r + o, a: t.a }));
|
|
707
707
|
var t, o, r;
|
|
708
|
-
},
|
|
709
|
-
return { h: (t =
|
|
708
|
+
}, ut = function(e) {
|
|
709
|
+
return { h: (t = Me(e)).h, s: (s = (200 - (o = t.s)) * (r = t.v) / 100) > 0 && s < 200 ? o * r / 100 / (s <= 100 ? s : 200 - s) * 100 : 0, l: s / 2, a: t.a };
|
|
710
710
|
var t, o, r, s;
|
|
711
|
-
},
|
|
712
|
-
var t =
|
|
711
|
+
}, mo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, vo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, bo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, yo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, ge = { string: [[function(e) {
|
|
712
|
+
var t = go.exec(e);
|
|
713
713
|
return t ? (e = t[1]).length <= 4 ? { r: parseInt(e[0] + e[0], 16), g: parseInt(e[1] + e[1], 16), b: parseInt(e[2] + e[2], 16), a: e.length === 4 ? $(parseInt(e[3] + e[3], 16) / 255, 2) : 1 } : e.length === 6 || e.length === 8 ? { r: parseInt(e.substr(0, 2), 16), g: parseInt(e.substr(2, 2), 16), b: parseInt(e.substr(4, 2), 16), a: e.length === 8 ? $(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
|
|
714
714
|
}, "hex"], [function(e) {
|
|
715
|
-
var t =
|
|
716
|
-
return t ? t[2] !== t[4] || t[4] !== t[6] ? null :
|
|
715
|
+
var t = bo.exec(e) || yo.exec(e);
|
|
716
|
+
return t ? t[2] !== t[4] || t[4] !== t[6] ? null : pe({ r: Number(t[1]) / (t[2] ? 100 / 255 : 1), g: Number(t[3]) / (t[4] ? 100 / 255 : 1), b: Number(t[5]) / (t[6] ? 100 / 255 : 1), a: t[7] === void 0 ? 1 : Number(t[7]) / (t[8] ? 100 : 1) }) : null;
|
|
717
717
|
}, "rgb"], [function(e) {
|
|
718
|
-
var t =
|
|
718
|
+
var t = mo.exec(e) || vo.exec(e);
|
|
719
719
|
if (!t) return null;
|
|
720
|
-
var o, r, s =
|
|
721
|
-
return
|
|
720
|
+
var o, r, s = ue({ h: (o = t[1], r = t[2], r === void 0 && (r = "deg"), Number(o) * (fo[r] || 1)), s: Number(t[3]), l: Number(t[4]), a: t[5] === void 0 ? 1 : Number(t[5]) / (t[6] ? 100 : 1) });
|
|
721
|
+
return fe(s);
|
|
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 L(t) && L(o) && L(r) ? pe({ 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 (!
|
|
728
|
-
var a =
|
|
729
|
-
return
|
|
727
|
+
if (!L(t) || !L(o) || !L(r)) return null;
|
|
728
|
+
var a = ue({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
|
|
729
|
+
return fe(a);
|
|
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 (!L(t) || !L(o) || !L(r)) return null;
|
|
733
733
|
var a = function(l) {
|
|
734
|
-
return { h:
|
|
734
|
+
return { h: ze(l.h), s: P(l.s, 0, 100), v: P(l.v, 0, 100), a: P(l.a) };
|
|
735
735
|
}({ h: Number(t), s: Number(o), v: Number(r), a: Number(i) });
|
|
736
|
-
return
|
|
737
|
-
}, "hsv"]] },
|
|
736
|
+
return Le(a);
|
|
737
|
+
}, "hsv"]] }, me = 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
|
-
},
|
|
744
|
-
return typeof e == "string" ?
|
|
745
|
-
},
|
|
746
|
-
var o =
|
|
747
|
-
return { h: o.h, s:
|
|
748
|
-
},
|
|
743
|
+
}, xo = function(e) {
|
|
744
|
+
return typeof e == "string" ? me(e.trim(), ge.string) : typeof e == "object" && e !== null ? me(e, ge.object) : [null, void 0];
|
|
745
|
+
}, Vt = function(e, t) {
|
|
746
|
+
var o = ut(e);
|
|
747
|
+
return { h: o.h, s: P(o.s + 100 * t, 0, 100), l: o.l, a: o.a };
|
|
748
|
+
}, Bt = function(e) {
|
|
749
749
|
return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 / 255;
|
|
750
|
-
},
|
|
751
|
-
var o =
|
|
752
|
-
return { h: o.h, s: o.s, l:
|
|
753
|
-
},
|
|
750
|
+
}, ve = function(e, t) {
|
|
751
|
+
var o = ut(e);
|
|
752
|
+
return { h: o.h, s: o.s, l: P(o.l + 100 * t, 0, 100), a: o.a };
|
|
753
|
+
}, be = function() {
|
|
754
754
|
function e(t) {
|
|
755
|
-
this.parsed =
|
|
755
|
+
this.parsed = xo(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 $(
|
|
760
|
+
return $(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 = Rt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? yt($(255 * i)) : "", "#" + yt(o) + yt(r) + yt(s) + a;
|
|
767
767
|
var t, o, r, s, i, a;
|
|
768
768
|
}, e.prototype.toRgb = function() {
|
|
769
|
-
return
|
|
769
|
+
return Rt(this.rgba);
|
|
770
770
|
}, e.prototype.toRgbString = function() {
|
|
771
|
-
return t =
|
|
771
|
+
return t = Rt(this.rgba), o = t.r, r = t.g, s = t.b, (i = t.a) < 1 ? "rgba(" + o + ", " + r + ", " + s + ", " + i + ")" : "rgb(" + o + ", " + r + ", " + s + ")";
|
|
772
772
|
var t, o, r, s, i;
|
|
773
773
|
}, e.prototype.toHsl = function() {
|
|
774
|
-
return
|
|
774
|
+
return he(ut(this.rgba));
|
|
775
775
|
}, e.prototype.toHslString = function() {
|
|
776
|
-
return t =
|
|
776
|
+
return t = he(ut(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
|
|
777
777
|
var t, o, r, s, i;
|
|
778
778
|
}, e.prototype.toHsv = function() {
|
|
779
|
-
return t =
|
|
779
|
+
return t = Me(this.rgba), { h: $(t.h), s: $(t.s), v: $(t.v), a: $(t.a, 3) };
|
|
780
780
|
var t;
|
|
781
781
|
}, e.prototype.invert = function() {
|
|
782
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), T(
|
|
785
|
+
return t === void 0 && (t = 0.1), T(Vt(this.rgba, t));
|
|
786
786
|
}, e.prototype.desaturate = function(t) {
|
|
787
|
-
return t === void 0 && (t = 0.1), T(
|
|
787
|
+
return t === void 0 && (t = 0.1), T(Vt(this.rgba, -t));
|
|
788
788
|
}, e.prototype.grayscale = function() {
|
|
789
|
-
return T(
|
|
789
|
+
return T(Vt(this.rgba, -1));
|
|
790
790
|
}, e.prototype.lighten = function(t) {
|
|
791
|
-
return t === void 0 && (t = 0.1), T(
|
|
791
|
+
return t === void 0 && (t = 0.1), T(ve(this.rgba, t));
|
|
792
792
|
}, e.prototype.darken = function(t) {
|
|
793
|
-
return t === void 0 && (t = 0.1), T(
|
|
793
|
+
return t === void 0 && (t = 0.1), T(ve(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
797
|
return typeof t == "number" ? T({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : $(this.rgba.a, 3);
|
|
798
798
|
var o;
|
|
799
799
|
}, e.prototype.hue = function(t) {
|
|
800
|
-
var o =
|
|
800
|
+
var o = ut(this.rgba);
|
|
801
801
|
return typeof t == "number" ? T({ h: t, s: o.s, l: o.l, a: o.a }) : $(o.h);
|
|
802
802
|
}, e.prototype.isEqual = function(t) {
|
|
803
803
|
return this.toHex() === T(t).toHex();
|
|
804
804
|
}, e;
|
|
805
805
|
}(), T = function(e) {
|
|
806
|
-
return e instanceof
|
|
806
|
+
return e instanceof be ? e : new be(e);
|
|
807
807
|
};
|
|
808
|
-
const
|
|
809
|
-
function
|
|
808
|
+
const Ut = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
|
|
809
|
+
function wo(e) {
|
|
810
810
|
return {
|
|
811
811
|
debug: (t, ...o) => {
|
|
812
|
-
|
|
812
|
+
Ut && console.debug(`[${e}]`, t, ...o);
|
|
813
813
|
},
|
|
814
814
|
info: (t, ...o) => {
|
|
815
|
-
|
|
815
|
+
Ut && console.info(`[${e}]`, t, ...o);
|
|
816
816
|
},
|
|
817
817
|
warn: (t, ...o) => {
|
|
818
|
-
|
|
818
|
+
Ut && console.warn(`[${e}]`, t, ...o);
|
|
819
819
|
},
|
|
820
820
|
error: (t, ...o) => {
|
|
821
821
|
console.error(`[${e}]`, t, ...o);
|
|
822
822
|
}
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
|
-
const m =
|
|
826
|
-
var
|
|
827
|
-
const
|
|
825
|
+
const m = wo("Pollcatch");
|
|
826
|
+
var Ne = /* @__PURE__ */ ((e) => (e[e.AA_NORMAL = 4.5] = "AA_NORMAL", e[e.AA_LARGE = 3] = "AA_LARGE", e[e.AAA_NORMAL = 7] = "AAA_NORMAL", e[e.AAA_LARGE = 4.5] = "AAA_LARGE", e))(Ne || {});
|
|
827
|
+
const $o = {
|
|
828
828
|
black: "#000000",
|
|
829
829
|
white: "#ffffff",
|
|
830
830
|
red: "#ff0000",
|
|
@@ -841,19 +841,19 @@ const xo = {
|
|
|
841
841
|
teal: "#008080",
|
|
842
842
|
navy: "#000080"
|
|
843
843
|
};
|
|
844
|
-
function
|
|
844
|
+
function So(e) {
|
|
845
845
|
const t = e.toLowerCase().trim();
|
|
846
|
-
return
|
|
846
|
+
return $o[t] || null;
|
|
847
847
|
}
|
|
848
|
-
function
|
|
849
|
-
const o =
|
|
848
|
+
function jt(e, t) {
|
|
849
|
+
const o = ye(e), r = ye(t), s = Math.max(o, r), i = Math.min(o, r);
|
|
850
850
|
return (s + 0.05) / (i + 0.05);
|
|
851
851
|
}
|
|
852
|
-
function
|
|
853
|
-
const t =
|
|
852
|
+
function ye(e) {
|
|
853
|
+
const t = ko(e), o = t.r / 255, r = t.g / 255, s = t.b / 255, i = o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4), a = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4), l = s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
|
|
854
854
|
return 0.2126 * i + 0.7152 * a + 0.0722 * l;
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function Co(e, t = {}) {
|
|
857
857
|
if (!T(e).isValid())
|
|
858
858
|
return m.warn(`Invalid color provided: ${e}`), "black";
|
|
859
859
|
const {
|
|
@@ -867,15 +867,15 @@ function $o(e, t = {}) {
|
|
|
867
867
|
} = t, l = s.map((p) => p === "black" ? "#000000" : p === "white" ? "#ffffff" : p === "light" ? i.light || "#f8f9fa" : p === "dark" ? i.dark || "#343a40" : p);
|
|
868
868
|
let n = a, d = 0;
|
|
869
869
|
for (const p of l) {
|
|
870
|
-
const h =
|
|
870
|
+
const h = jt(e, p);
|
|
871
871
|
h >= r && h > d && (d = h, n = p);
|
|
872
872
|
}
|
|
873
873
|
if (d === 0) {
|
|
874
|
-
const p =
|
|
874
|
+
const p = jt(e, a);
|
|
875
875
|
n = a, d = p;
|
|
876
876
|
for (const h of l) {
|
|
877
877
|
if (h === a) continue;
|
|
878
|
-
const b =
|
|
878
|
+
const b = jt(e, h);
|
|
879
879
|
b > d && (d = b, n = h);
|
|
880
880
|
}
|
|
881
881
|
m.warn(
|
|
@@ -884,8 +884,8 @@ function $o(e, t = {}) {
|
|
|
884
884
|
}
|
|
885
885
|
return n;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
888
|
-
const o =
|
|
887
|
+
function ko(e) {
|
|
888
|
+
const o = So(e) || e, r = T(o);
|
|
889
889
|
if (!r.isValid())
|
|
890
890
|
return m.warn(`Invalid color provided: ${e}`), { r: 0, g: 0, b: 0 };
|
|
891
891
|
const { r: s, g: i, b: a } = r.toRgb();
|
|
@@ -903,7 +903,7 @@ function O(e, t) {
|
|
|
903
903
|
}[t] : void 0;
|
|
904
904
|
return e === "left" || e === "right" ? r || "center" : e === "top" || e === "bottom" ? r || "start" : r || "center";
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function qt(e, t = "1rem", o = 1) {
|
|
907
907
|
if (!e) return t;
|
|
908
908
|
const r = {
|
|
909
909
|
xs: 0.7,
|
|
@@ -922,7 +922,7 @@ function Vt(e, t = "1rem", o = 1) {
|
|
|
922
922
|
const l = parseFloat(i);
|
|
923
923
|
return isNaN(l) ? t : `${l}rem`;
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function Eo(e, t = "4px") {
|
|
926
926
|
if (!e) return t;
|
|
927
927
|
const o = {
|
|
928
928
|
xs: "2px",
|
|
@@ -942,8 +942,8 @@ function Co(e, t = "4px") {
|
|
|
942
942
|
const a = parseFloat(s);
|
|
943
943
|
return isNaN(a) ? t : `${a}px`;
|
|
944
944
|
}
|
|
945
|
-
var
|
|
946
|
-
function
|
|
945
|
+
var N = /* @__PURE__ */ ((e) => (e.BUTTON = "button", e.CHECKBOX = "checkbox", e.RADIO = "radio", e.RADIOGROUP = "radiogroup", e.SWITCH = "switch", e.TAB = "tab", e.TABLIST = "tablist", e.TABPANEL = "tabpanel", e.MENU = "menu", e.MENUITEM = "menuitem", e.MENUITEMCHECKBOX = "menuitemcheckbox", e.MENUITEMRADIO = "menuitemradio", e.SLIDER = "slider", e.TEXTBOX = "textbox", e.COMBOBOX = "combobox", e.LISTBOX = "listbox", e.OPTION = "option", e.PROGRESSBAR = "progressbar", e.STATUS = "status", e.ALERT = "alert", e.DIALOG = "dialog", e.GROUP = "group", e.REGION = "region", e.NONE = "none", e.PRESENTATION = "presentation", e))(N || {});
|
|
946
|
+
function rt(e) {
|
|
947
947
|
const t = {};
|
|
948
948
|
e.role !== void 0 && (t.role = e.role);
|
|
949
949
|
for (const [o, r] of Object.entries(e)) {
|
|
@@ -953,54 +953,54 @@ function tt(e) {
|
|
|
953
953
|
}
|
|
954
954
|
return t;
|
|
955
955
|
}
|
|
956
|
-
function
|
|
957
|
-
return
|
|
956
|
+
function Ao(e, t, o) {
|
|
957
|
+
return rt({
|
|
958
958
|
role: "button",
|
|
959
959
|
ariaLabel: e,
|
|
960
960
|
ariaPressed: t,
|
|
961
961
|
ariaDisabled: o
|
|
962
962
|
});
|
|
963
963
|
}
|
|
964
|
-
function
|
|
965
|
-
return
|
|
964
|
+
function Po(e, t, o, r = !1) {
|
|
965
|
+
return rt({
|
|
966
966
|
role: r ? "radio" : "checkbox",
|
|
967
967
|
ariaLabel: e,
|
|
968
968
|
ariaChecked: t,
|
|
969
969
|
ariaDisabled: o
|
|
970
970
|
});
|
|
971
971
|
}
|
|
972
|
-
function
|
|
972
|
+
function Ht(e, t, o) {
|
|
973
973
|
typeof o == "boolean" ? e.setAttribute(t, o ? "true" : "false") : e.setAttribute(t, o);
|
|
974
974
|
}
|
|
975
|
-
function
|
|
975
|
+
function To(e) {
|
|
976
976
|
if (typeof e != "string")
|
|
977
977
|
return !1;
|
|
978
978
|
const t = e.replace(/[<>"']/g, "").trim();
|
|
979
979
|
return /^(#[0-9a-fA-F]{3,8}|rgb\([^)]+\)|rgba\([^)]+\)|hsl\([^)]+\)|hsla\([^)]+\)|[a-zA-Z]+)$/.test(t);
|
|
980
980
|
}
|
|
981
|
-
function
|
|
982
|
-
return
|
|
981
|
+
function et(e) {
|
|
982
|
+
return To(e) ? e.replace(/[<>"']/g, "").trim() : (m.warn("Invalid color value:", e), "#000000");
|
|
983
983
|
}
|
|
984
|
-
function
|
|
984
|
+
function _o(e) {
|
|
985
985
|
if (typeof e != "string")
|
|
986
986
|
return m.warn("Non-string value passed to sanitizeCSS:", typeof e), "";
|
|
987
987
|
let t = e;
|
|
988
988
|
return t = t.replace(/@import[^;]+;/gi, "").replace(/expression\s*\([^)]*\)/gi, "").replace(/javascript:\s*[^"'\s;]*/gi, "").replace(/url\s*\(\s*["']?data:(?!image\/[^;]+;base64,)[^"')]*["']?\s*\)/gi, "").replace(/-moz-binding\s*:[^;]+;/gi, "").replace(/behavior\s*:[^;]+;/gi, ""), t;
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function Oo(e) {
|
|
991
991
|
return typeof e != "string" || !e.trim() ? "" : e.replace(
|
|
992
992
|
/([^{}:;]+):\s*([^;{}!]+)(\s*!important)?\s*(;|})/gi,
|
|
993
993
|
(t, o, r, s, i) => s ? t : `${o}: ${r.trim()} !important${i}`
|
|
994
994
|
);
|
|
995
995
|
}
|
|
996
|
-
const
|
|
997
|
-
function
|
|
996
|
+
const xe = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", Io = "pc_session_id", zo = 24 * 60 * 60 * 1e3;
|
|
997
|
+
function we() {
|
|
998
998
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (m.warn("crypto.randomUUID not available, using fallback UUID generator"), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
999
999
|
const t = Math.random() * 16 | 0;
|
|
1000
1000
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
1001
1001
|
}));
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function Xt() {
|
|
1004
1004
|
const e = "test-local-storage";
|
|
1005
1005
|
try {
|
|
1006
1006
|
return localStorage.setItem(e, e), localStorage.removeItem(e), !0;
|
|
@@ -1008,7 +1008,7 @@ function Wt() {
|
|
|
1008
1008
|
return m.warn("localStorage not available, session ID will not persist"), !1;
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function De(e) {
|
|
1012
1012
|
try {
|
|
1013
1013
|
const t = localStorage.getItem(e);
|
|
1014
1014
|
return t ? JSON.parse(t) : void 0;
|
|
@@ -1017,47 +1017,34 @@ function Me(e) {
|
|
|
1017
1017
|
return;
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1020
|
+
function Re(e, t) {
|
|
1021
1021
|
try {
|
|
1022
1022
|
return localStorage.setItem(e, JSON.stringify(t)), !0;
|
|
1023
1023
|
} catch (o) {
|
|
1024
1024
|
return m.warn(`Failed to set item in localStorage: ${e}`, o), !1;
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
|
-
async function
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
const e = document.querySelectorAll("script[pc-project]");
|
|
1032
|
-
if (e.length > 0) {
|
|
1033
|
-
const t = e[e.length - 1], o = t == null ? void 0 : t.getAttribute("pc-project");
|
|
1034
|
-
if (o)
|
|
1035
|
-
return m.debug("Found project key in script tag attribute"), o;
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
m.warn("No project key found in global variable or script tags");
|
|
1039
|
-
}
|
|
1040
|
-
async function xe() {
|
|
1041
|
-
const e = _o, t = Oo;
|
|
1042
|
-
if (Wt()) {
|
|
1043
|
-
const o = Me(e);
|
|
1027
|
+
async function $e() {
|
|
1028
|
+
const e = Io, t = zo;
|
|
1029
|
+
if (Xt()) {
|
|
1030
|
+
const o = De(e);
|
|
1044
1031
|
if (o && o.id && o.timestamp && Date.now() - o.timestamp < t)
|
|
1045
1032
|
return m.debug("Using existing session ID from localStorage"), o.id;
|
|
1046
1033
|
m.debug(
|
|
1047
1034
|
o ? "Session ID expired" : "No session ID found",
|
|
1048
1035
|
"generating new one"
|
|
1049
1036
|
);
|
|
1050
|
-
const r =
|
|
1051
|
-
return
|
|
1037
|
+
const r = we();
|
|
1038
|
+
return Re(e, {
|
|
1052
1039
|
id: r,
|
|
1053
1040
|
timestamp: Date.now()
|
|
1054
1041
|
}) ? m.debug("Generated and stored new session ID") : m.warn("Generated session ID but failed to store it"), r;
|
|
1055
1042
|
} else {
|
|
1056
|
-
const o =
|
|
1043
|
+
const o = we();
|
|
1057
1044
|
return m.debug("Generated non-persistent session ID"), o;
|
|
1058
1045
|
}
|
|
1059
1046
|
}
|
|
1060
|
-
function
|
|
1047
|
+
function Et(e) {
|
|
1061
1048
|
if (!e || typeof e != "object")
|
|
1062
1049
|
return 0;
|
|
1063
1050
|
let t = 0, o = 0, r = 0;
|
|
@@ -1070,7 +1057,7 @@ function Ct(e) {
|
|
|
1070
1057
|
const s = t / r * 100, i = o / r * 100;
|
|
1071
1058
|
return Math.round(s - i);
|
|
1072
1059
|
}
|
|
1073
|
-
function
|
|
1060
|
+
function Mo(e) {
|
|
1074
1061
|
if (!e || typeof e != "object")
|
|
1075
1062
|
return { promoters: 0, passives: 0, detractors: 0 };
|
|
1076
1063
|
let t = 0, o = 0, r = 0;
|
|
@@ -1080,14 +1067,14 @@ function zo(e) {
|
|
|
1080
1067
|
}
|
|
1081
1068
|
return { promoters: t, passives: o, detractors: r };
|
|
1082
1069
|
}
|
|
1083
|
-
function
|
|
1070
|
+
function Lo(e, t) {
|
|
1084
1071
|
const o = {};
|
|
1085
1072
|
for (const r of t)
|
|
1086
1073
|
o[r] = e[r] || 0;
|
|
1087
1074
|
return o;
|
|
1088
1075
|
}
|
|
1089
|
-
function
|
|
1090
|
-
const o = t ?
|
|
1076
|
+
function No(e, t) {
|
|
1077
|
+
const o = t ? Lo(e, t) : e;
|
|
1091
1078
|
let r = 0, s = 0;
|
|
1092
1079
|
for (const [a, l] of Object.entries(o)) {
|
|
1093
1080
|
s += l;
|
|
@@ -1096,7 +1083,7 @@ function Lo(e, t) {
|
|
|
1096
1083
|
}
|
|
1097
1084
|
return { avg: s > 0 ? Math.round(r / s * 10) / 10 : 0, count: s, sum: r, breakdown: o };
|
|
1098
1085
|
}
|
|
1099
|
-
function
|
|
1086
|
+
function D() {
|
|
1100
1087
|
return {
|
|
1101
1088
|
count: 0,
|
|
1102
1089
|
sum: 0,
|
|
@@ -1106,26 +1093,26 @@ function L() {
|
|
|
1106
1093
|
updated: (/* @__PURE__ */ new Date()).toISOString()
|
|
1107
1094
|
};
|
|
1108
1095
|
}
|
|
1109
|
-
function
|
|
1110
|
-
if (!
|
|
1111
|
-
return
|
|
1096
|
+
function Do(e) {
|
|
1097
|
+
if (!Xt())
|
|
1098
|
+
return D();
|
|
1112
1099
|
try {
|
|
1113
|
-
const t =
|
|
1114
|
-
return t ? { ...
|
|
1100
|
+
const t = De(e);
|
|
1101
|
+
return t ? { ...D(), ...t } : D();
|
|
1115
1102
|
} catch (t) {
|
|
1116
|
-
return m.warn("Failed to load localStats from localStorage", t),
|
|
1103
|
+
return m.warn("Failed to load localStats from localStorage", t), D();
|
|
1117
1104
|
}
|
|
1118
1105
|
}
|
|
1119
|
-
function
|
|
1120
|
-
if (!
|
|
1106
|
+
function Ro(e, t) {
|
|
1107
|
+
if (!Xt())
|
|
1121
1108
|
return !1;
|
|
1122
1109
|
try {
|
|
1123
|
-
return
|
|
1110
|
+
return Re(e, t) ? (m.debug("Saved localStats to localStorage", t), !0) : !1;
|
|
1124
1111
|
} catch (o) {
|
|
1125
1112
|
return m.warn("Failed to save localStats to localStorage", o), !1;
|
|
1126
1113
|
}
|
|
1127
1114
|
}
|
|
1128
|
-
function
|
|
1115
|
+
function Vo(e, t) {
|
|
1129
1116
|
const o = {
|
|
1130
1117
|
count: Math.max(0, e.count - t.count),
|
|
1131
1118
|
sum: (e.sum || 0) - (t.sum || 0),
|
|
@@ -1138,11 +1125,11 @@ function Ro(e, t) {
|
|
|
1138
1125
|
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)
|
|
1139
1126
|
for (const [r, s] of Object.entries(t.breakdown))
|
|
1140
1127
|
o.breakdown[r] && (o.breakdown[r] = Math.max(0, o.breakdown[r] - s), o.breakdown[r] === 0 && delete o.breakdown[r]);
|
|
1141
|
-
return o.nps =
|
|
1128
|
+
return o.nps = Et((o == null ? void 0 : o.breakdown) || {}), o;
|
|
1142
1129
|
}
|
|
1143
|
-
function
|
|
1130
|
+
function Bo(e, t) {
|
|
1144
1131
|
if (!e.count && !t.count)
|
|
1145
|
-
return
|
|
1132
|
+
return D();
|
|
1146
1133
|
if (!e.count)
|
|
1147
1134
|
return { ...t };
|
|
1148
1135
|
const o = {
|
|
@@ -1159,12 +1146,12 @@ function jo(e, t) {
|
|
|
1159
1146
|
for (const [r, s] of Object.entries(t.breakdown))
|
|
1160
1147
|
o.breakdown[r] = (o.breakdown[r] || 0) + s;
|
|
1161
1148
|
}
|
|
1162
|
-
return o.nps =
|
|
1149
|
+
return o.nps = Et((o == null ? void 0 : o.breakdown) || {}), o;
|
|
1163
1150
|
}
|
|
1164
|
-
function
|
|
1151
|
+
function Ve(e) {
|
|
1165
1152
|
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);
|
|
1166
1153
|
}
|
|
1167
|
-
function
|
|
1154
|
+
function _t(e) {
|
|
1168
1155
|
if (!e || typeof e != "string")
|
|
1169
1156
|
return !1;
|
|
1170
1157
|
const t = e.trim();
|
|
@@ -1178,7 +1165,7 @@ function Pt(e) {
|
|
|
1178
1165
|
return !1;
|
|
1179
1166
|
}
|
|
1180
1167
|
}
|
|
1181
|
-
function
|
|
1168
|
+
function Uo(e) {
|
|
1182
1169
|
if (!e || typeof e != "string")
|
|
1183
1170
|
return [];
|
|
1184
1171
|
const t = e.trim();
|
|
@@ -1193,37 +1180,46 @@ function Bo(e) {
|
|
|
1193
1180
|
}
|
|
1194
1181
|
return t.split(",").map((o) => o.trim()).filter((o) => o !== "");
|
|
1195
1182
|
}
|
|
1196
|
-
function
|
|
1183
|
+
function jo(e, t) {
|
|
1197
1184
|
const o = /{([^{}]+)}/g;
|
|
1198
1185
|
return e.replace(o, (r, s) => {
|
|
1199
1186
|
const i = s.trim(), a = t[i];
|
|
1200
1187
|
return a !== void 0 ? String(a) : r;
|
|
1201
1188
|
});
|
|
1202
1189
|
}
|
|
1203
|
-
function
|
|
1190
|
+
function qo(e, t) {
|
|
1204
1191
|
let o = 2166136261;
|
|
1205
1192
|
const r = e + ":" + t;
|
|
1206
1193
|
for (let s = 0; s < r.length; s++)
|
|
1207
1194
|
o ^= r.charCodeAt(s), o += (o << 1) + (o << 4) + (o << 7) + (o << 8) + (o << 24);
|
|
1208
1195
|
return (o >>> 0).toString(16).padStart(8, "0");
|
|
1209
1196
|
}
|
|
1210
|
-
function
|
|
1197
|
+
function Ho(e, t = 50) {
|
|
1211
1198
|
return e.length <= t ? e : e.substring(0, t).trim() + "...";
|
|
1212
1199
|
}
|
|
1213
|
-
|
|
1200
|
+
const Se = 5;
|
|
1201
|
+
class Fo {
|
|
1214
1202
|
// Tracks if user has ever made a selection (even if later deselected)
|
|
1215
1203
|
constructor(t) {
|
|
1216
|
-
this.stats =
|
|
1204
|
+
this.stats = D(), this.localStats = D(), this.prevLocalStats = D(), this.isLoading = !0, this.isLoadingConfig = !1, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
|
|
1217
1205
|
}
|
|
1218
1206
|
hostConnected() {
|
|
1219
1207
|
this.loadStats();
|
|
1220
1208
|
}
|
|
1221
|
-
|
|
1222
|
-
|
|
1209
|
+
/**
|
|
1210
|
+
* Validates the widget identifier (widget-id or name)
|
|
1211
|
+
* Returns the type of widget and validates accordingly
|
|
1212
|
+
*/
|
|
1213
|
+
validateWidgetIdentifier() {
|
|
1214
|
+
const t = this.host;
|
|
1215
|
+
return t.widgetId ? /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.widgetId) ? { type: "registered" } : { type: "none", error: `Invalid widget-id format: ${t.widgetId}` } : t.name ? t.name.length < Se ? {
|
|
1216
|
+
type: "none",
|
|
1217
|
+
error: `Widget name must be at least ${Se} characters long. Got: "${t.name}"`
|
|
1218
|
+
} : { type: "public" } : { type: "none", error: "Widget requires either widget-id or name attribute" };
|
|
1223
1219
|
}
|
|
1224
1220
|
async getLocalStatsKey() {
|
|
1225
|
-
const t = this.host, o = await
|
|
1226
|
-
return `pc-local-stats-${o}-${r}
|
|
1221
|
+
const t = this.host, o = await $e(), r = t.widgetId || t.name || "unnamed";
|
|
1222
|
+
return `pc-local-stats-${o}-${r}`;
|
|
1227
1223
|
}
|
|
1228
1224
|
/**
|
|
1229
1225
|
* while 'hostConnected' is not async, we need to use this wrapper function
|
|
@@ -1232,62 +1228,85 @@ class Ho {
|
|
|
1232
1228
|
async loadStats() {
|
|
1233
1229
|
await this.loadLocalStats(), await this.loadServerStats();
|
|
1234
1230
|
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Applies widget attributes from registered widget API response
|
|
1233
|
+
* Sets attributes on the host element based on the attributes config
|
|
1234
|
+
*/
|
|
1235
|
+
applyWidgetAttributes(t) {
|
|
1236
|
+
if (!t) return;
|
|
1237
|
+
const r = this.host;
|
|
1238
|
+
for (const [s, i] of Object.entries(t)) {
|
|
1239
|
+
if (i == null) continue;
|
|
1240
|
+
const a = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1241
|
+
typeof i == "boolean" ? i ? r.setAttribute(a, "") : r.removeAttribute(a) : typeof i == "object" ? r.setAttribute(a, JSON.stringify(i)) : r.setAttribute(a, String(i)), m.debug(`Applied widget attribute: ${a}=${i}`);
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1235
1244
|
/**
|
|
1236
1245
|
* Loads the stats for the widget.
|
|
1237
1246
|
*/
|
|
1238
1247
|
async loadServerStats() {
|
|
1248
|
+
var r, s, i;
|
|
1239
1249
|
const t = this.host;
|
|
1240
1250
|
this.isLoading = !1, this.stats = this.localStats, this.host.requestUpdate();
|
|
1251
|
+
const o = this.validateWidgetIdentifier();
|
|
1252
|
+
if (o.error) {
|
|
1253
|
+
m.error(o.error);
|
|
1254
|
+
return;
|
|
1255
|
+
}
|
|
1241
1256
|
try {
|
|
1242
|
-
const
|
|
1243
|
-
let
|
|
1257
|
+
const a = t.type;
|
|
1258
|
+
let l;
|
|
1244
1259
|
if (t.dataFunc && typeof window < "u") {
|
|
1245
|
-
const
|
|
1246
|
-
let
|
|
1247
|
-
for (const
|
|
1248
|
-
if (
|
|
1249
|
-
|
|
1260
|
+
const w = t.dataFunc.replace(/^window\./, "").split(".");
|
|
1261
|
+
let A = window;
|
|
1262
|
+
for (const W of w)
|
|
1263
|
+
if (A = A == null ? void 0 : A[W], A === void 0) break;
|
|
1264
|
+
l = A;
|
|
1250
1265
|
}
|
|
1251
|
-
let
|
|
1252
|
-
if (
|
|
1266
|
+
let n, d = null;
|
|
1267
|
+
if (l && typeof l == "function") {
|
|
1253
1268
|
const C = this.getOptionsForDataFunc(t);
|
|
1254
|
-
|
|
1269
|
+
m.debug(`Using data function for: ${t.widgetId || t.name}`, {
|
|
1255
1270
|
dataFuncName: t.dataFunc,
|
|
1256
|
-
projectKey: o,
|
|
1257
1271
|
options: C
|
|
1258
|
-
})
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1272
|
+
});
|
|
1273
|
+
const w = await l(t.widgetId, t.name, C);
|
|
1274
|
+
if (w && typeof w == "object" && "success" in w && "data" in w) {
|
|
1275
|
+
if (!w.success)
|
|
1276
|
+
throw m.error("Custom data function returned unsuccessful response", w), new Error("Custom data function returned unsuccessful response");
|
|
1277
|
+
n = w.data || {};
|
|
1262
1278
|
} else
|
|
1263
|
-
|
|
1279
|
+
n = w || {};
|
|
1264
1280
|
} else {
|
|
1265
|
-
const C = t.dataEndpoint ||
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1281
|
+
const C = t.dataEndpoint || xe;
|
|
1282
|
+
let w;
|
|
1283
|
+
o.type === "registered" ? (w = `${C}/widgets/${encodeURIComponent(t.widgetId)}`, this.isLoadingConfig = !0, this.host.requestUpdate()) : w = `${C}/public-widgets/${encodeURIComponent(t.name)}`, m.debug("Fetching stats for widget", {
|
|
1284
|
+
endpoint: w,
|
|
1285
|
+
type: o.type
|
|
1286
|
+
});
|
|
1287
|
+
const A = await fetch(w);
|
|
1288
|
+
if (!A.ok)
|
|
1289
|
+
throw new Error(`API request failed with status: ${A.status}`);
|
|
1290
|
+
const W = await A.json();
|
|
1291
|
+
if (!W.success)
|
|
1292
|
+
throw m.error("Backend returned unsuccessful response", W), new Error("Backend returned unsuccessful response");
|
|
1293
|
+
o.type === "registered" ? (d = ((s = (r = W.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null, n = ((i = W.data) == null ? void 0 : i.stats) || {}) : n = W.data || {};
|
|
1276
1294
|
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1295
|
+
d && !l && this.applyWidgetAttributes(d);
|
|
1296
|
+
const p = this.getOptionsForDataFunc(t), h = No(n.breakdown ?? {}, p), b = h.count, x = h.sum, E = b > 0 ? Math.round(x / b * 10) / 10 : 0, z = b > 0 ? Math.round(x / b * 100) : 0, M = {
|
|
1297
|
+
count: b,
|
|
1298
|
+
sum: x,
|
|
1299
|
+
avg: E,
|
|
1300
|
+
pct: z,
|
|
1301
|
+
nps: a === S.nps ? Et(h.breakdown) : 0,
|
|
1302
|
+
breakdown: h.breakdown,
|
|
1303
|
+
updated: n.updatedAt || n.updated_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
1285
1304
|
};
|
|
1286
|
-
this.stats =
|
|
1287
|
-
} catch (
|
|
1288
|
-
throw m.error("Error loading stats:",
|
|
1305
|
+
this.stats = M;
|
|
1306
|
+
} catch (a) {
|
|
1307
|
+
throw m.error("Error loading stats:", a, this.localStats), a;
|
|
1289
1308
|
} finally {
|
|
1290
|
-
this.isLoading = !1, this.host.requestUpdate();
|
|
1309
|
+
this.isLoading = !1, this.isLoadingConfig = !1, this.host.requestUpdate();
|
|
1291
1310
|
}
|
|
1292
1311
|
}
|
|
1293
1312
|
/**
|
|
@@ -1316,10 +1335,10 @@ class Ho {
|
|
|
1316
1335
|
async loadLocalStats() {
|
|
1317
1336
|
const t = await this.getLocalStatsKey();
|
|
1318
1337
|
try {
|
|
1319
|
-
const o =
|
|
1338
|
+
const o = Do(t);
|
|
1320
1339
|
m.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
|
|
1321
1340
|
} catch (o) {
|
|
1322
|
-
m.warn("Failed to generate localStorage key for localStats", o), this.localStats =
|
|
1341
|
+
m.warn("Failed to generate localStorage key for localStats", o), this.localStats = D();
|
|
1323
1342
|
}
|
|
1324
1343
|
this.host.requestUpdate();
|
|
1325
1344
|
}
|
|
@@ -1329,7 +1348,7 @@ class Ho {
|
|
|
1329
1348
|
async persistLocalStats() {
|
|
1330
1349
|
try {
|
|
1331
1350
|
const t = await this.getLocalStatsKey();
|
|
1332
|
-
|
|
1351
|
+
Ro(t, this.localStats) || m.warn("Failed to save localStats to localStorage");
|
|
1333
1352
|
} catch (t) {
|
|
1334
1353
|
m.warn("Failed to save localStats to localStorage", t);
|
|
1335
1354
|
}
|
|
@@ -1343,7 +1362,7 @@ class Ho {
|
|
|
1343
1362
|
* @param textValues
|
|
1344
1363
|
*/
|
|
1345
1364
|
updateStats(t, o) {
|
|
1346
|
-
if (this.hasInteracted = !0, this.stats && (this.stats =
|
|
1365
|
+
if (this.hasInteracted = !0, this.stats && (this.stats = Vo(this.stats, this.localStats)), this.localStats = {
|
|
1347
1366
|
count: t > 0 || o.length > 0 ? 1 : 0,
|
|
1348
1367
|
sum: t,
|
|
1349
1368
|
// e.g. number of stars, nps value
|
|
@@ -1357,7 +1376,7 @@ class Ho {
|
|
|
1357
1376
|
}, o && o.length > 0)
|
|
1358
1377
|
for (const r of o)
|
|
1359
1378
|
r && (this.localStats.breakdown[r] = 1);
|
|
1360
|
-
this.stats =
|
|
1379
|
+
this.stats = Bo(this.stats, this.localStats), m.debug("Stats updated - remote: ", this.stats), m.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
|
|
1361
1380
|
}
|
|
1362
1381
|
async markStatsAsSubmitted() {
|
|
1363
1382
|
this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), this.prevLocalStats = { ...this.localStats }, await this.persistLocalStats(), this.host.requestUpdate();
|
|
@@ -1365,58 +1384,83 @@ class Ho {
|
|
|
1365
1384
|
async submitStats() {
|
|
1366
1385
|
if (!this.hasLocalStats() && !this.hasInteracted)
|
|
1367
1386
|
throw m.warn("No local stats to submit"), new Error("No local stats to submit");
|
|
1368
|
-
const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await
|
|
1387
|
+
const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await $e(), s = this.localStats.sum, i = Object.keys(this.localStats.breakdown || {}), a = this.prevLocalStats.sum, l = Object.keys(this.prevLocalStats.breakdown || {});
|
|
1369
1388
|
this.isSubmitting = !0, this.host.requestUpdate();
|
|
1370
|
-
const
|
|
1389
|
+
const n = {
|
|
1371
1390
|
sessionId: r,
|
|
1372
|
-
|
|
1373
|
-
widgetName:
|
|
1391
|
+
widgetId: t.widgetId,
|
|
1392
|
+
widgetName: t.name,
|
|
1374
1393
|
widgetType: t.type,
|
|
1375
1394
|
url: window.location.href,
|
|
1376
|
-
numericValue:
|
|
1377
|
-
textValues:
|
|
1378
|
-
prevNumericValue:
|
|
1379
|
-
prevTextValues:
|
|
1395
|
+
numericValue: s,
|
|
1396
|
+
textValues: i,
|
|
1397
|
+
prevNumericValue: a,
|
|
1398
|
+
prevTextValues: l,
|
|
1380
1399
|
metadata: t.metadata,
|
|
1381
1400
|
timestamp: o
|
|
1382
|
-
},
|
|
1401
|
+
}, d = qo(JSON.stringify(n), o);
|
|
1383
1402
|
try {
|
|
1384
|
-
await this.sendStats({ ...
|
|
1385
|
-
} catch (
|
|
1386
|
-
m.warn("Failed to send stats event",
|
|
1403
|
+
await this.sendStats({ ...n, hash: d }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(n);
|
|
1404
|
+
} catch (p) {
|
|
1405
|
+
m.warn("Failed to send stats event", p);
|
|
1387
1406
|
} finally {
|
|
1388
1407
|
this.isSubmitting = !1, this.host.requestUpdate();
|
|
1389
1408
|
}
|
|
1390
|
-
return
|
|
1409
|
+
return n;
|
|
1391
1410
|
}
|
|
1392
1411
|
async sendStats(t) {
|
|
1393
|
-
const o =
|
|
1394
|
-
if (
|
|
1412
|
+
const o = this.host;
|
|
1413
|
+
if (o.dataFunc) {
|
|
1395
1414
|
m.debug("Skip sending stats as data function is in use.");
|
|
1396
1415
|
return;
|
|
1397
1416
|
}
|
|
1398
|
-
|
|
1417
|
+
const r = this.validateWidgetIdentifier();
|
|
1418
|
+
if (r.error)
|
|
1419
|
+
throw m.error(r.error), new Error(r.error);
|
|
1420
|
+
const s = o.dataEndpoint || xe;
|
|
1421
|
+
if (!_t(s))
|
|
1399
1422
|
throw m.error("Invalid data endpoint", { dataEndpoint: s }), new Error(`Invalid data endpoint: ${s}`);
|
|
1423
|
+
let i, a;
|
|
1424
|
+
r.type === "registered" ? (i = `${s}/widgets/${encodeURIComponent(o.widgetId)}`, a = JSON.stringify({
|
|
1425
|
+
sessionId: t.sessionId,
|
|
1426
|
+
numericValue: t.numericValue,
|
|
1427
|
+
textValues: t.textValues,
|
|
1428
|
+
prevNumericValue: t.prevNumericValue,
|
|
1429
|
+
prevTextValues: t.prevTextValues,
|
|
1430
|
+
metadata: t.metadata,
|
|
1431
|
+
url: t.url,
|
|
1432
|
+
timestamp: t.timestamp,
|
|
1433
|
+
hash: t.hash
|
|
1434
|
+
})) : (i = `${s}/public-widgets/${encodeURIComponent(o.name)}`, a = JSON.stringify({
|
|
1435
|
+
sessionId: t.sessionId,
|
|
1436
|
+
widgetType: t.widgetType,
|
|
1437
|
+
numericValue: t.numericValue,
|
|
1438
|
+
textValues: t.textValues,
|
|
1439
|
+
prevNumericValue: t.prevNumericValue,
|
|
1440
|
+
prevTextValues: t.prevTextValues,
|
|
1441
|
+
timestamp: t.timestamp,
|
|
1442
|
+
hash: t.hash
|
|
1443
|
+
}));
|
|
1400
1444
|
try {
|
|
1401
|
-
if (m.debug("Sending stats", { endpoint:
|
|
1402
|
-
if (navigator.sendBeacon(
|
|
1445
|
+
if (m.debug("Sending stats", { endpoint: i, event: t }), typeof navigator < "u" && navigator.sendBeacon)
|
|
1446
|
+
if (navigator.sendBeacon(i, a)) {
|
|
1403
1447
|
m.debug("Successfully sent stats via sendBeacon");
|
|
1404
1448
|
return;
|
|
1405
1449
|
} else
|
|
1406
1450
|
m.debug("sendBeacon failed, falling back to fetch");
|
|
1407
|
-
const
|
|
1408
|
-
body:
|
|
1451
|
+
const l = await fetch(i, {
|
|
1452
|
+
body: a,
|
|
1409
1453
|
method: "POST",
|
|
1410
1454
|
keepalive: !0,
|
|
1411
1455
|
headers: {
|
|
1412
1456
|
"Content-Type": "application/json"
|
|
1413
1457
|
}
|
|
1414
1458
|
});
|
|
1415
|
-
if (!
|
|
1416
|
-
throw new Error(`API request failed with status: ${
|
|
1459
|
+
if (!l.ok)
|
|
1460
|
+
throw new Error(`API request failed with status: ${l.status}`);
|
|
1417
1461
|
m.debug("Successfully sent stats via fetch");
|
|
1418
|
-
} catch (
|
|
1419
|
-
throw m.error("Failed to send analytics:",
|
|
1462
|
+
} catch (l) {
|
|
1463
|
+
throw m.error("Failed to send analytics:", l), l;
|
|
1420
1464
|
}
|
|
1421
1465
|
}
|
|
1422
1466
|
/**
|
|
@@ -1431,9 +1475,9 @@ class Ho {
|
|
|
1431
1475
|
sum: (o == null ? void 0 : o.sum) || 0,
|
|
1432
1476
|
avg: s,
|
|
1433
1477
|
pct: (o == null ? void 0 : o.pct) || 0,
|
|
1434
|
-
nps: r.type === S.nps ?
|
|
1478
|
+
nps: r.type === S.nps ? Et((o == null ? void 0 : o.breakdown) || {}) : 0
|
|
1435
1479
|
};
|
|
1436
|
-
return m.debug("Stats data: ", this.stats),
|
|
1480
|
+
return m.debug("Stats data: ", this.stats), jo(t, i);
|
|
1437
1481
|
}
|
|
1438
1482
|
/**
|
|
1439
1483
|
* Checks if a value is selected in the local stats
|
|
@@ -1480,7 +1524,7 @@ class Ho {
|
|
|
1480
1524
|
*/
|
|
1481
1525
|
dispatchChangeEvent() {
|
|
1482
1526
|
const t = this.host, o = this.localStats.sum, r = Object.keys(this.localStats.breakdown || {}), s = {
|
|
1483
|
-
|
|
1527
|
+
widgetId: t.widgetId,
|
|
1484
1528
|
widgetType: t.type,
|
|
1485
1529
|
widgetName: t.name,
|
|
1486
1530
|
numericValue: o,
|
|
@@ -1520,7 +1564,7 @@ class Ho {
|
|
|
1520
1564
|
return ((t = this.localStats) == null ? void 0 : t.submitted) !== void 0 && this.hasLocalStats();
|
|
1521
1565
|
}
|
|
1522
1566
|
}
|
|
1523
|
-
class
|
|
1567
|
+
class Yo {
|
|
1524
1568
|
constructor(t, o) {
|
|
1525
1569
|
this.isEditing = !0, this.isChartVisible = !1, this.isStatsVisible = !1, this.isThankYouVisible = !1, this.isReactionPopoverVisible = !1, this.initialized = !1, this.handleClickOutside = (r) => {
|
|
1526
1570
|
r.target !== this.host && (this.toggleThankYouVisibility(!1), this.toggleReactionPopoverVisibility(!1));
|
|
@@ -1608,8 +1652,8 @@ class Fo {
|
|
|
1608
1652
|
return !(this.host.readonly || !this.isEditing);
|
|
1609
1653
|
}
|
|
1610
1654
|
}
|
|
1611
|
-
var
|
|
1612
|
-
function
|
|
1655
|
+
var Qt = /* @__PURE__ */ ((e) => (e.DECORATIVE = "decorative", e.FUNCTIONAL = "functional", e.STATUS = "status", e))(Qt || {});
|
|
1656
|
+
function Be(e, t = {}) {
|
|
1613
1657
|
const { type: o = "functional", alt: r, ariaLabel: s, isSelected: i } = t;
|
|
1614
1658
|
if (!e)
|
|
1615
1659
|
return { alt: "", ariaHidden: !0 };
|
|
@@ -1618,20 +1662,20 @@ function De(e, t = {}) {
|
|
|
1618
1662
|
o === "functional" && !r && !s && console.warn(
|
|
1619
1663
|
"No alt text or aria-label provided for functional icon. This may cause accessibility issues."
|
|
1620
1664
|
);
|
|
1621
|
-
const a = i ? " (selected)" : "", l =
|
|
1665
|
+
const a = i ? " (selected)" : "", l = _t(e) && !r ? "" : r || e, n = s || (l ? `${l}${a}` : a);
|
|
1622
1666
|
return {
|
|
1623
1667
|
alt: l,
|
|
1624
1668
|
ariaLabel: n,
|
|
1625
1669
|
ariaHidden: !1
|
|
1626
1670
|
};
|
|
1627
1671
|
}
|
|
1628
|
-
function
|
|
1672
|
+
function Ko(e, t = "polite") {
|
|
1629
1673
|
let o = document.getElementById("screen-reader-announcer");
|
|
1630
1674
|
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(() => {
|
|
1631
1675
|
o.textContent = e;
|
|
1632
1676
|
}, 50);
|
|
1633
1677
|
}
|
|
1634
|
-
function
|
|
1678
|
+
function Wo(e, t) {
|
|
1635
1679
|
return `${e}: ${t}`;
|
|
1636
1680
|
}
|
|
1637
1681
|
/**
|
|
@@ -1639,8 +1683,8 @@ function Ko(e, t) {
|
|
|
1639
1683
|
* Copyright 2017 Google LLC
|
|
1640
1684
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1641
1685
|
*/
|
|
1642
|
-
const
|
|
1643
|
-
let
|
|
1686
|
+
const Ue = { ATTRIBUTE: 1 }, je = (e) => (...t) => ({ _$litDirective$: e, values: t });
|
|
1687
|
+
let qe = class {
|
|
1644
1688
|
constructor(t) {
|
|
1645
1689
|
}
|
|
1646
1690
|
get _$AU() {
|
|
@@ -1661,10 +1705,10 @@ let Be = class {
|
|
|
1661
1705
|
* Copyright 2018 Google LLC
|
|
1662
1706
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1663
1707
|
*/
|
|
1664
|
-
const y = je(class extends
|
|
1708
|
+
const y = je(class extends qe {
|
|
1665
1709
|
constructor(e) {
|
|
1666
1710
|
var t;
|
|
1667
|
-
if (super(e), e.type !==
|
|
1711
|
+
if (super(e), e.type !== Ue.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.");
|
|
1668
1712
|
}
|
|
1669
1713
|
render(e) {
|
|
1670
1714
|
return " " + Object.keys(e).filter((t) => e[t]).join(" ") + " ";
|
|
@@ -1682,7 +1726,7 @@ const y = je(class extends Be {
|
|
|
1682
1726
|
const a = !!t[i];
|
|
1683
1727
|
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)));
|
|
1684
1728
|
}
|
|
1685
|
-
return
|
|
1729
|
+
return H;
|
|
1686
1730
|
}
|
|
1687
1731
|
});
|
|
1688
1732
|
var Go = Object.defineProperty, v = (e, t, o, r) => {
|
|
@@ -1690,13 +1734,13 @@ var Go = Object.defineProperty, v = (e, t, o, r) => {
|
|
|
1690
1734
|
(a = e[i]) && (s = a(t, o, s) || s);
|
|
1691
1735
|
return s && Go(t, o, s), s;
|
|
1692
1736
|
};
|
|
1693
|
-
const
|
|
1737
|
+
const xt = {
|
|
1694
1738
|
mobile: "480px",
|
|
1695
1739
|
tablet: "768px",
|
|
1696
1740
|
desktop: "1024px"
|
|
1697
|
-
},
|
|
1741
|
+
}, te = class te extends R {
|
|
1698
1742
|
constructor() {
|
|
1699
|
-
super(...arguments), this.dataController = new
|
|
1743
|
+
super(...arguments), this.dataController = new Fo(this), this.displayController = new Yo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.ariaLabel = null, this.minContrast = Ne.AA_NORMAL, this.options = [], this.questionPosition = "top", this.statsText = "{count} votes", this.buttonText = "Submit", this.buttonRadius = "sm", this.multiple = !1, this.inline = !1, this.readonly = !1, this.handleEditToggleKeyDown = (t) => {
|
|
1700
1744
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
|
|
1701
1745
|
};
|
|
1702
1746
|
}
|
|
@@ -1728,10 +1772,10 @@ const bt = {
|
|
|
1728
1772
|
let o = `:host {
|
|
1729
1773
|
`;
|
|
1730
1774
|
if (this.primaryColor) {
|
|
1731
|
-
const i =
|
|
1775
|
+
const i = et(this.primaryColor);
|
|
1732
1776
|
o += `--pc-primary-color: ${i} !important;
|
|
1733
1777
|
`;
|
|
1734
|
-
const a =
|
|
1778
|
+
const a = Co(i, {
|
|
1735
1779
|
minContrast: this.minContrast,
|
|
1736
1780
|
colorOptions: ["black", "white", "light", "dark"]
|
|
1737
1781
|
});
|
|
@@ -1739,56 +1783,56 @@ const bt = {
|
|
|
1739
1783
|
`;
|
|
1740
1784
|
}
|
|
1741
1785
|
if (this.muteColor) {
|
|
1742
|
-
const i =
|
|
1786
|
+
const i = et(this.muteColor);
|
|
1743
1787
|
o += `--pc-mute-color: ${i} !important;
|
|
1744
1788
|
`;
|
|
1745
1789
|
}
|
|
1746
1790
|
if (this.textColor) {
|
|
1747
|
-
const i =
|
|
1791
|
+
const i = et(this.textColor);
|
|
1748
1792
|
o += `--pc-text-color: ${i} !important;
|
|
1749
1793
|
`;
|
|
1750
1794
|
}
|
|
1751
1795
|
if (this.backgroundColor) {
|
|
1752
|
-
const i =
|
|
1796
|
+
const i = et(this.backgroundColor);
|
|
1753
1797
|
o += `--pc-background-color: ${i} !important;
|
|
1754
1798
|
`;
|
|
1755
1799
|
}
|
|
1756
1800
|
const r = this.starColor || this.accentColor || this.primaryColor;
|
|
1757
1801
|
if (r) {
|
|
1758
|
-
const i =
|
|
1802
|
+
const i = et(r);
|
|
1759
1803
|
o += `--pc-star-color: ${i} !important;
|
|
1760
1804
|
`;
|
|
1761
1805
|
}
|
|
1762
|
-
const s = this.starHoverColor || (r ? `color-mix(in srgb, ${
|
|
1806
|
+
const s = this.starHoverColor || (r ? `color-mix(in srgb, ${et(r)} 80%, white)` : null);
|
|
1763
1807
|
if (s && (o += `--pc-star-hover-color: ${s} !important;
|
|
1764
1808
|
`), this.starSize) {
|
|
1765
|
-
const i =
|
|
1809
|
+
const i = qt(this.starSize, "1.5em", 1.5);
|
|
1766
1810
|
o += `--pc-stars-star-size: ${i} !important;
|
|
1767
1811
|
`;
|
|
1768
1812
|
}
|
|
1769
1813
|
if (this.reactionSize) {
|
|
1770
|
-
const i =
|
|
1814
|
+
const i = qt(this.reactionSize, "1em", 1);
|
|
1771
1815
|
o += `--pc-reaction-size: ${i} !important;
|
|
1772
1816
|
`;
|
|
1773
1817
|
}
|
|
1774
1818
|
if (this.size) {
|
|
1775
|
-
const i =
|
|
1819
|
+
const i = qt(this.size);
|
|
1776
1820
|
o += `font-size: ${i} !important;
|
|
1777
1821
|
`;
|
|
1778
1822
|
}
|
|
1779
1823
|
if (this.buttonRadius) {
|
|
1780
|
-
const i =
|
|
1824
|
+
const i = Eo(this.buttonRadius);
|
|
1781
1825
|
o += `--pc-button-radius: ${i} !important;
|
|
1782
1826
|
`;
|
|
1783
1827
|
}
|
|
1784
1828
|
o += `}
|
|
1785
|
-
`, this.css && (o +=
|
|
1829
|
+
`, this.css && (o += Oo(_o(this.css))), t.textContent = o;
|
|
1786
1830
|
}
|
|
1787
1831
|
/**
|
|
1788
1832
|
* Update ARIA attributes for accessibility
|
|
1789
1833
|
*/
|
|
1790
1834
|
updateAriaAttributes() {
|
|
1791
|
-
this.ariaLabel &&
|
|
1835
|
+
this.ariaLabel && Ht(this, "aria-label", this.ariaLabel), this.ariaDescribedby && Ht(this, "aria-describedby", this.ariaDescribedby), Ht(this, "aria-busy", this.dataController.isLoading ? "true" : "false");
|
|
1792
1836
|
}
|
|
1793
1837
|
/**
|
|
1794
1838
|
* Update host CSS classes based on state
|
|
@@ -1801,11 +1845,11 @@ const bt = {
|
|
|
1801
1845
|
*/
|
|
1802
1846
|
getBreakpointClasses() {
|
|
1803
1847
|
return {
|
|
1804
|
-
"pc-mobile": window.matchMedia(`(max-width: ${
|
|
1848
|
+
"pc-mobile": window.matchMedia(`(max-width: ${xt.mobile})`).matches,
|
|
1805
1849
|
"pc-tablet": window.matchMedia(
|
|
1806
|
-
`(min-width: ${
|
|
1850
|
+
`(min-width: ${xt.mobile}) and (max-width: ${xt.tablet})`
|
|
1807
1851
|
).matches,
|
|
1808
|
-
"pc-desktop": window.matchMedia(`(min-width: ${
|
|
1852
|
+
"pc-desktop": window.matchMedia(`(min-width: ${xt.desktop})`).matches
|
|
1809
1853
|
};
|
|
1810
1854
|
}
|
|
1811
1855
|
/**
|
|
@@ -1813,7 +1857,7 @@ const bt = {
|
|
|
1813
1857
|
*/
|
|
1814
1858
|
announceSelectionChange(t, o, r) {
|
|
1815
1859
|
const s = `Poll for "${t}"`, i = r ? `${o.label} selected` : `${o.label} unselected`;
|
|
1816
|
-
|
|
1860
|
+
Ko(Wo(s, i));
|
|
1817
1861
|
}
|
|
1818
1862
|
/** Common render methods */
|
|
1819
1863
|
renderLabel() {
|
|
@@ -1844,7 +1888,7 @@ const bt = {
|
|
|
1844
1888
|
tabindex="0"
|
|
1845
1889
|
aria-label="Edit vote"
|
|
1846
1890
|
@keydown="${this.handleEditToggleKeyDown}"
|
|
1847
|
-
>${
|
|
1891
|
+
>${kt}</span
|
|
1848
1892
|
>
|
|
1849
1893
|
` : u;
|
|
1850
1894
|
}
|
|
@@ -1863,7 +1907,7 @@ const bt = {
|
|
|
1863
1907
|
tabindex="0"
|
|
1864
1908
|
aria-label="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
|
|
1865
1909
|
@keydown="${() => this.displayController.toggleChartVisibility()}"
|
|
1866
|
-
>${this.displayController.isChartVisible ?
|
|
1910
|
+
>${this.displayController.isChartVisible ? Jt : Zt}</span
|
|
1867
1911
|
>
|
|
1868
1912
|
` : u;
|
|
1869
1913
|
}
|
|
@@ -1890,7 +1934,7 @@ const bt = {
|
|
|
1890
1934
|
renderThankYouMessage() {
|
|
1891
1935
|
if (!this.displayController.shouldDisplayThankYouMsg())
|
|
1892
1936
|
return u;
|
|
1893
|
-
const t =
|
|
1937
|
+
const t = Ho(this.thankYouMsg || "");
|
|
1894
1938
|
return c`
|
|
1895
1939
|
<div class="pc-thank-you-overlay" data-testid="poll-thank-you-overlay">
|
|
1896
1940
|
<div class="pc-thank-you" data-testid="thank-you">
|
|
@@ -1902,7 +1946,7 @@ const bt = {
|
|
|
1902
1946
|
@click="${() => this.displayController.toggleThankYouVisibility(!1)}"
|
|
1903
1947
|
role="button"
|
|
1904
1948
|
aria-label="Close"
|
|
1905
|
-
>${
|
|
1949
|
+
>${Tt}</span
|
|
1906
1950
|
>
|
|
1907
1951
|
</div>
|
|
1908
1952
|
</div>
|
|
@@ -1910,8 +1954,8 @@ const bt = {
|
|
|
1910
1954
|
`;
|
|
1911
1955
|
}
|
|
1912
1956
|
};
|
|
1913
|
-
|
|
1914
|
-
|
|
1957
|
+
te.styles = [
|
|
1958
|
+
B`
|
|
1915
1959
|
:host {
|
|
1916
1960
|
/* Default values for CSS variables - can be overridden by external :root or parent definitions */
|
|
1917
1961
|
--default-font-size-base: 1rem;
|
|
@@ -1991,7 +2035,7 @@ Jt.styles = [
|
|
|
1991
2035
|
}
|
|
1992
2036
|
`
|
|
1993
2037
|
];
|
|
1994
|
-
let g =
|
|
2038
|
+
let g = te;
|
|
1995
2039
|
v([
|
|
1996
2040
|
f({ type: String, attribute: "show-stats" })
|
|
1997
2041
|
], g.prototype, "showStats");
|
|
@@ -2047,8 +2091,8 @@ v([
|
|
|
2047
2091
|
f({ type: Array })
|
|
2048
2092
|
], g.prototype, "options");
|
|
2049
2093
|
v([
|
|
2050
|
-
f({ type: String })
|
|
2051
|
-
], g.prototype, "
|
|
2094
|
+
f({ type: String, attribute: "widget-id" })
|
|
2095
|
+
], g.prototype, "widgetId");
|
|
2052
2096
|
v([
|
|
2053
2097
|
f({ type: String, attribute: "name" })
|
|
2054
2098
|
], g.prototype, "name");
|
|
@@ -2097,7 +2141,7 @@ v([
|
|
|
2097
2141
|
v([
|
|
2098
2142
|
f({ type: Boolean, reflect: !0 })
|
|
2099
2143
|
], g.prototype, "readonly");
|
|
2100
|
-
const Zo =
|
|
2144
|
+
const Zo = B`
|
|
2101
2145
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
2102
2146
|
|
|
2103
2147
|
.pc-body {
|
|
@@ -2548,7 +2592,7 @@ const Zo = R`
|
|
|
2548
2592
|
animation: none;
|
|
2549
2593
|
}
|
|
2550
2594
|
}
|
|
2551
|
-
`,
|
|
2595
|
+
`, Ot = B`
|
|
2552
2596
|
/* Default values for CSS variables - can be overridden by external :root or parent definitions */
|
|
2553
2597
|
:host {
|
|
2554
2598
|
--default-primary-color: #2196f3;
|
|
@@ -3267,7 +3311,7 @@ const Zo = R`
|
|
|
3267
3311
|
opacity: 1;
|
|
3268
3312
|
}
|
|
3269
3313
|
}
|
|
3270
|
-
`,
|
|
3314
|
+
`, Jo = B`
|
|
3271
3315
|
:host {
|
|
3272
3316
|
--popover-bg: light-dark(#ffffff, #1a1a1a);
|
|
3273
3317
|
--popover-border: light-dark(#e0e0e0, #333333);
|
|
@@ -3389,12 +3433,12 @@ const Zo = R`
|
|
|
3389
3433
|
max-width: 100%;
|
|
3390
3434
|
}
|
|
3391
3435
|
`;
|
|
3392
|
-
var Xo = Object.defineProperty,
|
|
3393
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3436
|
+
var Xo = Object.defineProperty, Qo = Object.getOwnPropertyDescriptor, U = (e, t, o, r) => {
|
|
3437
|
+
for (var s = r > 1 ? void 0 : r ? Qo(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3394
3438
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3395
3439
|
return r && s && Xo(t, o, s), s;
|
|
3396
3440
|
};
|
|
3397
|
-
let _ = class extends
|
|
3441
|
+
let _ = class extends R {
|
|
3398
3442
|
constructor() {
|
|
3399
3443
|
super(...arguments), this.open = !1, this.position = "auto", this.isClosing = !1, this.computedPosition = "bottom", this.popoverStyles = {}, this.arrowStyles = {}, this.updatePosition = () => {
|
|
3400
3444
|
var h;
|
|
@@ -3483,35 +3527,35 @@ let _ = class extends N {
|
|
|
3483
3527
|
`;
|
|
3484
3528
|
}
|
|
3485
3529
|
};
|
|
3486
|
-
_.styles = [
|
|
3487
|
-
|
|
3530
|
+
_.styles = [Jo];
|
|
3531
|
+
U([
|
|
3488
3532
|
f({ type: Boolean, reflect: !0 })
|
|
3489
3533
|
], _.prototype, "open", 2);
|
|
3490
|
-
|
|
3534
|
+
U([
|
|
3491
3535
|
f({ type: String })
|
|
3492
3536
|
], _.prototype, "position", 2);
|
|
3493
|
-
|
|
3537
|
+
U([
|
|
3494
3538
|
f({ attribute: !1 })
|
|
3495
3539
|
], _.prototype, "anchor", 2);
|
|
3496
|
-
|
|
3540
|
+
U([
|
|
3497
3541
|
k()
|
|
3498
3542
|
], _.prototype, "isClosing", 2);
|
|
3499
|
-
|
|
3543
|
+
U([
|
|
3500
3544
|
k()
|
|
3501
3545
|
], _.prototype, "computedPosition", 2);
|
|
3502
|
-
|
|
3546
|
+
U([
|
|
3503
3547
|
k()
|
|
3504
3548
|
], _.prototype, "popoverStyles", 2);
|
|
3505
|
-
|
|
3549
|
+
U([
|
|
3506
3550
|
k()
|
|
3507
3551
|
], _.prototype, "arrowStyles", 2);
|
|
3508
|
-
|
|
3509
|
-
|
|
3552
|
+
U([
|
|
3553
|
+
mt(".pc-popover")
|
|
3510
3554
|
], _.prototype, "popoverElement", 2);
|
|
3511
|
-
_ =
|
|
3512
|
-
|
|
3555
|
+
_ = U([
|
|
3556
|
+
Y("pc-popover")
|
|
3513
3557
|
], _);
|
|
3514
|
-
const
|
|
3558
|
+
const tr = B`
|
|
3515
3559
|
:host {
|
|
3516
3560
|
--sheet-bg: light-dark(#ffffff, #1a1a1a);
|
|
3517
3561
|
--sheet-border: light-dark(#e0e0e0, #333333);
|
|
@@ -3624,12 +3668,12 @@ const Qo = R`
|
|
|
3624
3668
|
max-width: 100%;
|
|
3625
3669
|
}
|
|
3626
3670
|
`;
|
|
3627
|
-
var
|
|
3628
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3671
|
+
var er = Object.defineProperty, or = Object.getOwnPropertyDescriptor, tt = (e, t, o, r) => {
|
|
3672
|
+
for (var s = r > 1 ? void 0 : r ? or(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3629
3673
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3630
|
-
return r && s &&
|
|
3674
|
+
return r && s && er(t, o, s), s;
|
|
3631
3675
|
};
|
|
3632
|
-
let
|
|
3676
|
+
let V = class extends R {
|
|
3633
3677
|
constructor() {
|
|
3634
3678
|
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) => {
|
|
3635
3679
|
if (e.key === "Escape" && this.open && (e.preventDefault(), e.stopPropagation(), this.close()), e.key === "Tab" && this.open && this.sheetElement) {
|
|
@@ -3723,35 +3767,35 @@ let D = class extends N {
|
|
|
3723
3767
|
`;
|
|
3724
3768
|
}
|
|
3725
3769
|
};
|
|
3726
|
-
|
|
3727
|
-
|
|
3770
|
+
V.styles = [tr];
|
|
3771
|
+
tt([
|
|
3728
3772
|
f({ type: Boolean, reflect: !0 })
|
|
3729
|
-
],
|
|
3730
|
-
|
|
3773
|
+
], V.prototype, "open", 2);
|
|
3774
|
+
tt([
|
|
3731
3775
|
f({ type: Boolean, attribute: "drag-to-close" })
|
|
3732
|
-
],
|
|
3733
|
-
|
|
3776
|
+
], V.prototype, "dragToClose", 2);
|
|
3777
|
+
tt([
|
|
3734
3778
|
k()
|
|
3735
|
-
],
|
|
3736
|
-
|
|
3779
|
+
], V.prototype, "isClosing", 2);
|
|
3780
|
+
tt([
|
|
3737
3781
|
k()
|
|
3738
|
-
],
|
|
3739
|
-
|
|
3782
|
+
], V.prototype, "isDragging", 2);
|
|
3783
|
+
tt([
|
|
3740
3784
|
k()
|
|
3741
|
-
],
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
],
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
],
|
|
3748
|
-
var
|
|
3749
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3785
|
+
], V.prototype, "dragOffset", 2);
|
|
3786
|
+
tt([
|
|
3787
|
+
mt(".pc-bottom-sheet")
|
|
3788
|
+
], V.prototype, "sheetElement", 2);
|
|
3789
|
+
V = tt([
|
|
3790
|
+
Y("pc-bottom-sheet")
|
|
3791
|
+
], V);
|
|
3792
|
+
var rr = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, vt = (e, t, o, r) => {
|
|
3793
|
+
for (var s = r > 1 ? void 0 : r ? sr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3750
3794
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3751
|
-
return r && s &&
|
|
3795
|
+
return r && s && rr(t, o, s), s;
|
|
3752
3796
|
};
|
|
3753
|
-
const
|
|
3754
|
-
let
|
|
3797
|
+
const ir = 768;
|
|
3798
|
+
let X = class extends R {
|
|
3755
3799
|
constructor() {
|
|
3756
3800
|
super(...arguments), this.open = !1, this.position = "auto", this.isMobile = !1, this.handleMediaChange = (e) => {
|
|
3757
3801
|
this.isMobile = e.matches;
|
|
@@ -3767,7 +3811,7 @@ let Z = class extends N {
|
|
|
3767
3811
|
super.disconnectedCallback(), (e = this.mediaQuery) == null || e.removeEventListener("change", this.handleMediaChange);
|
|
3768
3812
|
}
|
|
3769
3813
|
setupMediaQuery() {
|
|
3770
|
-
this.mediaQuery = window.matchMedia(`(max-width: ${
|
|
3814
|
+
this.mediaQuery = window.matchMedia(`(max-width: ${ir - 1}px)`), this.isMobile = this.mediaQuery.matches, this.mediaQuery.addEventListener("change", this.handleMediaChange);
|
|
3771
3815
|
}
|
|
3772
3816
|
render() {
|
|
3773
3817
|
return this.isMobile ? c`
|
|
@@ -3786,30 +3830,30 @@ let Z = class extends N {
|
|
|
3786
3830
|
`;
|
|
3787
3831
|
}
|
|
3788
3832
|
};
|
|
3789
|
-
|
|
3833
|
+
X.styles = B`
|
|
3790
3834
|
:host {
|
|
3791
3835
|
display: contents;
|
|
3792
3836
|
}
|
|
3793
3837
|
`;
|
|
3794
|
-
|
|
3838
|
+
vt([
|
|
3795
3839
|
f({ type: Boolean, reflect: !0 })
|
|
3796
|
-
],
|
|
3797
|
-
|
|
3840
|
+
], X.prototype, "open", 2);
|
|
3841
|
+
vt([
|
|
3798
3842
|
f({ type: String })
|
|
3799
|
-
],
|
|
3800
|
-
|
|
3843
|
+
], X.prototype, "position", 2);
|
|
3844
|
+
vt([
|
|
3801
3845
|
f({ attribute: !1 })
|
|
3802
|
-
],
|
|
3803
|
-
|
|
3846
|
+
], X.prototype, "anchor", 2);
|
|
3847
|
+
vt([
|
|
3804
3848
|
k()
|
|
3805
|
-
],
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
],
|
|
3809
|
-
var
|
|
3810
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3849
|
+
], X.prototype, "isMobile", 2);
|
|
3850
|
+
X = vt([
|
|
3851
|
+
Y("pc-responsive-modal")
|
|
3852
|
+
], X);
|
|
3853
|
+
var ar = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, K = (e, t, o, r) => {
|
|
3854
|
+
for (var s = r > 1 ? void 0 : r ? nr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3811
3855
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3812
|
-
return r && s &&
|
|
3856
|
+
return r && s && ar(t, o, s), s;
|
|
3813
3857
|
};
|
|
3814
3858
|
let I = class extends g {
|
|
3815
3859
|
constructor() {
|
|
@@ -3823,15 +3867,15 @@ let I = class extends g {
|
|
|
3823
3867
|
* Render NPS buttons for edit mode
|
|
3824
3868
|
*/
|
|
3825
3869
|
renderNpsButtons() {
|
|
3826
|
-
const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o =
|
|
3827
|
-
role:
|
|
3870
|
+
const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o = rt({
|
|
3871
|
+
role: N.GROUP,
|
|
3828
3872
|
ariaLabel: this.question || "NPS Rating",
|
|
3829
3873
|
ariaDescribedby: `${t}-description`
|
|
3830
3874
|
}), r = e.map((s) => {
|
|
3831
3875
|
const i = this.dataController.isValueSelected(String(s)), a = {
|
|
3832
3876
|
"nps-button": !0,
|
|
3833
3877
|
selected: i
|
|
3834
|
-
}, l =
|
|
3878
|
+
}, l = Ao(`Rate ${s}`, i, !1);
|
|
3835
3879
|
return c`
|
|
3836
3880
|
<button
|
|
3837
3881
|
data-testid="nps-button-${s}"
|
|
@@ -3875,10 +3919,10 @@ let I = class extends g {
|
|
|
3875
3919
|
* NPS score displayed prominently in the middle
|
|
3876
3920
|
*/
|
|
3877
3921
|
renderChart() {
|
|
3878
|
-
const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = (
|
|
3879
|
-
x: o + s * Math.cos(
|
|
3880
|
-
y: r - s * Math.sin(
|
|
3881
|
-
}), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = (
|
|
3922
|
+
const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = (C) => ({
|
|
3923
|
+
x: o + s * Math.cos(C),
|
|
3924
|
+
y: r - s * Math.sin(C)
|
|
3925
|
+
}), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = (C, w, A = 0) => `M ${C.x} ${C.y} A ${s} ${s} 0 ${A} 1 ${w.x} ${w.y}`, h = p(a, l), b = p(l, n), x = p(n, d), z = ((C) => Math.PI - (C + 100) / 200 * Math.PI)(t), M = i(z);
|
|
3882
3926
|
return c`
|
|
3883
3927
|
<div class="nps-semicircle-gauge" data-testid="nps-semicircle-gauge">
|
|
3884
3928
|
<svg viewBox="0 0 200 115">
|
|
@@ -3894,7 +3938,7 @@ let I = class extends g {
|
|
|
3894
3938
|
<path class="gauge-arc gauge-arc-promoter" d="${x}" />
|
|
3895
3939
|
|
|
3896
3940
|
<!-- Needle indicator -->
|
|
3897
|
-
<circle class="gauge-needle" cx="${
|
|
3941
|
+
<circle class="gauge-needle" cx="${M.x}" cy="${M.y}" r="5" />
|
|
3898
3942
|
|
|
3899
3943
|
<!-- Score display in center -->
|
|
3900
3944
|
<text class="gauge-score" x="${o}" y="${r - 15}">${t}</text>
|
|
@@ -3954,7 +3998,7 @@ let I = class extends g {
|
|
|
3954
3998
|
* Uses SVG with 3 colored segments for detractors/passives/promoters
|
|
3955
3999
|
*/
|
|
3956
4000
|
renderInlineGauge() {
|
|
3957
|
-
const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s =
|
|
4001
|
+
const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s = Mo(t), i = s.detractors + s.passives + s.promoters;
|
|
3958
4002
|
if (i === 0)
|
|
3959
4003
|
return c`
|
|
3960
4004
|
<div class="inline-nps-gauge">
|
|
@@ -3963,9 +4007,9 @@ let I = class extends g {
|
|
|
3963
4007
|
</svg>
|
|
3964
4008
|
</div>
|
|
3965
4009
|
`;
|
|
3966
|
-
const a = s.detractors / i * 100, l = s.passives / i * 100, n = s.promoters / i * 100, d = a / 100 * r, p = l / 100 * r, h = n / 100 * r, b = 0, x = -d, E = -(d + p),
|
|
3967
|
-
let
|
|
3968
|
-
return
|
|
4010
|
+
const a = s.detractors / i * 100, l = s.passives / i * 100, n = s.promoters / i * 100, d = a / 100 * r, p = l / 100 * r, h = n / 100 * r, b = 0, x = -d, E = -(d + p), z = this.getUserScore();
|
|
4011
|
+
let M = "gauge-bg";
|
|
4012
|
+
return z !== null && (z <= 6 ? M = "gauge-detractor" : z <= 8 ? M = "gauge-passive" : M = "gauge-promoter"), c`
|
|
3969
4013
|
<div class="inline-nps-gauge">
|
|
3970
4014
|
<svg viewBox="0 0 20 20">
|
|
3971
4015
|
<!-- Background circle -->
|
|
@@ -3998,7 +4042,7 @@ let I = class extends g {
|
|
|
3998
4042
|
stroke-dashoffset="${E}"
|
|
3999
4043
|
/>
|
|
4000
4044
|
<!-- Center dot showing user's score category -->
|
|
4001
|
-
<circle class="gauge-dot ${
|
|
4045
|
+
<circle class="gauge-dot ${M}" cx="10" cy="10" r="2" />
|
|
4002
4046
|
</svg>
|
|
4003
4047
|
</div>
|
|
4004
4048
|
`;
|
|
@@ -4009,7 +4053,7 @@ let I = class extends g {
|
|
|
4009
4053
|
* Shows add icon when no selection, edit icon when user has submitted
|
|
4010
4054
|
*/
|
|
4011
4055
|
renderInlineTrigger() {
|
|
4012
|
-
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ?
|
|
4056
|
+
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? kt : Ie;
|
|
4013
4057
|
return c`
|
|
4014
4058
|
<button
|
|
4015
4059
|
class="pc-inline-trigger"
|
|
@@ -4075,7 +4119,7 @@ let I = class extends g {
|
|
|
4075
4119
|
@keydown="${(e) => {
|
|
4076
4120
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
|
|
4077
4121
|
}}"
|
|
4078
|
-
>${this.displayController.isChartVisible ?
|
|
4122
|
+
>${this.displayController.isChartVisible ? Jt : Zt}</span
|
|
4079
4123
|
>
|
|
4080
4124
|
`;
|
|
4081
4125
|
}
|
|
@@ -4094,7 +4138,7 @@ let I = class extends g {
|
|
|
4094
4138
|
aria-label="Close"
|
|
4095
4139
|
data-testid="popover-close-button"
|
|
4096
4140
|
>
|
|
4097
|
-
${
|
|
4141
|
+
${Tt}
|
|
4098
4142
|
</button>
|
|
4099
4143
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
4100
4144
|
${this.renderPopoverNpsButtons()}
|
|
@@ -4167,32 +4211,32 @@ let I = class extends g {
|
|
|
4167
4211
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
4168
4212
|
}
|
|
4169
4213
|
};
|
|
4170
|
-
I.styles = [...g.styles,
|
|
4171
|
-
|
|
4214
|
+
I.styles = [...g.styles, Ot, Zo];
|
|
4215
|
+
K([
|
|
4172
4216
|
f({ type: String, attribute: "min-label" })
|
|
4173
4217
|
], I.prototype, "minLabel", 2);
|
|
4174
|
-
|
|
4218
|
+
K([
|
|
4175
4219
|
f({ type: String, attribute: "max-label" })
|
|
4176
4220
|
], I.prototype, "maxLabel", 2);
|
|
4177
|
-
|
|
4221
|
+
K([
|
|
4178
4222
|
f({ type: String, attribute: "thank-you-msg" })
|
|
4179
4223
|
], I.prototype, "thankYouMsg", 2);
|
|
4180
|
-
|
|
4224
|
+
K([
|
|
4181
4225
|
f({ type: String, attribute: "min-max-position" })
|
|
4182
4226
|
], I.prototype, "minMaxPosition", 2);
|
|
4183
|
-
|
|
4227
|
+
K([
|
|
4184
4228
|
k()
|
|
4185
4229
|
], I.prototype, "hoverValue", 2);
|
|
4186
|
-
|
|
4230
|
+
K([
|
|
4187
4231
|
k()
|
|
4188
4232
|
], I.prototype, "popoverOpen", 2);
|
|
4189
|
-
|
|
4190
|
-
|
|
4233
|
+
K([
|
|
4234
|
+
mt(".pc-inline-trigger")
|
|
4191
4235
|
], I.prototype, "triggerElement", 2);
|
|
4192
|
-
I =
|
|
4193
|
-
|
|
4236
|
+
I = K([
|
|
4237
|
+
Y("pc-nps")
|
|
4194
4238
|
], I);
|
|
4195
|
-
const
|
|
4239
|
+
const lr = B`
|
|
4196
4240
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
4197
4241
|
|
|
4198
4242
|
.pc-container {
|
|
@@ -4577,12 +4621,12 @@ const nr = R`
|
|
|
4577
4621
|
opacity: 0.8;
|
|
4578
4622
|
}
|
|
4579
4623
|
`;
|
|
4580
|
-
var
|
|
4581
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
4624
|
+
var cr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, bt = (e, t, o, r) => {
|
|
4625
|
+
for (var s = r > 1 ? void 0 : r ? dr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
4582
4626
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
4583
|
-
return r && s &&
|
|
4627
|
+
return r && s && cr(t, o, s), s;
|
|
4584
4628
|
};
|
|
4585
|
-
let
|
|
4629
|
+
let Q = class extends g {
|
|
4586
4630
|
constructor() {
|
|
4587
4631
|
super(), this.type = S.poll, this.multiple = !1, this.compact = !1, this.popoverOpen = !1, this.hasEditButton = !0, this.statsText = "{count} votes", this.questionPosition = "top", this.statsPosition = "bottom", this.showStats = "after-vote";
|
|
4588
4632
|
}
|
|
@@ -4640,16 +4684,16 @@ let W = class extends g {
|
|
|
4640
4684
|
*/
|
|
4641
4685
|
renderOptionIcon(e) {
|
|
4642
4686
|
if (!(e != null && e.icon)) return "";
|
|
4643
|
-
const t =
|
|
4687
|
+
const t = Qt.DECORATIVE, o = (e == null ? void 0 : e.label) || "", r = e ? this.dataController.isValueSelected(e.value) : !1, s = Be(e == null ? void 0 : e.icon, {
|
|
4644
4688
|
type: t,
|
|
4645
4689
|
alt: o,
|
|
4646
4690
|
isSelected: r
|
|
4647
4691
|
});
|
|
4648
|
-
return
|
|
4692
|
+
return Ve(e == null ? void 0 : e.icon) ? c`<span
|
|
4649
4693
|
class="poll-option-icon"
|
|
4650
4694
|
aria-hidden="${s.ariaHidden ? "true" : "false"}"
|
|
4651
4695
|
>${e == null ? void 0 : e.icon}</span
|
|
4652
|
-
>` :
|
|
4696
|
+
>` : _t(e == null ? void 0 : e.icon) ? c`<img
|
|
4653
4697
|
src="${e == null ? void 0 : e.icon}"
|
|
4654
4698
|
alt="${s.alt}"
|
|
4655
4699
|
class="poll-option-icon-img"
|
|
@@ -4665,7 +4709,7 @@ let W = class extends g {
|
|
|
4665
4709
|
* Renders the selection indicator (checkbox or radio button) with proper ARIA roles
|
|
4666
4710
|
*/
|
|
4667
4711
|
renderSelectionIndicator() {
|
|
4668
|
-
const e = this.multiple ?
|
|
4712
|
+
const e = this.multiple ? N.CHECKBOX : N.RADIO;
|
|
4669
4713
|
return this.multiple ? c`<span class="poll-checkbox" role="${e}"></span>` : c`<span class="poll-radio" role="${e}"></span>`;
|
|
4670
4714
|
}
|
|
4671
4715
|
/**
|
|
@@ -4677,7 +4721,7 @@ let W = class extends g {
|
|
|
4677
4721
|
selected: o,
|
|
4678
4722
|
"poll-option--compact": this.compact,
|
|
4679
4723
|
"poll-option--disabled": r
|
|
4680
|
-
}, i = t + 1, a = `poll-${this.type}-${i}`, l =
|
|
4724
|
+
}, i = t + 1, a = `poll-${this.type}-${i}`, l = Po(
|
|
4681
4725
|
e.label,
|
|
4682
4726
|
o,
|
|
4683
4727
|
r,
|
|
@@ -4711,7 +4755,7 @@ let W = class extends g {
|
|
|
4711
4755
|
*/
|
|
4712
4756
|
renderPollOptions() {
|
|
4713
4757
|
var s;
|
|
4714
|
-
const e = this.multiple ?
|
|
4758
|
+
const e = this.multiple ? N.GROUP : N.RADIOGROUP, t = this.question || this.name || "Options", o = rt({
|
|
4715
4759
|
role: e,
|
|
4716
4760
|
ariaLabel: t
|
|
4717
4761
|
});
|
|
@@ -4742,7 +4786,7 @@ let W = class extends g {
|
|
|
4742
4786
|
percentage: x,
|
|
4743
4787
|
isSelected: E
|
|
4744
4788
|
};
|
|
4745
|
-
}), s = this.multiple ?
|
|
4789
|
+
}), s = this.multiple ? N.GROUP : N.RADIOGROUP, i = this.question || this.name || "Options", a = rt({
|
|
4746
4790
|
role: s,
|
|
4747
4791
|
ariaLabel: i
|
|
4748
4792
|
});
|
|
@@ -4835,7 +4879,7 @@ let W = class extends g {
|
|
|
4835
4879
|
* Shows add icon when no selection, edit icon when user has submitted
|
|
4836
4880
|
*/
|
|
4837
4881
|
renderInlineTrigger() {
|
|
4838
|
-
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ?
|
|
4882
|
+
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? kt : Ie;
|
|
4839
4883
|
return c`
|
|
4840
4884
|
<button
|
|
4841
4885
|
class="pc-inline-trigger"
|
|
@@ -4894,7 +4938,7 @@ let W = class extends g {
|
|
|
4894
4938
|
aria-label="Close"
|
|
4895
4939
|
data-testid="popover-close-button"
|
|
4896
4940
|
>
|
|
4897
|
-
${
|
|
4941
|
+
${Tt}
|
|
4898
4942
|
</button>
|
|
4899
4943
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
4900
4944
|
${e ? this.renderBarChart() : this.renderPollOptions()}
|
|
@@ -4911,7 +4955,7 @@ let W = class extends g {
|
|
|
4911
4955
|
@keydown=${(s) => {
|
|
4912
4956
|
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), this.handlePopoverEditClick());
|
|
4913
4957
|
}}
|
|
4914
|
-
>${
|
|
4958
|
+
>${kt}</span
|
|
4915
4959
|
>` : u}
|
|
4916
4960
|
</div>` : u}
|
|
4917
4961
|
</div>
|
|
@@ -4975,8 +5019,8 @@ let W = class extends g {
|
|
|
4975
5019
|
"pc-body": !0,
|
|
4976
5020
|
[`pc-flex-pos-${this.statsPosition}`]: !0,
|
|
4977
5021
|
[`pc-flex-align-${o}`]: !0
|
|
4978
|
-
}, s =
|
|
4979
|
-
role:
|
|
5022
|
+
}, s = rt({
|
|
5023
|
+
role: N.REGION,
|
|
4980
5024
|
ariaLabel: this.question || this.name || "Poll"
|
|
4981
5025
|
});
|
|
4982
5026
|
return c`
|
|
@@ -4997,23 +5041,23 @@ let W = class extends g {
|
|
|
4997
5041
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
4998
5042
|
}
|
|
4999
5043
|
};
|
|
5000
|
-
|
|
5001
|
-
|
|
5044
|
+
Q.styles = [...g.styles, Ot, lr];
|
|
5045
|
+
bt([
|
|
5002
5046
|
f({ type: Boolean })
|
|
5003
|
-
],
|
|
5004
|
-
|
|
5047
|
+
], Q.prototype, "multiple", 2);
|
|
5048
|
+
bt([
|
|
5005
5049
|
f({ type: Boolean })
|
|
5006
|
-
],
|
|
5007
|
-
|
|
5050
|
+
], Q.prototype, "compact", 2);
|
|
5051
|
+
bt([
|
|
5008
5052
|
k()
|
|
5009
|
-
],
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
],
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
],
|
|
5016
|
-
const
|
|
5053
|
+
], Q.prototype, "popoverOpen", 2);
|
|
5054
|
+
bt([
|
|
5055
|
+
mt(".pc-inline-trigger")
|
|
5056
|
+
], Q.prototype, "triggerElement", 2);
|
|
5057
|
+
Q = bt([
|
|
5058
|
+
Y("pc-poll")
|
|
5059
|
+
], Q);
|
|
5060
|
+
const pr = B`
|
|
5017
5061
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
5018
5062
|
|
|
5019
5063
|
.pc-section {
|
|
@@ -5200,10 +5244,10 @@ const dr = R`
|
|
|
5200
5244
|
* Copyright 2018 Google LLC
|
|
5201
5245
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5202
5246
|
*/
|
|
5203
|
-
const
|
|
5247
|
+
const He = "important", ur = " !" + He, hr = je(class extends qe {
|
|
5204
5248
|
constructor(e) {
|
|
5205
5249
|
var t;
|
|
5206
|
-
if (super(e), e.type !==
|
|
5250
|
+
if (super(e), e.type !== Ue.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.");
|
|
5207
5251
|
}
|
|
5208
5252
|
render(e) {
|
|
5209
5253
|
return Object.keys(e).reduce((t, o) => {
|
|
@@ -5219,14 +5263,14 @@ const Ve = "important", pr = " !" + Ve, ur = je(class extends Be {
|
|
|
5219
5263
|
const s = t[r];
|
|
5220
5264
|
if (s != null) {
|
|
5221
5265
|
this.ft.add(r);
|
|
5222
|
-
const i = typeof s == "string" && s.endsWith(
|
|
5223
|
-
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ?
|
|
5266
|
+
const i = typeof s == "string" && s.endsWith(ur);
|
|
5267
|
+
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? He : "") : o[r] = s;
|
|
5224
5268
|
}
|
|
5225
5269
|
}
|
|
5226
|
-
return
|
|
5270
|
+
return H;
|
|
5227
5271
|
}
|
|
5228
5272
|
});
|
|
5229
|
-
function
|
|
5273
|
+
function $t(e, t = {}) {
|
|
5230
5274
|
if (!e || e.length === 0)
|
|
5231
5275
|
return c`<div class="pc-bar-chart pc-bar-chart--empty">No data available</div>`;
|
|
5232
5276
|
const o = Math.max(...e.map((i) => i.value)), s = { ...{
|
|
@@ -5255,7 +5299,7 @@ function xt(e, t = {}) {
|
|
|
5255
5299
|
</div>
|
|
5256
5300
|
`;
|
|
5257
5301
|
}
|
|
5258
|
-
const
|
|
5302
|
+
const Ce = {
|
|
5259
5303
|
// Faces
|
|
5260
5304
|
smile: "😊",
|
|
5261
5305
|
laugh: "😄",
|
|
@@ -5398,19 +5442,19 @@ const we = {
|
|
|
5398
5442
|
hiking: "🥾",
|
|
5399
5443
|
yoga: "🧘"
|
|
5400
5444
|
};
|
|
5401
|
-
function
|
|
5445
|
+
function At(e) {
|
|
5402
5446
|
let t = "❓", o = !1;
|
|
5403
|
-
return e ? e in
|
|
5447
|
+
return e ? e in Ce ? t = Ce[e] : Ve(e) ? t = e : _t(e) ? (o = !0, t = e) : /^\w+@\w+$/.test(e) ? t = e : e.endsWith(".svg") && !e.includes("/") ? (t = `https://cdn.jsdelivr.net/npm/@mdi/svg@7.4.47/svg/${e}`, o = !0) : t = e : t = "❓", {
|
|
5404
5448
|
icon: t,
|
|
5405
5449
|
isRemoteImage: o
|
|
5406
5450
|
};
|
|
5407
5451
|
}
|
|
5408
|
-
var
|
|
5409
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
5452
|
+
var fr = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, nt = (e, t, o, r) => {
|
|
5453
|
+
for (var s = r > 1 ? void 0 : r ? gr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
5410
5454
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
5411
|
-
return r && s &&
|
|
5455
|
+
return r && s && fr(t, o, s), s;
|
|
5412
5456
|
};
|
|
5413
|
-
let
|
|
5457
|
+
let F = class extends g {
|
|
5414
5458
|
constructor() {
|
|
5415
5459
|
super(), this.type = S.stars, this.icon = "★", this.numStars = 5, this.hoverValue = -1, this.popoverOpen = !1, this.handleStarKeyDown = (e) => {
|
|
5416
5460
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -5433,14 +5477,14 @@ let q = class extends g {
|
|
|
5433
5477
|
* Renders the star icon using resolveIcon for emoji, URL, or MDI support
|
|
5434
5478
|
*/
|
|
5435
5479
|
renderStarIcon() {
|
|
5436
|
-
const { icon: e, isRemoteImage: t } =
|
|
5480
|
+
const { icon: e, isRemoteImage: t } = At(this.icon);
|
|
5437
5481
|
return t ? c`<img class="star-icon-img" src="${e}" alt="star" />` : e;
|
|
5438
5482
|
}
|
|
5439
5483
|
/**
|
|
5440
5484
|
* Gets the resolved icon string (for use in chart labels)
|
|
5441
5485
|
*/
|
|
5442
5486
|
getResolvedIconString() {
|
|
5443
|
-
const { icon: e, isRemoteImage: t } =
|
|
5487
|
+
const { icon: e, isRemoteImage: t } = At(this.icon);
|
|
5444
5488
|
return t ? "★" : e;
|
|
5445
5489
|
}
|
|
5446
5490
|
/**
|
|
@@ -5456,17 +5500,17 @@ let q = class extends g {
|
|
|
5456
5500
|
selected: h,
|
|
5457
5501
|
partial: b,
|
|
5458
5502
|
"view-mode": !a
|
|
5459
|
-
}, E = b ? { "--partial-fill": `${i % 1 * 100}%` } : {},
|
|
5503
|
+
}, E = b ? { "--partial-fill": `${i % 1 * 100}%` } : {}, z = e ? () => this.handlePopoverStarClick(d) : () => this.handleStarClick(d);
|
|
5460
5504
|
return c`
|
|
5461
5505
|
<div class="pc-section" data-testid="pc-section">
|
|
5462
5506
|
<span
|
|
5463
5507
|
data-testid="${e ? "popover" : "stars-view"}-star-${d}"
|
|
5464
5508
|
class=${y(x)}
|
|
5465
|
-
style=${
|
|
5509
|
+
style=${hr(E)}
|
|
5466
5510
|
role="${a ? "button" : "presentation"}"
|
|
5467
5511
|
tabindex="${a ? "0" : ""}"
|
|
5468
5512
|
aria-label="${a ? `Rate ${d} star${d > 1 ? "s" : ""}` : ""}"
|
|
5469
|
-
@click="${
|
|
5513
|
+
@click="${z}"
|
|
5470
5514
|
@mouseenter="${() => this.handleStarHover(d)}"
|
|
5471
5515
|
@focus="${() => this.handleStarHover(d)}"
|
|
5472
5516
|
@mouseleave="${this.handleStarLeave}"
|
|
@@ -5490,7 +5534,7 @@ let q = class extends g {
|
|
|
5490
5534
|
label: n,
|
|
5491
5535
|
value: d,
|
|
5492
5536
|
icon: r
|
|
5493
|
-
})), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l =
|
|
5537
|
+
})), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = $t(s, {
|
|
5494
5538
|
barColor: a,
|
|
5495
5539
|
labelFormatter: (n) => `${n.label} ${n.icon}`,
|
|
5496
5540
|
valueFormatter: (n) => `${o > 0 ? Math.round(n.value / o * 100) : 0}%`
|
|
@@ -5590,7 +5634,7 @@ let q = class extends g {
|
|
|
5590
5634
|
aria-label="Close"
|
|
5591
5635
|
data-testid="popover-close-button"
|
|
5592
5636
|
>
|
|
5593
|
-
${
|
|
5637
|
+
${Tt}
|
|
5594
5638
|
</button>
|
|
5595
5639
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
5596
5640
|
${this.renderStars(!0)}
|
|
@@ -5613,7 +5657,7 @@ let q = class extends g {
|
|
|
5613
5657
|
label: n,
|
|
5614
5658
|
value: d,
|
|
5615
5659
|
icon: r
|
|
5616
|
-
})), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l =
|
|
5660
|
+
})), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = $t(s, {
|
|
5617
5661
|
barColor: a,
|
|
5618
5662
|
labelFormatter: (n) => `${n.label} ${n.icon}`,
|
|
5619
5663
|
valueFormatter: (n) => `${o > 0 ? Math.round(n.value / o * 100) : 0}%`
|
|
@@ -5639,7 +5683,7 @@ let q = class extends g {
|
|
|
5639
5683
|
@keydown="${(e) => {
|
|
5640
5684
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
|
|
5641
5685
|
}}"
|
|
5642
|
-
>${this.displayController.isChartVisible ?
|
|
5686
|
+
>${this.displayController.isChartVisible ? Jt : Zt}</span
|
|
5643
5687
|
>
|
|
5644
5688
|
`;
|
|
5645
5689
|
}
|
|
@@ -5682,7 +5726,7 @@ let q = class extends g {
|
|
|
5682
5726
|
label: n,
|
|
5683
5727
|
value: d,
|
|
5684
5728
|
icon: r
|
|
5685
|
-
})), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l =
|
|
5729
|
+
})), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = $t(s, {
|
|
5686
5730
|
barColor: a,
|
|
5687
5731
|
labelFormatter: (n) => `${n.label} ${n.icon}`,
|
|
5688
5732
|
valueFormatter: (n) => `${o > 0 ? Math.round(n.value / o * 100) : 0}%`
|
|
@@ -5720,26 +5764,26 @@ let q = class extends g {
|
|
|
5720
5764
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
5721
5765
|
}
|
|
5722
5766
|
};
|
|
5723
|
-
|
|
5724
|
-
|
|
5767
|
+
F.styles = [...g.styles, Ot, pr];
|
|
5768
|
+
nt([
|
|
5725
5769
|
f({ type: String })
|
|
5726
|
-
],
|
|
5727
|
-
|
|
5770
|
+
], F.prototype, "icon", 2);
|
|
5771
|
+
nt([
|
|
5728
5772
|
f({ type: Number, attribute: "num-stars" })
|
|
5729
|
-
],
|
|
5730
|
-
|
|
5773
|
+
], F.prototype, "numStars", 2);
|
|
5774
|
+
nt([
|
|
5731
5775
|
k()
|
|
5732
|
-
],
|
|
5733
|
-
|
|
5776
|
+
], F.prototype, "hoverValue", 2);
|
|
5777
|
+
nt([
|
|
5734
5778
|
k()
|
|
5735
|
-
],
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
],
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
],
|
|
5742
|
-
const
|
|
5779
|
+
], F.prototype, "popoverOpen", 2);
|
|
5780
|
+
nt([
|
|
5781
|
+
mt(".pc-inline-trigger")
|
|
5782
|
+
], F.prototype, "triggerElement", 2);
|
|
5783
|
+
F = nt([
|
|
5784
|
+
Y("pc-stars")
|
|
5785
|
+
], F);
|
|
5786
|
+
const mr = B`
|
|
5743
5787
|
/* Adjust stats text for reactions */
|
|
5744
5788
|
.pc-stats-text {
|
|
5745
5789
|
font-size: var(--pc-font-size-small, var(--default-font-size-small));
|
|
@@ -6002,13 +6046,13 @@ const gr = R`
|
|
|
6002
6046
|
animation: none;
|
|
6003
6047
|
}
|
|
6004
6048
|
}
|
|
6005
|
-
`,
|
|
6006
|
-
var
|
|
6007
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
6049
|
+
`, vr = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%20-960%20960%20960'%20width='24px'%20fill='%23434343'%3e%3cpath%20d='M480-480Zm0%20400q-83%200-156-31.5T197-197q-54-54-85.5-127T80-480q0-83%2031.5-156T197-763q54-54%20127-85.5T480-880q43%200%2083%208.5t77%2024.5v90q-35-20-75.5-31.5T480-800q-133%200-226.5%2093.5T160-480q0%20133%2093.5%20226.5T480-160q133%200%20226.5-93.5T800-480q0-32-6.5-62T776-600h86q9%2029%2013.5%2058.5T880-480q0%2083-31.5%20156T763-197q-54%2054-127%2085.5T480-80Zm320-600v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80ZM620-520q25%200%2042.5-17.5T680-580q0-25-17.5-42.5T620-640q-25%200-42.5%2017.5T560-580q0%2025%2017.5%2042.5T620-520Zm-280%200q25%200%2042.5-17.5T400-580q0-25-17.5-42.5T340-640q-25%200-42.5%2017.5T280-580q0%2025%2017.5%2042.5T340-520Zm140%20260q68%200%20123.5-38.5T684-400H276q25%2063%2080.5%20101.5T480-260Z'/%3e%3c/svg%3e";
|
|
6050
|
+
var br = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, It = (e, t, o, r) => {
|
|
6051
|
+
for (var s = r > 1 ? void 0 : r ? yr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
6008
6052
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
6009
|
-
return r && s &&
|
|
6053
|
+
return r && s && br(t, o, s), s;
|
|
6010
6054
|
};
|
|
6011
|
-
let
|
|
6055
|
+
let it = class extends g {
|
|
6012
6056
|
constructor() {
|
|
6013
6057
|
super(), this.type = S.reaction, this.showCounts = !1, this.compact = !1, this.popupPosition = "auto", this.hasEditButton = !1, this.statsText = "{count} votes", this.buttonRadius = "990px", this.muteColor = "#cccccc", this.questionPosition = "top", this.statsPosition = "right", this.popupPosition = "auto";
|
|
6014
6058
|
}
|
|
@@ -6032,7 +6076,7 @@ let ot = class extends g {
|
|
|
6032
6076
|
* Renders the icon for a reaction
|
|
6033
6077
|
*/
|
|
6034
6078
|
renderReactionIcon(e, t) {
|
|
6035
|
-
const { icon: o, isRemoteImage: r } =
|
|
6079
|
+
const { icon: o, isRemoteImage: r } = At(e), s = Qt.FUNCTIONAL, i = t.tooltip || `${t.value} reaction`, a = Be(o, {
|
|
6036
6080
|
type: s,
|
|
6037
6081
|
alt: i,
|
|
6038
6082
|
ariaLabel: i,
|
|
@@ -6086,7 +6130,7 @@ let ot = class extends g {
|
|
|
6086
6130
|
aria-expanded="${this.displayController.shouldShowReactionPopover()}"
|
|
6087
6131
|
aria-haspopup="true"
|
|
6088
6132
|
>
|
|
6089
|
-
<img src="${
|
|
6133
|
+
<img src="${vr}" alt="" class="trigger-icon" />
|
|
6090
6134
|
</button>
|
|
6091
6135
|
`;
|
|
6092
6136
|
}
|
|
@@ -6184,7 +6228,7 @@ let ot = class extends g {
|
|
|
6184
6228
|
icon: (p == null ? void 0 : p.icon) || n
|
|
6185
6229
|
// Use the icon or fall back to reaction value
|
|
6186
6230
|
};
|
|
6187
|
-
}), r = getComputedStyle(this), s = r.getPropertyValue("--pc-primary-color").trim(), a = r.getPropertyValue("--pc-accent-color").trim() || s || "#ffc107", l =
|
|
6231
|
+
}), r = getComputedStyle(this), s = r.getPropertyValue("--pc-primary-color").trim(), a = r.getPropertyValue("--pc-accent-color").trim() || s || "#ffc107", l = $t(o, {
|
|
6188
6232
|
barColor: a,
|
|
6189
6233
|
labelFormatter: (n) => `${n.label}`,
|
|
6190
6234
|
valueFormatter: (n) => `${e.totalCount > 0 ? Math.round(n.value / e.totalCount * 100) : 0}%`
|
|
@@ -6248,35 +6292,35 @@ let ot = class extends g {
|
|
|
6248
6292
|
return this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
6249
6293
|
}
|
|
6250
6294
|
};
|
|
6251
|
-
|
|
6252
|
-
|
|
6295
|
+
it.styles = [...g.styles, Ot, mr];
|
|
6296
|
+
It([
|
|
6253
6297
|
f({ type: Boolean, attribute: "show-counts" })
|
|
6254
|
-
],
|
|
6255
|
-
|
|
6298
|
+
], it.prototype, "showCounts", 2);
|
|
6299
|
+
It([
|
|
6256
6300
|
f({ type: Boolean, reflect: !0 })
|
|
6257
|
-
],
|
|
6258
|
-
|
|
6301
|
+
], it.prototype, "compact", 2);
|
|
6302
|
+
It([
|
|
6259
6303
|
f({ type: String, attribute: "popup-position" })
|
|
6260
|
-
],
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
],
|
|
6264
|
-
function
|
|
6304
|
+
], it.prototype, "popupPosition", 2);
|
|
6305
|
+
it = It([
|
|
6306
|
+
Y("pc-reaction")
|
|
6307
|
+
], it);
|
|
6308
|
+
function ct(e, t, o = void 0) {
|
|
6265
6309
|
const r = e.getAttribute(t);
|
|
6266
6310
|
return r === null ? o : r == null ? void 0 : r.trim();
|
|
6267
6311
|
}
|
|
6268
|
-
function
|
|
6312
|
+
function xr(e, t = void 0) {
|
|
6269
6313
|
const o = e.textContent;
|
|
6270
6314
|
return o === "" || o === null ? t : o == null ? void 0 : o.trim();
|
|
6271
6315
|
}
|
|
6272
|
-
var
|
|
6273
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
6316
|
+
var wr = Object.defineProperty, $r = Object.getOwnPropertyDescriptor, zt = (e, t, o, r) => {
|
|
6317
|
+
for (var s = r > 1 ? void 0 : r ? $r(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
6274
6318
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
6275
|
-
return r && s &&
|
|
6319
|
+
return r && s && wr(t, o, s), s;
|
|
6276
6320
|
};
|
|
6277
|
-
let
|
|
6321
|
+
let at = class extends R {
|
|
6278
6322
|
constructor() {
|
|
6279
|
-
super(), this.options = "", this.parsedOptions = [],
|
|
6323
|
+
super(), this.options = "", this.parsedOptions = [], at.injectGlobalStyle();
|
|
6280
6324
|
}
|
|
6281
6325
|
/**
|
|
6282
6326
|
* Inject global style to hide poll-catch-option elements
|
|
@@ -6335,16 +6379,16 @@ let rt = class extends N {
|
|
|
6335
6379
|
const e = this.querySelector("pc-poll, pc-reaction");
|
|
6336
6380
|
if (!e) return;
|
|
6337
6381
|
const t = this.querySelectorAll("poll-catch-option");
|
|
6338
|
-
let r =
|
|
6382
|
+
let r = Uo(this.options).map((s) => ({
|
|
6339
6383
|
value: s,
|
|
6340
6384
|
label: s,
|
|
6341
6385
|
icon: e.tagName === "PC-REACTION" ? s : void 0
|
|
6342
6386
|
// REACTION widget uses options for the icon
|
|
6343
6387
|
}));
|
|
6344
6388
|
t && t.length > 0 && (r = Array.from(t).map((s) => {
|
|
6345
|
-
const i =
|
|
6389
|
+
const i = ct(s, "value", "") || "", a = ct(s, "label", xr(s, i)) || "", l = ct(s, "icon", void 0), n = ct(s, "tooltip", void 0), d = ct(s, "disabled", void 0), p = { value: i, label: a };
|
|
6346
6390
|
if (l !== void 0) {
|
|
6347
|
-
const h =
|
|
6391
|
+
const h = At(l);
|
|
6348
6392
|
p.icon = h.icon;
|
|
6349
6393
|
}
|
|
6350
6394
|
return n !== void 0 && (p.tooltip = n), d !== void 0 && (p.disabled = !0), p;
|
|
@@ -6370,18 +6414,18 @@ let rt = class extends N {
|
|
|
6370
6414
|
}
|
|
6371
6415
|
}
|
|
6372
6416
|
};
|
|
6373
|
-
|
|
6417
|
+
zt([
|
|
6374
6418
|
f({ type: String })
|
|
6375
|
-
],
|
|
6376
|
-
|
|
6419
|
+
], at.prototype, "type", 2);
|
|
6420
|
+
zt([
|
|
6377
6421
|
f({ type: String })
|
|
6378
|
-
],
|
|
6379
|
-
|
|
6422
|
+
], at.prototype, "options", 2);
|
|
6423
|
+
zt([
|
|
6380
6424
|
k()
|
|
6381
|
-
],
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
],
|
|
6425
|
+
], at.prototype, "parsedOptions", 2);
|
|
6426
|
+
at = zt([
|
|
6427
|
+
Y("poll-catch")
|
|
6428
|
+
], at);
|
|
6385
6429
|
export {
|
|
6386
|
-
|
|
6430
|
+
at as PollCatch
|
|
6387
6431
|
};
|