${this._plates().map((e) => this._renderPlate(e))}
@@ -1256,7 +1244,7 @@ class Pe extends A {
`;
}
_timeZone() {
- return fe(this.hass);
+ return ve(this.hass);
}
_state(t) {
const n = this.hass?.states?.[t];
@@ -1280,7 +1268,7 @@ class Pe extends A {
const e = this._state(
"sensor.nestquest_household_quests_due_today"
)?.attributes?.child_roster;
- return Array.isArray(e) ? e.map((n) => ye(n)).filter((n) => n.length > 0) : [];
+ return Array.isArray(e) ? e.map((n) => qe(n)).filter((n) => n.length > 0) : [];
}
_plates() {
return this._childSlugs().map((t) => this._plate(t));
@@ -1292,7 +1280,7 @@ class Pe extends A {
`sensor.nestquest_${t}_completion_pct_today`
), o = this._state(
`binary_sensor.nestquest_${t}_present_today`
- ), l = n?.attributes ?? {}, a = wt(J(n?.state, 0)), p = wt(J(i?.state, 0)), u = r ? J(r.state, Number.NaN) : Number.NaN, c = Number.isFinite(u) ? xt(u) : a > 0 ? xt(p / a * 100) : 0;
+ ), l = n?.attributes ?? {}, a = St(tt(n?.state, 0)), p = St(tt(i?.state, 0)), u = r ? tt(r.state, Number.NaN) : Number.NaN, c = Number.isFinite(u) ? Ct(u) : a > 0 ? Ct(p / a * 100) : 0;
let f = !0;
const h = l.present;
typeof h == "boolean" ? f = h : o && (f = String(o.state ?? "").trim().toLowerCase() === "on");
@@ -1301,14 +1289,14 @@ class Pe extends A {
if (typeof _ == "string" && _.trim())
m = _.trim();
else {
- const G = o?.attributes?.child_name;
- typeof G == "string" && G.trim() && (m = G.trim());
+ const J = o?.attributes?.child_name;
+ typeof J == "string" && J.trim() && (m = J.trim());
}
- m || (m = be(t));
- const v = xe(
+ m || (m = ke(t));
+ const v = Ce(
o?.attributes?.next_present,
this._timeZone()
- ), j = v ? `Returns ${K(v, this._timeZone())}` : null;
+ ), j = v ? `Returns ${Y(v, this._timeZone())}` : null;
return {
slug: t,
name: m,
@@ -1334,7 +1322,7 @@ class Pe extends A {
}
_boardNotice() {
const t = this._plates();
- return t.length === 0 ? kt : t.every((e) => e.unresolved !== null) ? t.some((e) => e.unresolved === "stale") ? Oe : kt : null;
+ return t.length === 0 ? Nt : t.every((e) => e.unresolved !== null) ? t.some((e) => e.unresolved === "stale") ? Le : Nt : null;
}
_renderNotice(t) {
return d`
@@ -1357,7 +1345,7 @@ class Pe extends A {
${t.name}
- ${Ne}
+ ${Ie}
Unknown
—
@@ -1377,7 +1365,7 @@ class Pe extends A {
${t.name}
- ${Se}
+ ${ze}
Home today
@@ -1396,7 +1384,7 @@ class Pe extends A {
${t.name}
- ${Te}
+ ${Pe}
On travels
${t.returns ?? "Returns —"}
@@ -1405,11 +1393,11 @@ class Pe extends A {
`;
}
_openQuestLog(t) {
- const e = vt(this._config?.quest_log_path);
+ const e = At(this._config?.quest_log_path);
e && (window.history.pushState(null, "", `${e.replace(/\/+$/, "")}/${t}`), window.dispatchEvent(new Event("location-changed")));
}
_dockWeather() {
- const t = vt(this._config?.weather_entity);
+ const t = At(this._config?.weather_entity);
if (!t)
return null;
const e = this._state(t);
@@ -1446,15 +1434,15 @@ class Pe extends A {
if (!t)
return d`
- ${K(this._now, this._timeZone())}
+ ${Y(this._now, this._timeZone())}
- ${me(this._now, this._timeZone())}
+ ${xe(this._now, this._timeZone())}
`;
- const e = we(t.condition), n = $e(t.condition, e), i = t.temperature === null ? g : d`
${Math.round(t.temperature)}°`, r = t.high === null || t.low === null ? null : `${Math.round(t.high)}° / ${Math.round(t.low)}°`;
+ const e = Se(t.condition), n = Te(t.condition, e), i = t.temperature === null ? g : d`
${Math.round(t.temperature)}°`, r = t.high === null || t.low === null ? null : `${Math.round(t.high)}° / ${Math.round(t.low)}°`;
return d`
- ${ze}
+ ${je}
${i}
@@ -1465,15 +1453,21 @@ class Pe extends A {
`;
}
-}
-customElements.define("nestquest-party-board-card", Pe);
-at({
+};
+Q.properties = {
+ hass: { attribute: !1 },
+ _config: { state: !0 },
+ _now: { state: !0 }
+}, Q.styles = [x(Gt), Oe];
+let rt = Q;
+customElements.define("nestquest-party-board-card", rt);
+ut({
type: "nestquest-party-board-card",
name: "NestQuest Party Board",
description: "Kids' attract screen for present and away adventurers."
});
-const Ie = { CHILD: 2 }, Ue = (s) => (...t) => ({ _$litDirective$: s, values: t });
-let Le = class {
+const De = { CHILD: 2 }, He = (s) => (...t) => ({ _$litDirective$: s, values: t });
+let Be = class {
constructor(t) {
}
get _$AU() {
@@ -1489,11 +1483,11 @@ let Le = class {
return this.render(...e);
}
};
-const { I: Re } = ce, Ct = (s) => s, At = () => document.createComment(""), P = (s, t, e) => {
+const { I: Fe } = me, Mt = (s) => s, Ot = () => document.createComment(""), P = (s, t, e) => {
const n = s._$AA.parentNode, i = t === void 0 ? s._$AB : t._$AA;
if (e === void 0) {
- const r = n.insertBefore(At(), i), o = n.insertBefore(At(), i);
- e = new Re(r, o, s, s.options);
+ const r = n.insertBefore(Ot(), i), o = n.insertBefore(Ot(), i);
+ e = new Fe(r, o, s, s.options);
} else {
const r = e._$AB.nextSibling, o = e._$AM, l = o !== s;
if (l) {
@@ -1503,22 +1497,22 @@ const { I: Re } = ce, Ct = (s) => s, At = () => document.createComment(""), P =
if (r !== i || l) {
let a = e._$AA;
for (; a !== r; ) {
- const p = Ct(a).nextSibling;
- Ct(n).insertBefore(a, i), a = p;
+ const p = Mt(a).nextSibling;
+ Mt(n).insertBefore(a, i), a = p;
}
}
}
return e;
-}, k = (s, t, e = s) => (s._$AI(t, e), s), je = {}, De = (s, t = je) => s._$AH = t, He = (s) => s._$AH, X = (s) => {
+}, k = (s, t, e = s) => (s._$AI(t, e), s), Ze = {}, Qe = (s, t = Ze) => s._$AH = t, We = (s) => s._$AH, et = (s) => {
s._$AR(), s._$AA.remove();
};
-const St = (s, t, e) => {
+const zt = (s, t, e) => {
const n = /* @__PURE__ */ new Map();
for (let i = t; i <= e; i++) n.set(s[i], i);
return n;
-}, Tt = Ue(class extends Le {
+}, Pt = He(class extends Be {
constructor(s) {
- if (super(s), s.type !== Ie.CHILD) throw Error("repeat() can only be used in text expressions");
+ if (super(s), s.type !== De.CHILD) throw Error("repeat() can only be used in text expressions");
}
dt(s, t, e) {
let n;
@@ -1532,7 +1526,7 @@ const St = (s, t, e) => {
return this.dt(s, t, e).values;
}
update(s, [t, e, n]) {
- const i = He(s), { values: r, keys: o } = this.dt(t, e, n);
+ const i = We(s), { values: r, keys: o } = this.dt(t, e, n);
if (!Array.isArray(i)) return this.ut = o, r;
const l = this.ut ??= [], a = [];
let p, u, c = 0, f = i.length - 1, h = 0, m = r.length - 1;
@@ -1542,33 +1536,33 @@ const St = (s, t, e) => {
else if (l[f] === o[m]) a[m] = k(i[f], r[m]), f--, m--;
else if (l[c] === o[m]) a[m] = k(i[c], r[m]), P(s, a[m + 1], i[c]), c++, m--;
else if (l[f] === o[h]) a[h] = k(i[f], r[h]), P(s, i[c], i[f]), f--, h++;
- else if (p === void 0 && (p = St(o, h, m), u = St(l, c, f)), p.has(l[c])) if (p.has(l[f])) {
+ else if (p === void 0 && (p = zt(o, h, m), u = zt(l, c, f)), p.has(l[c])) if (p.has(l[f])) {
const _ = u.get(o[h]), v = _ !== void 0 ? i[_] : null;
if (v === null) {
const j = P(s, i[c]);
k(j, r[h]), a[h] = j;
} else a[h] = k(v, r[h]), P(s, i[c], v), i[_] = null;
h++;
- } else X(i[f]), f--;
- else X(i[c]), c++;
+ } else et(i[f]), f--;
+ else et(i[c]), c++;
for (; h <= m; ) {
const _ = P(s, a[m + 1]);
k(_, r[h]), a[h++] = _;
}
for (; c <= f; ) {
const _ = i[c++];
- _ !== null && X(_);
+ _ !== null && et(_);
}
- return this.ut = o, De(s, a), T;
+ return this.ut = o, Qe(s, a), T;
}
-}), Be = [
+}), Ge = [
"nestquest_quest_completed",
"nestquest_quest_uncompleted",
"nestquest_quest_missed",
"nestquest_child_day_complete"
-], Nt = /* @__PURE__ */ new Map();
+], It = /* @__PURE__ */ new Map();
function M(s, t) {
- const e = `${s ?? "local"}|${JSON.stringify(t)}`, n = Nt.get(e);
+ const e = `${s ?? "local"}|${JSON.stringify(t)}`, n = It.get(e);
if (n)
return n;
let i;
@@ -1580,9 +1574,9 @@ function M(s, t) {
} catch {
i = new Intl.DateTimeFormat("en-US", t);
}
- return Nt.set(e, i), i;
+ return It.set(e, i), i;
}
-function Fe(s) {
+function Ve(s) {
const t = s?.config;
if (!t || typeof t != "object")
return;
@@ -1592,10 +1586,10 @@ function Fe(s) {
function D(s, t) {
return `${M(t, { weekday: "long" }).format(s)}, ${M(t, { month: "short", day: "numeric" }).format(s)}`;
}
-function Qe(s, t) {
+function Ke(s, t) {
return M(t, { weekday: "long" }).format(s);
}
-function Ze(s, t) {
+function Je(s, t) {
const e = new Date(s);
return Number.isNaN(e.getTime()) ? "" : M(t, {
hour: "numeric",
@@ -1603,14 +1597,14 @@ function Ze(s, t) {
hour12: !0
}).format(e);
}
-function We(s, t) {
+function Xe(s, t) {
return M(t, {
hour: "numeric",
minute: "2-digit",
hour12: !0
}).format(s);
}
-function Ge(s) {
+function Ye(s) {
if (!s)
return null;
const t = /^(\d{1,2}):(\d{2})$/.exec(s.trim());
@@ -1634,10 +1628,10 @@ function y(s, t) {
function b(s) {
return Math.max(0, Math.round(s));
}
-function Y(s) {
+function nt(s) {
return s.split(/[-_]+/).filter(Boolean).map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" ");
}
-function Ve(s, t) {
+function tn(s, t) {
const e = M(t, {
year: "numeric",
month: "2-digit",
@@ -1659,7 +1653,7 @@ function Ve(s, t) {
);
return Number.isFinite(i) ? i - s : 0;
}
-function Et(s, t) {
+function Ut(s, t) {
if (typeof s != "string")
return null;
const e = s.split("-");
@@ -1672,14 +1666,14 @@ function Et(s, t) {
const a = new Date(n, i - 1, r);
return Number.isNaN(a.getTime()) ? null : a;
}
- const o = Date.UTC(n, i - 1, r), l = new Date(o - Ve(o, t));
+ const o = Date.UTC(n, i - 1, r), l = new Date(o - tn(o, t));
return Number.isNaN(l.getTime()) ? null : l;
}
-function Ke() {
+function en() {
const s = window.location.pathname.split("/").filter(Boolean);
return s.length > 0 ? s[s.length - 1].toLowerCase() : "";
}
-function Je(s) {
+function nn(s) {
if (!s || typeof s != "object")
return null;
const t = s, e = w(t.state).toLowerCase();
@@ -1702,7 +1696,7 @@ function Je(s) {
on_time: t.on_time === !0 ? !0 : t.on_time === !1 ? !1 : null
};
}
-const Xe = {
+const sn = {
"clear-night": "Clear",
cloudy: "Cloudy",
exceptional: "Clear",
@@ -1718,7 +1712,7 @@ const Xe = {
sunny: "Sunny",
windy: "Windy",
"windy-variant": "Windy"
-}, Ye = {
+}, rn = {
"clear-night": "Clear night skies",
cloudy: "Grey skies today",
exceptional: "A striking day",
@@ -1735,14 +1729,14 @@ const Xe = {
windy: "A blustery day",
"windy-variant": "A blustery day"
};
-function tn(s) {
- const t = Xe[s];
+function on(s) {
+ const t = sn[s];
return t || s.charAt(0).toUpperCase() + s.slice(1);
}
-function en(s, t) {
- return Ye[s] ?? t;
+function an(s, t) {
+ return rn[s] ?? t;
}
-const Mt = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", nn = "polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%)", Ot = [-9, 6, -4], sn = It`
+const Rt = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", ln = "polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%)", Lt = [-9, 6, -4], cn = Ht`
* {
box-sizing: border-box;
}
@@ -1802,7 +1796,7 @@ const Mt = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", nn = "polygon(50%
width: 96px;
height: 110px;
padding: 4px;
- clip-path: ${x(Mt)};
+ clip-path: ${x(Rt)};
background: rgba(255, 255, 255, 0.22);
}
@@ -1813,7 +1807,7 @@ const Mt = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", nn = "polygon(50%
align-items: center;
justify-content: center;
padding-bottom: 32px;
- clip-path: ${x(Mt)};
+ clip-path: ${x(Rt)};
background: var(--nq-p-crest);
}
@@ -1879,7 +1873,7 @@ const Mt = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", nn = "polygon(50%
justify-content: center;
width: 44px;
height: 44px;
- clip-path: ${x(nn)};
+ clip-path: ${x(ln)};
background: var(--nq-brand-gradient);
}
@@ -2599,7 +2593,7 @@ const Mt = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", nn = "polygon(50%
aria-hidden="true"
>
-`, rn = d`