/** * TaskMate Family Goal Card * Shows the shared family co-op goal (combined points across all children) with * a progress bar toward the target and the reward. Reads the overview sensor's * `family_goal` attribute. * * Single layout, so it consumes the design tokens directly (like the routine * card) rather than carrying a second _renderDesigned() template. Every * --tmd-* reference has the card's original value as its fallback, so classic * — which defines no tokens — renders exactly as it did before. */ const LitElement = customElements.get("hui-masonry-view") ? Object.getPrototypeOf(customElements.get("hui-masonry-view")) : Object.getPrototypeOf(customElements.get("hui-view")); const html = LitElement.prototype.html; const css = LitElement.prototype.css; const _safeColor = (c, d) => (typeof c === "string" && /^#[0-9a-fA-F]{3,8}$/.test(c) ? c : d); const DEFAULT_ACCENT = "#16a085"; class TaskMateFamilyGoalCard extends LitElement { static get properties() { return { hass: { type: Object }, config: { type: Object } }; } setConfig(config) { if (!config || !config.entity) { throw new Error("A TaskMate overview entity is required"); } this.config = config; } static getStubConfig() { return { entity: "sensor.taskmate_overview" }; } getCardSize() { return 2; } _t(key, params) { const fn = window.__taskmate_localize; return fn ? fn(this.hass, key, params) : key; } /** * Resolve the active design, stamp data-tm-design on the host (which is what * makes the :host-scoped token block apply inside this shadow root), and set * the accent. The accent is set as an inline host property, not from a *