pollcatch 2.1.9 → 2.1.11
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 +66 -60
package/package.json
CHANGED
package/pc.js
CHANGED
|
@@ -909,7 +909,13 @@ function fo(e) {
|
|
|
909
909
|
let t = e;
|
|
910
910
|
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;
|
|
911
911
|
}
|
|
912
|
-
|
|
912
|
+
function mo(e) {
|
|
913
|
+
return typeof e != "string" || !e.trim() ? "" : e.replace(
|
|
914
|
+
/([^{}:;]+):\s*([^;{}!]+)(\s*!important)?\s*(;|})/gi,
|
|
915
|
+
(t, o, r, s, i) => s ? t : `${o}: ${r.trim()} !important${i}`
|
|
916
|
+
);
|
|
917
|
+
}
|
|
918
|
+
const ee = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", bo = "pc_session_id", go = 24 * 60 * 60 * 1e3;
|
|
913
919
|
function oe() {
|
|
914
920
|
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) {
|
|
915
921
|
const t = Math.random() * 16 | 0;
|
|
@@ -940,7 +946,7 @@ function ge(e, t) {
|
|
|
940
946
|
return m.warn(`Failed to set item in localStorage: ${e}`, o), !1;
|
|
941
947
|
}
|
|
942
948
|
}
|
|
943
|
-
async function
|
|
949
|
+
async function vo() {
|
|
944
950
|
if (typeof window < "u") {
|
|
945
951
|
if (window.pcProject !== void 0)
|
|
946
952
|
return m.debug("Found project key in global variable"), window.pcProject;
|
|
@@ -954,7 +960,7 @@ async function go() {
|
|
|
954
960
|
m.warn("No project key found in global variable or script tags");
|
|
955
961
|
}
|
|
956
962
|
async function re() {
|
|
957
|
-
const e =
|
|
963
|
+
const e = bo, t = go;
|
|
958
964
|
if (Tt()) {
|
|
959
965
|
const o = be(e);
|
|
960
966
|
if (o && o.id && o.timestamp && Date.now() - o.timestamp < t)
|
|
@@ -996,7 +1002,7 @@ function O() {
|
|
|
996
1002
|
updated: (/* @__PURE__ */ new Date()).toISOString()
|
|
997
1003
|
};
|
|
998
1004
|
}
|
|
999
|
-
function
|
|
1005
|
+
function yo(e) {
|
|
1000
1006
|
if (!Tt())
|
|
1001
1007
|
return O();
|
|
1002
1008
|
try {
|
|
@@ -1006,7 +1012,7 @@ function vo(e) {
|
|
|
1006
1012
|
return m.warn("Failed to load localStats from localStorage", t), O();
|
|
1007
1013
|
}
|
|
1008
1014
|
}
|
|
1009
|
-
function
|
|
1015
|
+
function wo(e, t) {
|
|
1010
1016
|
if (!Tt())
|
|
1011
1017
|
return !1;
|
|
1012
1018
|
try {
|
|
@@ -1015,7 +1021,7 @@ function yo(e, t) {
|
|
|
1015
1021
|
return m.warn("Failed to save localStats to localStorage", o), !1;
|
|
1016
1022
|
}
|
|
1017
1023
|
}
|
|
1018
|
-
function
|
|
1024
|
+
function $o(e, t) {
|
|
1019
1025
|
const o = {
|
|
1020
1026
|
count: Math.max(0, e.count - t.count),
|
|
1021
1027
|
sum: (e.sum || 0) - (t.sum || 0),
|
|
@@ -1030,7 +1036,7 @@ function wo(e, t) {
|
|
|
1030
1036
|
o.breakdown[r] && (o.breakdown[r] = Math.max(0, o.breakdown[r] - s), o.breakdown[r] === 0 && delete o.breakdown[r]);
|
|
1031
1037
|
return o.nps = lt((o == null ? void 0 : o.breakdown) || {}), o;
|
|
1032
1038
|
}
|
|
1033
|
-
function
|
|
1039
|
+
function xo(e, t) {
|
|
1034
1040
|
if (!e.count && !t.count)
|
|
1035
1041
|
return O();
|
|
1036
1042
|
if (!e.count)
|
|
@@ -1068,7 +1074,7 @@ function dt(e) {
|
|
|
1068
1074
|
return !1;
|
|
1069
1075
|
}
|
|
1070
1076
|
}
|
|
1071
|
-
function
|
|
1077
|
+
function So(e) {
|
|
1072
1078
|
if (!e || typeof e != "string")
|
|
1073
1079
|
return [];
|
|
1074
1080
|
const t = e.trim();
|
|
@@ -1083,24 +1089,24 @@ function xo(e) {
|
|
|
1083
1089
|
}
|
|
1084
1090
|
return t.split(",").map((o) => o.trim()).filter((o) => o !== "");
|
|
1085
1091
|
}
|
|
1086
|
-
function
|
|
1092
|
+
function Co(e, t) {
|
|
1087
1093
|
const o = /{([^{}]+)}/g;
|
|
1088
1094
|
return e.replace(o, (r, s) => {
|
|
1089
1095
|
const i = s.trim(), a = t[i];
|
|
1090
1096
|
return a !== void 0 ? String(a) : r;
|
|
1091
1097
|
});
|
|
1092
1098
|
}
|
|
1093
|
-
function
|
|
1099
|
+
function ko(e, t) {
|
|
1094
1100
|
let o = 2166136261;
|
|
1095
1101
|
const r = e + ":" + t;
|
|
1096
1102
|
for (let s = 0; s < r.length; s++)
|
|
1097
1103
|
o ^= r.charCodeAt(s), o += (o << 1) + (o << 4) + (o << 7) + (o << 8) + (o << 24);
|
|
1098
1104
|
return (o >>> 0).toString(16).padStart(8, "0");
|
|
1099
1105
|
}
|
|
1100
|
-
function
|
|
1106
|
+
function Ao(e, t = 50) {
|
|
1101
1107
|
return e.length <= t ? e : e.substring(0, t).trim() + "...";
|
|
1102
1108
|
}
|
|
1103
|
-
class
|
|
1109
|
+
class _o {
|
|
1104
1110
|
constructor(t) {
|
|
1105
1111
|
this.stats = O(), this.localStats = O(), this.isLoading = !0, this.isSubmitting = !1, (this.host = t).addController(this);
|
|
1106
1112
|
}
|
|
@@ -1108,7 +1114,7 @@ class Ao {
|
|
|
1108
1114
|
this.loadStats();
|
|
1109
1115
|
}
|
|
1110
1116
|
async getProjectId() {
|
|
1111
|
-
return this.host.project || await
|
|
1117
|
+
return this.host.project || await vo() || "public";
|
|
1112
1118
|
}
|
|
1113
1119
|
async getLocalStatsKey() {
|
|
1114
1120
|
const t = this.host, o = await re(), r = await this.getProjectId(), s = t.name || "unnamed";
|
|
@@ -1185,7 +1191,7 @@ class Ao {
|
|
|
1185
1191
|
async loadLocalStats() {
|
|
1186
1192
|
const t = await this.getLocalStatsKey();
|
|
1187
1193
|
try {
|
|
1188
|
-
const o =
|
|
1194
|
+
const o = yo(t);
|
|
1189
1195
|
m.debug("Loaded localStats from localStorage", o), this.localStats = o;
|
|
1190
1196
|
} catch (o) {
|
|
1191
1197
|
m.warn("Failed to generate localStorage key for localStats", o), this.localStats = O();
|
|
@@ -1198,7 +1204,7 @@ class Ao {
|
|
|
1198
1204
|
async persistLocalStats() {
|
|
1199
1205
|
try {
|
|
1200
1206
|
const t = await this.getLocalStatsKey();
|
|
1201
|
-
|
|
1207
|
+
wo(t, this.localStats) || m.warn("Failed to save localStats to localStorage");
|
|
1202
1208
|
} catch (t) {
|
|
1203
1209
|
m.warn("Failed to save localStats to localStorage", t);
|
|
1204
1210
|
}
|
|
@@ -1213,7 +1219,7 @@ class Ao {
|
|
|
1213
1219
|
*/
|
|
1214
1220
|
updateStats(t, o) {
|
|
1215
1221
|
const r = this.host;
|
|
1216
|
-
if (this.stats && (this.stats =
|
|
1222
|
+
if (this.stats && (this.stats = $o(this.stats, this.localStats)), this.localStats = {
|
|
1217
1223
|
count: t > 0 || r.type === x.nps ? 1 : 0,
|
|
1218
1224
|
// always 1 or 0
|
|
1219
1225
|
sum: t,
|
|
@@ -1228,7 +1234,7 @@ class Ao {
|
|
|
1228
1234
|
}, o && o.length > 0)
|
|
1229
1235
|
for (const s of o)
|
|
1230
1236
|
s && (this.localStats.breakdown[s] = 1);
|
|
1231
|
-
this.stats =
|
|
1237
|
+
this.stats = xo(this.stats, this.localStats), m.debug("Stats updated - remote: ", this.stats), m.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
|
|
1232
1238
|
}
|
|
1233
1239
|
async markStatsAsSubmitted() {
|
|
1234
1240
|
this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), await this.persistLocalStats(), this.host.requestUpdate();
|
|
@@ -1248,7 +1254,7 @@ class Ao {
|
|
|
1248
1254
|
textValues: n,
|
|
1249
1255
|
metadata: t.metadata,
|
|
1250
1256
|
timestamp: o
|
|
1251
|
-
}, u =
|
|
1257
|
+
}, u = ko(JSON.stringify(l), o);
|
|
1252
1258
|
try {
|
|
1253
1259
|
await this.sendStats({ ...l, hash: u }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(l);
|
|
1254
1260
|
} catch (c) {
|
|
@@ -1302,7 +1308,7 @@ class Ao {
|
|
|
1302
1308
|
pct: (o == null ? void 0 : o.pct) || 0,
|
|
1303
1309
|
nps: r.type === x.nps ? lt((o == null ? void 0 : o.breakdown) || {}) : 0
|
|
1304
1310
|
};
|
|
1305
|
-
return m.debug("Stats data: ", this.stats),
|
|
1311
|
+
return m.debug("Stats data: ", this.stats), Co(t, s);
|
|
1306
1312
|
}
|
|
1307
1313
|
/**
|
|
1308
1314
|
* Checks if a value is selected in the local stats
|
|
@@ -1389,7 +1395,7 @@ class Ao {
|
|
|
1389
1395
|
return ((t = this.localStats) == null ? void 0 : t.submitted) !== void 0 && this.hasLocalStats();
|
|
1390
1396
|
}
|
|
1391
1397
|
}
|
|
1392
|
-
class
|
|
1398
|
+
class Eo {
|
|
1393
1399
|
constructor(t, o) {
|
|
1394
1400
|
this.isEditing = !0, this.isChartVisible = !1, this.isStatsVisible = !1, this.isThankYouVisible = !1, this.isReactionPopoverVisible = !1, this.initialized = !1, this.handleClickOutside = (r) => {
|
|
1395
1401
|
r.target !== this.host && (this.toggleThankYouVisibility(!1), this.toggleReactionPopoverVisibility(!1));
|
|
@@ -1490,13 +1496,13 @@ function ye(e, t = {}) {
|
|
|
1490
1496
|
ariaHidden: !1
|
|
1491
1497
|
};
|
|
1492
1498
|
}
|
|
1493
|
-
function
|
|
1499
|
+
function Po(e, t = "polite") {
|
|
1494
1500
|
let o = document.getElementById("screen-reader-announcer");
|
|
1495
1501
|
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(() => {
|
|
1496
1502
|
o.textContent = e;
|
|
1497
1503
|
}, 50);
|
|
1498
1504
|
}
|
|
1499
|
-
function
|
|
1505
|
+
function Oo(e, t) {
|
|
1500
1506
|
return `${e}: ${t}`;
|
|
1501
1507
|
}
|
|
1502
1508
|
/**
|
|
@@ -1550,10 +1556,10 @@ const w = $e(class extends xe {
|
|
|
1550
1556
|
return z;
|
|
1551
1557
|
}
|
|
1552
1558
|
});
|
|
1553
|
-
var
|
|
1559
|
+
var To = Object.defineProperty, g = (e, t, o, r) => {
|
|
1554
1560
|
for (var s = void 0, i = e.length - 1, a; i >= 0; i--)
|
|
1555
1561
|
(a = e[i]) && (s = a(t, o, s) || s);
|
|
1556
|
-
return s &&
|
|
1562
|
+
return s && To(t, o, s), s;
|
|
1557
1563
|
};
|
|
1558
1564
|
const st = {
|
|
1559
1565
|
mobile: "480px",
|
|
@@ -1561,7 +1567,7 @@ const st = {
|
|
|
1561
1567
|
desktop: "1024px"
|
|
1562
1568
|
}, Mt = class Mt extends j {
|
|
1563
1569
|
constructor() {
|
|
1564
|
-
super(...arguments), this.dataController = new
|
|
1570
|
+
super(...arguments), this.dataController = new _o(this), this.displayController = new Eo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.lockAnswer = !1, this.ariaLabel = null, this.minContrast = me.AA_NORMAL, this.options = [], this.project = "public", this.questionPosition = "top", this.statsText = "{count} votes", this.buttonText = "Submit", this.buttonRadius = "sm", this.multiple = !1, this.readOnly = !1, this.handleEditToggleKeyDown = (t) => {
|
|
1565
1571
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
|
|
1566
1572
|
};
|
|
1567
1573
|
}
|
|
@@ -1637,7 +1643,7 @@ const st = {
|
|
|
1637
1643
|
`;
|
|
1638
1644
|
}
|
|
1639
1645
|
o += `}
|
|
1640
|
-
`, this.css && (o += fo(this.css)), t.textContent = o;
|
|
1646
|
+
`, this.css && (o += mo(fo(this.css))), t.textContent = o;
|
|
1641
1647
|
}
|
|
1642
1648
|
/**
|
|
1643
1649
|
* Update ARIA attributes for accessibility
|
|
@@ -1668,7 +1674,7 @@ const st = {
|
|
|
1668
1674
|
*/
|
|
1669
1675
|
announceSelectionChange(t, o, r) {
|
|
1670
1676
|
const s = `Poll for "${t}"`, i = r ? `${o.label} selected` : `${o.label} unselected`;
|
|
1671
|
-
|
|
1677
|
+
Po(Oo(s, i));
|
|
1672
1678
|
}
|
|
1673
1679
|
/** Common render methods */
|
|
1674
1680
|
renderLabel() {
|
|
@@ -1745,7 +1751,7 @@ const st = {
|
|
|
1745
1751
|
renderThankYouMessage() {
|
|
1746
1752
|
if (!this.displayController.shouldDisplayThankYouMsg())
|
|
1747
1753
|
return h;
|
|
1748
|
-
const t =
|
|
1754
|
+
const t = Ao(this.thankYouMsg || "");
|
|
1749
1755
|
return d`
|
|
1750
1756
|
<div class="pc-thank-you-overlay" data-testid="poll-thank-you-overlay">
|
|
1751
1757
|
<div class="pc-thank-you" data-testid="thank-you">
|
|
@@ -1955,7 +1961,7 @@ g([
|
|
|
1955
1961
|
g([
|
|
1956
1962
|
f({ type: Boolean, attribute: "read-only" })
|
|
1957
1963
|
], b.prototype, "readOnly");
|
|
1958
|
-
const
|
|
1964
|
+
const zo = F`
|
|
1959
1965
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
1960
1966
|
|
|
1961
1967
|
.pc-body {
|
|
@@ -2610,10 +2616,10 @@ function It(e, t = {}) {
|
|
|
2610
2616
|
</div>
|
|
2611
2617
|
`;
|
|
2612
2618
|
}
|
|
2613
|
-
var
|
|
2614
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
2619
|
+
var Io = Object.defineProperty, No = Object.getOwnPropertyDescriptor, Y = (e, t, o, r) => {
|
|
2620
|
+
for (var s = r > 1 ? void 0 : r ? No(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
2615
2621
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
2616
|
-
return r && s &&
|
|
2622
|
+
return r && s && Io(t, o, s), s;
|
|
2617
2623
|
};
|
|
2618
2624
|
let I = class extends b {
|
|
2619
2625
|
constructor() {
|
|
@@ -2743,7 +2749,7 @@ let I = class extends b {
|
|
|
2743
2749
|
`;
|
|
2744
2750
|
}
|
|
2745
2751
|
};
|
|
2746
|
-
I.styles = [...b.styles, pt,
|
|
2752
|
+
I.styles = [...b.styles, pt, zo];
|
|
2747
2753
|
Y([
|
|
2748
2754
|
f({ type: String, attribute: "min-label" })
|
|
2749
2755
|
], I.prototype, "minLabel", 2);
|
|
@@ -2762,7 +2768,7 @@ Y([
|
|
|
2762
2768
|
I = Y([
|
|
2763
2769
|
ot("pc-nps")
|
|
2764
2770
|
], I);
|
|
2765
|
-
const
|
|
2771
|
+
const Mo = F`
|
|
2766
2772
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
2767
2773
|
|
|
2768
2774
|
.pc-container {
|
|
@@ -3019,10 +3025,10 @@ const No = F`
|
|
|
3019
3025
|
visibility: hidden;
|
|
3020
3026
|
}
|
|
3021
3027
|
`;
|
|
3022
|
-
var
|
|
3023
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3028
|
+
var Lo = Object.defineProperty, Ro = Object.getOwnPropertyDescriptor, Nt = (e, t, o, r) => {
|
|
3029
|
+
for (var s = r > 1 ? void 0 : r ? Ro(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3024
3030
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3025
|
-
return r && s &&
|
|
3031
|
+
return r && s && Lo(t, o, s), s;
|
|
3026
3032
|
};
|
|
3027
3033
|
let tt = class extends b {
|
|
3028
3034
|
constructor() {
|
|
@@ -3287,7 +3293,7 @@ let tt = class extends b {
|
|
|
3287
3293
|
`;
|
|
3288
3294
|
}
|
|
3289
3295
|
};
|
|
3290
|
-
tt.styles = [...b.styles, pt,
|
|
3296
|
+
tt.styles = [...b.styles, pt, Mo];
|
|
3291
3297
|
Nt([
|
|
3292
3298
|
f({ type: Boolean })
|
|
3293
3299
|
], tt.prototype, "multiple", 2);
|
|
@@ -3297,7 +3303,7 @@ Nt([
|
|
|
3297
3303
|
tt = Nt([
|
|
3298
3304
|
ot("pc-poll")
|
|
3299
3305
|
], tt);
|
|
3300
|
-
const
|
|
3306
|
+
const Uo = F`
|
|
3301
3307
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
3302
3308
|
|
|
3303
3309
|
.pc-section {
|
|
@@ -3379,7 +3385,7 @@ const Ro = F`
|
|
|
3379
3385
|
* Copyright 2018 Google LLC
|
|
3380
3386
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3381
3387
|
*/
|
|
3382
|
-
const Se = "important",
|
|
3388
|
+
const Se = "important", jo = " !" + Se, Bo = $e(class extends xe {
|
|
3383
3389
|
constructor(e) {
|
|
3384
3390
|
var t;
|
|
3385
3391
|
if (super(e), e.type !== we.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.");
|
|
@@ -3398,17 +3404,17 @@ const Se = "important", Uo = " !" + Se, jo = $e(class extends xe {
|
|
|
3398
3404
|
const s = t[r];
|
|
3399
3405
|
if (s != null) {
|
|
3400
3406
|
this.ft.add(r);
|
|
3401
|
-
const i = typeof s == "string" && s.endsWith(
|
|
3407
|
+
const i = typeof s == "string" && s.endsWith(jo);
|
|
3402
3408
|
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? Se : "") : o[r] = s;
|
|
3403
3409
|
}
|
|
3404
3410
|
}
|
|
3405
3411
|
return z;
|
|
3406
3412
|
}
|
|
3407
3413
|
});
|
|
3408
|
-
var
|
|
3409
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3414
|
+
var Do = Object.defineProperty, Vo = Object.getOwnPropertyDescriptor, ut = (e, t, o, r) => {
|
|
3415
|
+
for (var s = r > 1 ? void 0 : r ? Vo(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3410
3416
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3411
|
-
return r && s &&
|
|
3417
|
+
return r && s && Do(t, o, s), s;
|
|
3412
3418
|
};
|
|
3413
3419
|
let V = class extends b {
|
|
3414
3420
|
constructor() {
|
|
@@ -3447,7 +3453,7 @@ let V = class extends b {
|
|
|
3447
3453
|
<span
|
|
3448
3454
|
data-testid="stars-view-star-${n}"
|
|
3449
3455
|
class=${w(c)}
|
|
3450
|
-
style=${
|
|
3456
|
+
style=${Bo(p)}
|
|
3451
3457
|
role="${r ? "button" : "presentation"}"
|
|
3452
3458
|
tabindex="${r ? "0" : ""}"
|
|
3453
3459
|
aria-label="${r ? `Rate ${n} star${n > 1 ? "s" : ""}` : ""}"
|
|
@@ -3507,7 +3513,7 @@ let V = class extends b {
|
|
|
3507
3513
|
`;
|
|
3508
3514
|
}
|
|
3509
3515
|
};
|
|
3510
|
-
V.styles = [...b.styles, pt,
|
|
3516
|
+
V.styles = [...b.styles, pt, Uo];
|
|
3511
3517
|
ut([
|
|
3512
3518
|
f({ type: String })
|
|
3513
3519
|
], V.prototype, "icon", 2);
|
|
@@ -3520,7 +3526,7 @@ ut([
|
|
|
3520
3526
|
V = ut([
|
|
3521
3527
|
ot("pc-stars")
|
|
3522
3528
|
], V);
|
|
3523
|
-
const
|
|
3529
|
+
const qo = F`
|
|
3524
3530
|
/* Adjust stats text for reactions */
|
|
3525
3531
|
.pc-stats-text {
|
|
3526
3532
|
font-size: var(--pc-font-size-small, var(--default-font-size-small));
|
|
@@ -3620,7 +3626,7 @@ const Vo = F`
|
|
|
3620
3626
|
/* Icon styling */
|
|
3621
3627
|
.icon {
|
|
3622
3628
|
display: inline-block;
|
|
3623
|
-
line-height: 1
|
|
3629
|
+
line-height: 1;
|
|
3624
3630
|
transition:
|
|
3625
3631
|
color 0.3s,
|
|
3626
3632
|
transform 0.3s;
|
|
@@ -3864,11 +3870,11 @@ function Ce(e) {
|
|
|
3864
3870
|
isRemoteImage: o
|
|
3865
3871
|
};
|
|
3866
3872
|
}
|
|
3867
|
-
const
|
|
3868
|
-
var
|
|
3869
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3873
|
+
const Ho = "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";
|
|
3874
|
+
var Fo = Object.defineProperty, Yo = Object.getOwnPropertyDescriptor, ht = (e, t, o, r) => {
|
|
3875
|
+
for (var s = r > 1 ? void 0 : r ? Yo(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3870
3876
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3871
|
-
return r && s &&
|
|
3877
|
+
return r && s && Fo(t, o, s), s;
|
|
3872
3878
|
};
|
|
3873
3879
|
let q = class extends b {
|
|
3874
3880
|
constructor() {
|
|
@@ -3948,7 +3954,7 @@ let q = class extends b {
|
|
|
3948
3954
|
aria-expanded="${this.displayController.shouldShowReactionPopover()}"
|
|
3949
3955
|
aria-haspopup="true"
|
|
3950
3956
|
>
|
|
3951
|
-
<img src="${
|
|
3957
|
+
<img src="${Ho}" alt="" class="trigger-icon" />
|
|
3952
3958
|
</button>
|
|
3953
3959
|
`;
|
|
3954
3960
|
}
|
|
@@ -4079,7 +4085,7 @@ let q = class extends b {
|
|
|
4079
4085
|
`;
|
|
4080
4086
|
}
|
|
4081
4087
|
};
|
|
4082
|
-
q.styles = [...b.styles, pt,
|
|
4088
|
+
q.styles = [...b.styles, pt, qo];
|
|
4083
4089
|
ht([
|
|
4084
4090
|
f({ type: Boolean, attribute: "show-counts" })
|
|
4085
4091
|
], q.prototype, "showCounts", 2);
|
|
@@ -4096,14 +4102,14 @@ function G(e, t, o = void 0) {
|
|
|
4096
4102
|
const r = e.getAttribute(t);
|
|
4097
4103
|
return r === null ? o : r == null ? void 0 : r.trim();
|
|
4098
4104
|
}
|
|
4099
|
-
function
|
|
4105
|
+
function Zo(e, t = void 0) {
|
|
4100
4106
|
const o = e.textContent;
|
|
4101
4107
|
return o === "" || o === null ? t : o == null ? void 0 : o.trim();
|
|
4102
4108
|
}
|
|
4103
|
-
var
|
|
4104
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
4109
|
+
var Go = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, ft = (e, t, o, r) => {
|
|
4110
|
+
for (var s = r > 1 ? void 0 : r ? Ko(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
4105
4111
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
4106
|
-
return r && s &&
|
|
4112
|
+
return r && s && Go(t, o, s), s;
|
|
4107
4113
|
};
|
|
4108
4114
|
let H = class extends j {
|
|
4109
4115
|
constructor() {
|
|
@@ -4166,14 +4172,14 @@ let H = class extends j {
|
|
|
4166
4172
|
const e = this.querySelector("pc-poll, pc-reaction");
|
|
4167
4173
|
if (!e) return;
|
|
4168
4174
|
const t = this.querySelectorAll("poll-catch-option");
|
|
4169
|
-
let r =
|
|
4175
|
+
let r = So(this.options).map((s) => ({
|
|
4170
4176
|
value: s,
|
|
4171
4177
|
label: s,
|
|
4172
4178
|
icon: e.tagName === "PC-REACTION" ? s : void 0
|
|
4173
4179
|
// REACTION widget uses options for the icon
|
|
4174
4180
|
}));
|
|
4175
4181
|
t && t.length > 0 && (r = Array.from(t).map((s) => {
|
|
4176
|
-
const i = G(s, "value", "") || "", a = G(s, "label",
|
|
4182
|
+
const i = G(s, "value", "") || "", a = G(s, "label", Zo(s, i)) || "", n = G(s, "icon", void 0), l = G(s, "tooltip", void 0), u = G(s, "disabled", void 0), c = { value: i, label: a };
|
|
4177
4183
|
if (n !== void 0) {
|
|
4178
4184
|
const p = Ce(n);
|
|
4179
4185
|
c.icon = p.icon;
|